Source code of Windows XP (NT5)
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.

119 lines
3.0 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 MAX_PATH_BYTES (MAX_PATH * sizeof(TCHAR))
  18. #define SMALL_BUFFER_SIZE 1023
  19. #define SMALL_BUFFER_BYTES ((SMALL_BUFFER_SIZE + 1) * sizeof (TCHAR))
  20. #define MEDIUM_BUFFER_SIZE 4095
  21. #define MEDIUM_BUFFER_BYTES ((MEDIUM_BUFFER_SIZE + 1) * sizeof (TCHAR))
  22. #define LARGE_BUFFER_SIZE 65535
  23. #define LARGE_BUFFER_BYTES ((LARGE_BUFFER_SIZE + 1) * sizeof (TCHAR))
  24. // define dialog box button states
  25. #define ENABLED TRUE
  26. #define DISABLED FALSE
  27. #define CHECKED 1
  28. #define UNCHECKED 0
  29. // define Mailbox buttons
  30. #define MBOK_EXCLAIM (MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL)
  31. #define MBOK_INFO (MB_OK | MB_ICONINFORMATION | MB_TASKMODAL)
  32. #define MBOKCANCEL_EXCLAIM (MB_OKCANCEL | MB_ICONEXCLAMATION | MB_TASKMODAL)
  33. #define MBOKCANCEL_INFO (MB_OKCANCEL | MB_ICONINFORMATION | MB_TASKMODAL)
  34. #define MBOKCANCEL_QUESTION (MB_OKCANCEL | MB_ICONQUESTION | MB_TASKMODAL)
  35. #define MBYESNO_QUESTION (MB_YESNO | MB_ICONQUESTION | MB_TASKMODAL)
  36. #define MBYESNOCANCEL_QUESTION (MB_YESNOCANCEL | MB_ICONQUESTION | MB_TASKMODAL)
  37. #define MBYESNOCANCEL_EXCLAIM (MB_YESNOCANCEL | MB_ICONEXCLAMATION | MB_TASKMODAL)
  38. // other constants
  39. #define MAX_USERNAME 15
  40. #define MAX_DOMAINNAME 15
  41. #define MAX_ORGNAME 255
  42. #define MAX_PRODUCT_NAME_LENGTH 32
  43. //
  44. // WIN32 Version of common macros
  45. //
  46. #define GLOBAL_ALLOC(s) GlobalAlloc(GPTR,s)
  47. #define GLOBAL_FREE_IF_ALLOC(p) (p != NULL ? GlobalFree(p) : 0)
  48. #define GET_CONTROL_ID(w) (LOWORD(w))
  49. #define GET_NOTIFY_MSG(w,l) (HIWORD(w))
  50. #define GET_COMMAND_WND(l) ((HWND)(l))
  51. #define GET_INSTANCE(h) ((HINSTANCE)GetWindowLongPtr(h, GWLP_HINSTANCE))
  52. #define SAVE_HWND(w,o,v) SetWindowLong (w,o,(LONG)v)
  53. #define GET_HWND(w,o) (HWND)GetWindowLong (w,o)
  54. #define SET_HWND(w,o,v) SetWindowLong (w,o, (DWORD)v)
  55. #define SET_INFO(w,o,p) (LPVOID)SetWindowLong (w,o,(LONG)p)
  56. #define GET_INFO(w,o) (LPVOID)GetWindowLong (w,o)
  57. #define SEND_WM_COMMAND(w,c,n,cw) SendMessage (w, WM_COMMAND, MAKEWPARAM(c,n), (LPARAM)cw)
  58. #define POST_WM_COMMAND(w,c,n,cw) PostMessage (w, WM_COMMAND, MAKEWPARAM(c,n), (LPARAM)cw)
  59. #define GetMyLastError GetLastError
  60. #define CLEAR_FIRST_FOUR_BYTES(x) *(DWORD *)(x) = 0L
  61. #define SET_WAIT_CURSOR (SetCursor(LoadCursor(NULL, IDC_WAIT)))
  62. #define SET_ARROW_CURSOR (SetCursor(LoadCursor(NULL, IDC_ARROW)))
  63. //
  64. // Global Functions
  65. //
  66. LPCTSTR
  67. GetStringResource (
  68. IN HANDLE hInstance,
  69. IN UINT nId
  70. );
  71. BOOL
  72. ShowAppHelp (
  73. IN HWND hWnd
  74. );
  75. int
  76. DisplayMessageBox (
  77. IN HWND hWnd,
  78. IN UINT nMessageId,
  79. IN UINT nTitleId,
  80. IN UINT nStyle
  81. );
  82. VOID
  83. SetHelpContextId (
  84. WORD wId
  85. );
  86. WORD
  87. GetHelpContextId (
  88. );
  89. #endif // _SHOWPERF_H_