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.

107 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. RemoteDesktopServerEventSink
  5. Abstract:
  6. This listens to the events from the IRemoteDesktopServer so
  7. we can find out when the client connects/disconnects
  8. Author:
  9. Marc Reyhner 7/5/2000
  10. --*/
  11. #include "stdafx.h"
  12. #ifdef TRC_FILE
  13. #undef TRC_FILE
  14. #endif
  15. #define TRC_FILE "rcrdses"
  16. #include "RemoteDesktopServerEventSink.h"
  17. #include "DirectPlayConnection.h"
  18. #include "rcontrol.h"
  19. #include "resource.h"
  20. VOID __stdcall
  21. CRemoteDesktopServerEventSink::OnConnected(
  22. )
  23. /*++
  24. Routine Description:
  25. This is called when the client has connected. We update the taskbar icon
  26. to reflect the fact that someone has connected
  27. Arguments:
  28. None
  29. Return Value:
  30. None
  31. --*/
  32. {
  33. TCHAR tipText[MAX_STR_LEN];
  34. TCHAR infoText[MAX_STR_LEN];
  35. TCHAR infoTitle[MAX_STR_LEN];
  36. DC_BEGIN_FN("CRemoteDesktopServerEventSink::OnConnected");
  37. LoadStringSimple(IDS_TRAYTOOLTIPCONNECTED,tipText);
  38. _tcsncpy(g_iconData.szTip,tipText, 128 - 1);
  39. LoadStringSimple(IDS_TRAYINFOTEXT,infoText);
  40. _tcsncpy(g_iconData.szInfo,infoText, 256 - 1);
  41. LoadStringSimple(IDS_TRAYINFOTITLE,infoTitle);
  42. _tcsncpy(g_iconData.szInfoTitle,infoTitle, 64 - 1);
  43. g_iconData.uTimeout = (1000 * 15);
  44. g_iconData.dwInfoFlags = NIIF_INFO;
  45. g_iconData.uFlags = NIF_INFO|NIF_TIP;
  46. Shell_NotifyIcon(NIM_MODIFY,&g_iconData);
  47. //
  48. // We want to kill the direct play connection now since we
  49. // are sure the client has the info they need.
  50. //
  51. g_DpConnection->DisconnectRemoteApplication();
  52. DC_END_FN();
  53. }
  54. VOID __stdcall
  55. CRemoteDesktopServerEventSink::OnDisconnected(
  56. )
  57. /*++
  58. Routine Description:
  59. This is called when the client has disconnected. We send a quit
  60. message to indicate that we should exit the application.
  61. Arguments:
  62. None
  63. Return Value:
  64. None
  65. --*/
  66. {
  67. DC_BEGIN_FN("CRemoteDesktopServerEventSink::OnDisconnected");
  68. PostQuitMessage(0);
  69. DC_END_FN();
  70. }