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.

88 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1993 Microsoft Corporation
  3. Module Name:
  4. C2Inc.H
  5. Abstract:
  6. Author:
  7. Bob Watson (a-robw)
  8. Revision History:
  9. 23 NOV 94
  10. --*/
  11. #ifndef _C2INC_H_
  12. #define _C2INC_H_
  13. #include <tchar.h>
  14. // WIN32 Constant Definitions
  15. //
  16. #define BEEP_EXCLAMATION MB_ICONEXCLAMATION
  17. #define OF_SEARCH 0
  18. #define MAX_PATH_BYTES (MAX_PATH * sizeof(TCHAR))
  19. #define SMALL_BUFFER_SIZE 1023
  20. #define SMALL_BUFFER_BYTES ((SMALL_BUFFER_SIZE + 1) * sizeof (TCHAR))
  21. #define MEDIUM_BUFFER_SIZE 4095
  22. #define MEDIUM_BUFFER_BYTES ((MEDIUM_BUFFER_SIZE + 1) * sizeof (TCHAR))
  23. #define LARGE_BUFFER_SIZE 65535
  24. #define LARGE_BUFFER_BYTES ((LARGE_BUFFER_SIZE + 1) * sizeof (TCHAR))
  25. // define dialog box button states
  26. #define ENABLED TRUE
  27. #define DISABLED FALSE
  28. #define CHECKED 1
  29. #define UNCHECKED 0
  30. // define Mailbox buttons
  31. #define MBOK_EXCLAIM (MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL)
  32. #define MBOK_INFO (MB_OK | MB_ICONINFORMATION | MB_TASKMODAL)
  33. #define MBOKCANCEL_EXCLAIM (MB_OKCANCEL | MB_ICONEXCLAMATION | MB_TASKMODAL)
  34. #define MBOKCANCEL_INFO (MB_OKCANCEL | MB_ICONINFORMATION | MB_TASKMODAL)
  35. #define MBOKCANCEL_QUESTION (MB_OKCANCEL | MB_ICONQUESTION | MB_TASKMODAL)
  36. #define MBYESNO_QUESTION (MB_YESNO | MB_ICONQUESTION | MB_TASKMODAL)
  37. #define MBYESNOCANCEL_QUESTION (MB_YESNOCANCEL | MB_ICONQUESTION | MB_TASKMODAL)
  38. #define MBYESNOCANCEL_EXCLAIM (MB_YESNOCANCEL | MB_ICONEXCLAMATION | MB_TASKMODAL)
  39. // other constants
  40. #define MAX_USERNAME 15
  41. #define MAX_DOMAINNAME 15
  42. #define MAX_ORGNAME 255
  43. #define MAX_PRODUCT_NAME_LENGTH 32
  44. //
  45. // WIN32 Version of common macros
  46. //
  47. #define GLOBAL_ALLOC(s) GlobalAlloc(GPTR,s)
  48. #define GLOBAL_FREE_IF_ALLOC(p) (p != NULL ? GlobalFree(p) : 0)
  49. #define GET_CONTROL_ID(w) (LOWORD(w))
  50. #define GET_NOTIFY_MSG(w,l) (HIWORD(w))
  51. #define GET_COMMAND_WND(l) ((HWND)(l))
  52. #define GET_INSTANCE(h) ((HINSTANCE)GetWindowLong(h, GWL_HINSTANCE))
  53. #define SAVE_HWND(w,o,v) SetWindowLong (w,o,(LONG)v)
  54. #define GET_HWND(w,o) (HWND)GetWindowLong (w,o)
  55. #define SET_HWND(w,o,v) SetWindowLong (w,o, (DWORD)v)
  56. #define SET_INFO(w,o,p) (LPVOID)SetWindowLong (w,o,(LONG)p)
  57. #define GET_INFO(w,o) (LPVOID)GetWindowLong (w,o)
  58. #define SEND_WM_COMMAND(w,c,n,cw) SendMessage (w, WM_COMMAND, MAKEWPARAM(c,n), (LPARAM)cw)
  59. #define POST_WM_COMMAND(w,c,n,cw) PostMessage (w, WM_COMMAND, MAKEWPARAM(c,n), (LPARAM)cw)
  60. #define GetMyLastError GetLastError
  61. #define CLEAR_FIRST_FOUR_BYTES(x) *(DWORD *)(x) = 0L
  62. #define SET_WAIT_CURSOR (SetCursor(LoadCursor(NULL, IDC_WAIT)))
  63. #define SET_ARROW_CURSOR (SetCursor(LoadCursor(NULL, IDC_ARROW)))
  64. #endif // _C2INC_H_