Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: netapi.cpp
  7. //
  8. // Contents: Network/SENS API wrappers
  9. //
  10. // Classes:
  11. //
  12. // Notes:
  13. //
  14. // History: 08-Dec-97 rogerg Created.
  15. //
  16. //--------------------------------------------------------------------------
  17. #include "lib.h"
  18. //+---------------------------------------------------------------------------
  19. //
  20. // Function: ResetNetworkIdle, public
  21. //
  22. // Synopsis: post messages to wininet to keep wininet connection
  23. // from thinking it is idle so the connection isn't closed
  24. // in the middle of a sync.
  25. //
  26. // Code supplied by Darren Mitchell.
  27. //
  28. // Arguments:
  29. //
  30. // Returns:
  31. //
  32. // Modifies:
  33. //
  34. // History: 01-June-98 rogerg Created.
  35. //
  36. //----------------------------------------------------------------------------
  37. STDAPI ResetNetworkIdle()
  38. {
  39. #define WM_DIALMON_FIRST WM_USER+100
  40. #define WM_WINSOCK_ACTIVITY WM_DIALMON_FIRST + 0
  41. // Inform dial monitor that stuff is going on to keep it from
  42. // hanging up any idle connections.
  43. HWND hwndMonitorWnd = FindWindow(TEXT("MS_AutodialMonitor"),NULL);
  44. if (hwndMonitorWnd)
  45. {
  46. PostMessage(hwndMonitorWnd,WM_WINSOCK_ACTIVITY,0,0);
  47. }
  48. hwndMonitorWnd = FindWindow(TEXT("MS_WebcheckMonitor"),NULL);
  49. if (hwndMonitorWnd)
  50. {
  51. PostMessage(hwndMonitorWnd,WM_WINSOCK_ACTIVITY,0,0);
  52. }
  53. return NOERROR;
  54. }