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.

63 lines
1.8 KiB

  1. //
  2. // dlgbase.h: base class for dialogs
  3. // (modal and modeless)
  4. //
  5. // Copyright (C) Microsoft Corporation 1999-2000
  6. // (nadima)
  7. //
  8. #ifndef _dlgbase_h_
  9. #define _dlgbase_h_
  10. class CDlgBase
  11. {
  12. public:
  13. CDlgBase(HWND hwndOwner, HINSTANCE hInst, DCINT 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. HWND GetHwnd() {return _hwndDlg;}
  23. HWND GetOwner() {return _hwndOwner;}
  24. protected:
  25. //
  26. // Protected dialog utility functions
  27. //
  28. void SetDialogAppIcon(HWND hwndDlg);
  29. DCVOID DCINTERNAL EnableDlgItem(HWND hwndDlg,
  30. DCUINT dlgItemId,
  31. DCBOOL enabled);
  32. VOID CenterWindow(HWND hwndCenterOn, INT xRatio=2, INT yRatio=2);
  33. protected:
  34. void RepositionControls(int moveDeltaX, int moveDeltaY, UINT* ctlIDs, int numID);
  35. void EnableControls(UINT* ctlIDs, int numID, BOOL bEnable);
  36. DLGTEMPLATE* DoLockDlgRes(LPCTSTR lpszResName);
  37. HWND _hwndDlg;
  38. HWND _hwndOwner;
  39. HINSTANCE _hInstance;
  40. DCINT _dlgResId;
  41. //
  42. // Start position
  43. //
  44. int _startupLeft;
  45. int _startupTop;
  46. //
  47. // End positon on exit
  48. //
  49. int _Left;
  50. int _Top;
  51. };
  52. #endif //_dlgbase_h_