Leaked source code of windows server 2003
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.

127 lines
3.5 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // File: ReconnectDlg.h
  4. //
  5. // Module: CMMON32.EXE
  6. //
  7. // Synopsis: implement the reconnect dialog class CReconnectDlg
  8. //
  9. // Copyright (c) 1998-1999 Microsoft Corporation
  10. //
  11. // Author: fegnsun Created 02/17/98
  12. //
  13. //+----------------------------------------------------------------------------
  14. #include "cmmaster.h"
  15. #include "ReconnectDlg.h"
  16. #include "Connection.h"
  17. #include "resource.h"
  18. // Question: Do we need help for reconnect dialog
  19. const DWORD CReconnectDlg::m_dwHelp[] = {0,0};
  20. //+----------------------------------------------------------------------------
  21. //
  22. // Function: CReconnectDlg::Create
  23. //
  24. // Synopsis: Create the reconnect modeless dialog
  25. //
  26. // Arguments: HINSTANCE hInstance - the instance for the dialog resource
  27. // HWND hWndParent - The parant window
  28. // LPCTSTR lpszReconnectMsg - The reconnect message on the dialog
  29. // HICON hIcon - The icon on the dialog
  30. //
  31. // Returns: HWND - The reconnect dialog window handle
  32. //
  33. // History: fengsun Created Header 2/17/98
  34. //
  35. //+----------------------------------------------------------------------------
  36. HWND CReconnectDlg::Create(HINSTANCE hInstance, HWND hWndParent,
  37. LPCTSTR lpszReconnectMsg, HICON hIcon)
  38. {
  39. MYDBGASSERT(lpszReconnectMsg);
  40. MYDBGASSERT(hIcon);
  41. if (!CModelessDlg::Create(hInstance, IDD_RECONNECT, hWndParent))
  42. {
  43. MYDBGASSERT(FALSE);
  44. return NULL;
  45. }
  46. UpdateFont(m_hWnd);
  47. SetDlgItemTextU(m_hWnd,IDC_RECONNECT_MSG, lpszReconnectMsg);
  48. SendDlgItemMessageU(m_hWnd,IDC_CONNSTAT_ICON,STM_SETIMAGE,
  49. IMAGE_ICON,(LPARAM) hIcon);
  50. SetWindowPos(m_hWnd, HWND_TOPMOST, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
  51. return m_hWnd;
  52. }
  53. //+----------------------------------------------------------------------------
  54. //
  55. // Function: CReconnectDlg::OnOK
  56. //
  57. // Synopsis: called when OK button is clicked
  58. //
  59. // Arguments: None
  60. //
  61. // Returns: Nothing
  62. //
  63. // History: Created Header 2/17/98
  64. //
  65. //+----------------------------------------------------------------------------
  66. void CReconnectDlg::OnOK()
  67. {
  68. //
  69. // The connection thread will kill the reconnect dialog and call cmdial to reconnect
  70. //
  71. PostThreadMessageU(GetCurrentThreadId(), CCmConnection::WM_CONN_EVENT,
  72. CCmConnection::EVENT_RECONNECT, 0);
  73. }
  74. //+----------------------------------------------------------------------------
  75. //
  76. // Function: CReconnectDlg::OnInitDialog
  77. //
  78. // Synopsis: Called when dialog is intialized and WM_INITDIALOG is received.
  79. //
  80. // Arguments: None
  81. //
  82. // Returns: BOOL - FALSE is focus was assigned to a control.
  83. //
  84. // History: nickball 03/22/00 Created
  85. //
  86. //+----------------------------------------------------------------------------
  87. BOOL CReconnectDlg::OnInitDialog()
  88. {
  89. SetForegroundWindow(m_hWnd);
  90. Flash();
  91. return FALSE;
  92. }
  93. //+----------------------------------------------------------------------------
  94. //
  95. // Function: CReconnectDlg::OnCancel
  96. //
  97. // Synopsis: Called when cancel button is clicked
  98. //
  99. // Arguments: None
  100. //
  101. // Returns: Nothing
  102. //
  103. // History: Created Header 2/17/98
  104. //
  105. //+----------------------------------------------------------------------------
  106. void CReconnectDlg::OnCancel()
  107. {
  108. //
  109. // The connection thread will kill the reconnect dialog and quit
  110. //
  111. PostThreadMessageU(GetCurrentThreadId(), CCmConnection::WM_CONN_EVENT,
  112. CCmConnection::EVENT_USER_DISCONNECT, 0);
  113. }