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.

218 lines
5.2 KiB

  1. //
  2. // maindlg.h: main dialog box
  3. // gathers connection info and hosts tabs
  4. //
  5. // Copyright Microsoft Corportation 2000
  6. // (nadima)
  7. //
  8. #ifndef _maindlg_h_
  9. #define _maindlg_h_
  10. #include "dlgbase.h"
  11. #include "sh.h"
  12. #include "tscsetting.h"
  13. #include "contwnd.h"
  14. #include "progband.h"
  15. #define OPTIONS_STRING_MAX_LEN 64
  16. //
  17. // Dialog expand/contract amount in dlus
  18. // compute this val is the vertical delta in dlus
  19. // between the two valid heights of the main dialog
  20. //
  21. #define LOGON_DLG_EXPAND_AMOUNT 177
  22. #ifdef OS_WINCE
  23. #define LOGON_DLG_EXPAND_AMOUNT_VGA 65
  24. #endif
  25. #define NUM_TABS 5
  26. #define TAB_GENERAL_IDX 0
  27. #define TAB_DISPLAY_IDX 1
  28. #define TAB_LOCAL_RESOURCES_IDX 2
  29. typedef struct tag_TABDLGINFO
  30. {
  31. HWND hwndCurPropPage;
  32. DLGTEMPLATE *pdlgTmpl[NUM_TABS];
  33. DLGPROC pDlgProc[NUM_TABS];
  34. } TABDLGINFO, *PTABDLGINFO;
  35. class CPropGeneral;
  36. class CPropLocalRes;
  37. class CPropDisplay;
  38. class CPropRun;
  39. class CPropPerf;
  40. class CMainDlg : public CDlgBase
  41. {
  42. typedef enum
  43. {
  44. stateNotConnected = 0x0,
  45. stateConnecting = 0x1,
  46. stateConnected = 0x2
  47. } mainDlgConnectionState;
  48. public:
  49. CMainDlg(HWND hwndOwner, HINSTANCE hInst, CSH* pSh,
  50. CContainerWnd* pContainerWnd,
  51. CTscSettings* pTscSettings,
  52. BOOL fStartExpanded=FALSE,
  53. INT nStartTab = 0);
  54. ~CMainDlg();
  55. virtual HWND StartModeless();
  56. virtual INT_PTR CALLBACK DialogBoxProc(HWND hwndDlg,
  57. UINT uMsg,
  58. WPARAM wParam,
  59. LPARAM lParam);
  60. static INT_PTR CALLBACK StaticDialogBoxProc(HWND hwndDlg,
  61. UINT uMsg,
  62. WPARAM wParam,
  63. LPARAM lParam);
  64. static CMainDlg* _pMainDlgInstance;
  65. private:
  66. //
  67. // Private member functions
  68. //
  69. void DlgToSettings();
  70. void SettingsToDlg();
  71. HBITMAP LoadBitmapGetSize(HINSTANCE hInstance, UINT resid, SIZE* pSize);
  72. BOOL PaintBrandImage(HWND hwnd, HDC hdc, INT bgColor);
  73. VOID SetConnectionState(mainDlgConnectionState newState);
  74. BOOL OnStartConnection();
  75. BOOL OnEndConnection(BOOL fConnected);
  76. #ifndef OS_WINCE
  77. BOOL PaintBrandingText(HBITMAP hbmBrandImage);
  78. #endif
  79. VOID PropagateMsgToChildren(HWND hwndDlg,
  80. UINT uMsg,
  81. WPARAM wParam,
  82. LPARAM lParam);
  83. //
  84. // Font related helpers
  85. //
  86. void SetFontFaceFromResource(PLOGFONT plf, UINT idFaceName);
  87. void SetFontSizeFromResource(PLOGFONT plf, UINT idSizeName);
  88. #ifndef OS_WINCE
  89. HFONT LoadFontFromResourceInfo(UINT idFace, UINT idSize, BOOL fBold);
  90. BOOL InitializeBmps();
  91. BOOL BrandingQueryNewPalette(HWND hDlg);
  92. BOOL BrandingPaletteChanged(HWND hDlg, HWND hWndPalChg);
  93. #endif
  94. BOOL InitializePerfStrings();
  95. protected:
  96. //
  97. // Protected member functions
  98. //
  99. void ToggleExpandedState();
  100. BOOL InitTabs();
  101. BOOL OnTabSelChange();
  102. #ifndef OS_WINCE
  103. void SetupDialogSysMenu();
  104. #endif
  105. void SaveDialogStartupInfo();
  106. private:
  107. CSH* _pSh;
  108. CTscSettings* _pTscSettings;
  109. //
  110. // Container window (parent of this dialog)
  111. //
  112. CContainerWnd* _pContainerWnd;
  113. //
  114. // Dialog is 'expanded' version
  115. //
  116. BOOL _fShowExpanded;
  117. TCHAR _szOptionsMore[OPTIONS_STRING_MAX_LEN];
  118. TCHAR _szOptionsLess[OPTIONS_STRING_MAX_LEN];
  119. //
  120. // In 256 color and lower mode we use 'low color' bitmaps
  121. // for palette issues (and bandwidth reduction for nested clients)
  122. //
  123. BOOL _fUse16ColorBitmaps;
  124. //
  125. // Screen depth the images are valid for
  126. //
  127. UINT _lastValidBpp;
  128. //
  129. // Tab control bounds
  130. //
  131. RECT _rcTab;
  132. TABDLGINFO _tabDlgInfo;
  133. //
  134. // Progress band
  135. //
  136. INT _nBrandImageHeight;
  137. INT _nBrandImageWidth;
  138. TCHAR _szCloseText[128];
  139. TCHAR _szCancelText[128];
  140. BOOL _fStartExpanded;
  141. //
  142. // Tab to start on
  143. //
  144. INT _nStartTab;
  145. //
  146. // Brand img
  147. //
  148. HBITMAP _hBrandImg;
  149. HPALETTE _hBrandPal;
  150. //
  151. // Current connection state
  152. //
  153. mainDlgConnectionState _connectionState;
  154. //
  155. // Control to restore the focus to since we force
  156. // it to the cancel button during connection
  157. //
  158. HWND _hwndRestoreFocus;
  159. #ifdef OS_WINCE
  160. BOOL _fVgaDisplay;
  161. #endif
  162. private:
  163. //
  164. // Property pages
  165. //
  166. CPropGeneral* _pGeneralPg;
  167. CPropDisplay* _pPropDisplayPg;
  168. CPropLocalRes* _pLocalResPg;
  169. CPropRun* _pRunPg;
  170. CPropPerf* _pPerfPg;
  171. //
  172. // Progress band
  173. //
  174. CProgressBand* _pProgBand;
  175. };
  176. #endif // _maindlg_h_