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.

136 lines
3.8 KiB

  1. /*++
  2. Copyright (c) 1993 Microsoft Corporation
  3. Module Name:
  4. SHOWPERF.H
  5. Abstract:
  6. Author:
  7. Bob Watson (a-robw)
  8. Revision History:
  9. 23 NOV 94
  10. --*/
  11. #ifndef _SHOWPERF_H_
  12. #define _SHOWPERF_H_
  13. // WIN32 Constant Definitions
  14. //
  15. #define BEEP_EXCLAMATION MB_ICONEXCLAMATION
  16. #define OF_SEARCH 0
  17. #define SMALL_BUFFER_SIZE 1024
  18. #define MEDIUM_BUFFER_SIZE 4096
  19. #define LARGE_BUFFER_SIZE 65536
  20. // define dialog box button states
  21. #define ENABLED TRUE
  22. #define DISABLED FALSE
  23. #define CHECKED 1
  24. #define UNCHECKED 0
  25. // define Mailbox buttons
  26. #define MBOK_EXCLAIM (MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL)
  27. #define MBOK_INFO (MB_OK | MB_ICONINFORMATION | MB_TASKMODAL)
  28. #define MBOKCANCEL_EXCLAIM (MB_OKCANCEL | MB_ICONEXCLAMATION | MB_TASKMODAL)
  29. #define MBOKCANCEL_INFO (MB_OKCANCEL | MB_ICONINFORMATION | MB_TASKMODAL)
  30. #define MBOKCANCEL_QUESTION (MB_OKCANCEL | MB_ICONQUESTION | MB_TASKMODAL)
  31. #define MBYESNO_QUESTION (MB_YESNO | MB_ICONQUESTION | MB_TASKMODAL)
  32. #define MBYESNOCANCEL_QUESTION (MB_YESNOCANCEL | MB_ICONQUESTION | MB_TASKMODAL)
  33. #define MBYESNOCANCEL_EXCLAIM (MB_YESNOCANCEL | MB_ICONEXCLAMATION | MB_TASKMODAL)
  34. // other constants
  35. #define MAX_USERNAME 15
  36. #define MAX_DOMAINNAME 15
  37. #define MAX_ORGNAME 255
  38. #define MAX_PRODUCT_NAME_LENGTH 32
  39. //
  40. // WIN32 Version of common macros
  41. //
  42. #define GET_CONTROL_ID(w) LOWORD(w)
  43. #define GET_NOTIFY_MSG(w, l) HIWORD(w)
  44. #define GET_COMMAND_WND(l) ((HWND) (l))
  45. #define GET_INSTANCE(h) ((HINSTANCE) GetWindowLongPtr(h, GWLP_HINSTANCE))
  46. #define SAVE_HWND(w, o, v) SetWindowLong(w, o, (LONG) v)
  47. #define GET_HWND(w, o) (HWND) GetWindowLong(w, o)
  48. #define SET_HWND(w, o, v) SetWindowLong(w, o, (DWORD) v)
  49. #define SET_INFO(w, o, p) (LPVOID) SetWindowLong(w, o, (LONG) p)
  50. #define GET_INFO(w, o) (LPVOID) GetWindowLong(w, o)
  51. #define SEND_WM_COMMAND(w, c, n, cw) SendMessageW(w, WM_COMMAND, MAKEWPARAM(c, n), (LPARAM) cw)
  52. #define POST_WM_COMMAND(w, c, n, cw) PostMessageW(w, WM_COMMAND, MAKEWPARAM(c, n), (LPARAM) cw)
  53. #define GetMyLastError GetLastError
  54. #define CLEAR_FIRST_FOUR_BYTES(x) * (DWORD *)(x) = 0L
  55. #define SET_WAIT_CURSOR SetCursor(LoadCursor(NULL, IDC_WAIT))
  56. #define SET_ARROW_CURSOR SetCursor(LoadCursor(NULL, IDC_ARROW))
  57. // Memory Allocation
  58. #define MemoryAllocate(x) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, x)
  59. #define MemoryFree(x) if (x != NULL) HeapFree(GetProcessHeap(), 0, x)
  60. #define MemoryResize(x,y) (x != NULL ? HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, x, y) \
  61. : HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, y))
  62. #define MemorySize(x) (x != NULL ? (DWORD) HeapSize(GetProcessHeap(), 0, x) : (DWORD) 0)
  63. //
  64. // Global Functions
  65. //
  66. LPCWSTR
  67. GetStringResource(
  68. HANDLE hInstance,
  69. UINT nId
  70. );
  71. BOOL
  72. ShowAppHelp(
  73. HWND hWnd
  74. );
  75. int
  76. DisplayMessageBox(
  77. HWND hWnd,
  78. UINT nMessageId,
  79. UINT nTitleId,
  80. UINT nStyle
  81. );
  82. VOID
  83. SetHelpContextId(
  84. WORD wId
  85. );
  86. WORD
  87. GetHelpContextId(
  88. );
  89. // Main Dialog function
  90. //
  91. INT_PTR
  92. MainDlgProc(
  93. HWND hDlg,
  94. UINT message,
  95. WPARAM wParam,
  96. LPARAM lParam
  97. );
  98. // Main Window functions
  99. //
  100. LRESULT CALLBACK
  101. MainWndProc(
  102. HWND hWnd, // window handle
  103. UINT message, // type of message
  104. WPARAM wParam, // additional information
  105. LPARAM lParam // additional information
  106. );
  107. BOOL
  108. RegisterMainWindowClass(
  109. HINSTANCE hInstance
  110. );
  111. HWND
  112. CreateMainWindow(
  113. HINSTANCE hInstance
  114. );
  115. #endif // _SHOWPERF_H_