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.

82 lines
2.8 KiB

  1. /****************************************************************************
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name: cplsimpledialogs.h
  4. Author: toddb - 10/06/98
  5. ****************************************************************************/
  6. #pragma once
  7. // Simple dialog class that shows a dialog with a title, a string, and an edit box.
  8. // Input into the edit box is limited according to the flags. The text from the
  9. // edit box is available to the class creator after the dialog is dismissed. This
  10. // class is used for "Specify Digits" and "Add Prefix".
  11. //
  12. // Sample usage:
  13. // CEditDialog ed;
  14. // ed.DoModal(hwnd,IDS_TITLE,IDS_TEXT,LIF_NUMBER);
  15. // ed.GetString();
  16. class CEditDialog
  17. {
  18. public:
  19. CEditDialog();
  20. ~CEditDialog();
  21. INT_PTR DoModal(HWND hwndParent, int iTitle, int iText, int iDesc, DWORD dwFlags);
  22. LPTSTR GetString();
  23. protected:
  24. LPTSTR m_psz; // pointer to allocated buffer for string result
  25. int m_iTitle; // resource id to load for title
  26. int m_iText; // resource id to load for body text
  27. int m_iDesc; // resource id to load for description of edit field (should contain a "&")
  28. DWORD m_dwFlags; // limit input flags, or zero to allow all input
  29. static INT_PTR CALLBACK DialogProc(HWND, UINT, WPARAM, LPARAM);
  30. BOOL OnInitDialog(HWND hwnd);
  31. void OnOK(HWND hwnd);
  32. };
  33. // The simple dialog that pops up to ask what we are waiting for. It presents
  34. // a bunch of radio buttons for each choice and a spin button for the seconds.
  35. class CWaitForDialog
  36. {
  37. public:
  38. CWaitForDialog();
  39. ~CWaitForDialog();
  40. INT_PTR DoModal(HWND hwndParent);
  41. int GetWaitType();
  42. protected:
  43. int m_iRes; // Integer return value
  44. static INT_PTR CALLBACK DialogProc(HWND, UINT, WPARAM, LPARAM);
  45. BOOL OnInitDialog(HWND hwnd);
  46. void OnOK(HWND hwnd);
  47. };
  48. // This dialog presents the user with choices for what parts of the destination
  49. // number need to be dialed. It cat's the results into a WCHAR buffer which
  50. // can then be retreived.
  51. class CDestNumDialog
  52. {
  53. public:
  54. CDestNumDialog(BOOL bDialCountryCode, BOOL bDialAreaCode);
  55. ~CDestNumDialog();
  56. INT_PTR DoModal(HWND hwndParent);
  57. PWSTR GetResult();
  58. protected:
  59. WCHAR m_wsz[4]; // return value is from 1 to 3 wide characters, null terminated
  60. BOOL m_bDialCountryCode; // initial value for "Dial Country Code" checkbox
  61. BOOL m_bDialAreaCode; // initial value for "Dial Area Code" checkbox
  62. static INT_PTR CALLBACK DialogProc(HWND, UINT, WPARAM, LPARAM);
  63. BOOL OnInitDialog(HWND hwnd);
  64. void OnOK(HWND hwnd);
  65. };