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.

66 lines
1.9 KiB

  1. //
  2. // dlgbase.h: base class for dialogs
  3. // (modal and modeless)
  4. //
  5. // Copyright (C) Microsoft Corporation 1999-2001
  6. // (nadima)
  7. //
  8. #ifndef _dlgbase_h_
  9. #define _dlgbase_h_
  10. class CDlgBase
  11. {
  12. public:
  13. CDlgBase(HWND hwndOwner, HINSTANCE hInst, INT dlgResId);
  14. virtual ~CDlgBase();
  15. virtual INT_PTR CALLBACK DialogBoxProc (HWND hwndDlg, UINT uMsg,WPARAM wParam, LPARAM lParam);
  16. BOOL GetPosition(int* pLeft, int* pTop);
  17. BOOL SetPosition(int left, int top);
  18. void SetStartupPosLeft(int left) {_startupLeft = left;}
  19. void SetStartupPosTop(int top) {_startupTop = top;}
  20. int GetStartupPosLeft() {return _startupLeft;}
  21. int GetStartupPosTop() {return _startupTop;}
  22. protected:
  23. //
  24. // Protected dialog utility functions
  25. //
  26. INT CreateModalDialog(LPCTSTR lpTemplateName);
  27. static INT_PTR CALLBACK StaticDialogBoxProc(HWND _hwndDlgDlg,
  28. UINT uMsg,
  29. WPARAM wParam,
  30. LPARAM lParam);
  31. void SetDialogAppIcon(HWND hwndDlg);
  32. void EnableDlgItem(UINT dlgItemId,
  33. BOOL enabled);
  34. void CenterWindow(HWND hwndCenterOn, INT xRatio=2, INT yRatio=2);
  35. protected:
  36. void RepositionControls(int moveDeltaX, int moveDeltaY, UINT* ctlIDs, int numID);
  37. void EnableControls(UINT* ctlIDs, int numID, BOOL bEnable);
  38. DLGTEMPLATE* DoLockDlgRes(LPCTSTR lpszResName);
  39. HWND _hwndDlg;
  40. HWND _hwndOwner;
  41. HINSTANCE _hInstance;
  42. INT _dlgResId;
  43. //
  44. // Start position
  45. //
  46. int _startupLeft;
  47. int _startupTop;
  48. //
  49. // End positon on exit
  50. //
  51. int _Left;
  52. int _Top;
  53. };
  54. #endif //_dlgbase_h_