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.

3451 lines
113 KiB

  1. /****************************************************************************/
  2. /* */
  3. /* WINDOWS.H - */
  4. /* */
  5. /* Include file for Windows 3.0 applications */
  6. /* */
  7. /****************************************************************************/
  8. /* If defined, the following flags inhibit definition
  9. * of the indicated items.
  10. *
  11. * NOGDICAPMASKS - CC_*, LC_*, PC_*, CP_*, TC_*, RC_
  12. * NOVIRTUALKEYCODES - VK_*
  13. * NOWINMESSAGES - WM_*, EM_*, LB_*, CB_*
  14. * NOWINSTYLES - WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
  15. * NOSYSMETRICS - SM_*
  16. * NOMENUS - MF_*
  17. * NOICONS - IDI_*
  18. * NOKEYSTATES - MK_*
  19. * NOSYSCOMMANDS - SC_*
  20. * NORASTEROPS - Binary and Tertiary raster ops
  21. * NOSHOWWINDOW - SW_*
  22. * OEMRESOURCE - OEM Resource values
  23. * NOATOM - Atom Manager routines
  24. * NOCLIPBOARD - Clipboard routines
  25. * NOCOLOR - Screen colors
  26. * NOCTLMGR - Control and Dialog routines
  27. * NODRAWTEXT - DrawText() and DT_*
  28. * NOGDI - All GDI defines and routines
  29. * NOKERNEL - All KERNEL defines and routines
  30. * NOUSER - All USER defines and routines
  31. * NOMB - MB_* and MessageBox()
  32. * NOMEMMGR - GMEM_*, LMEM_*, GHND, LHND, associated routines
  33. * NOMETAFILE - typedef METAFILEPICT
  34. * NOMINMAX - Macros min(a,b) and max(a,b)
  35. * NOMSG - typedef MSG and associated routines
  36. * NOOPENFILE - OpenFile(), OemToAnsi, AnsiToOem, and OF_*
  37. * NOSCROLL - SB_* and scrolling routines
  38. * NOSOUND - Sound driver routines
  39. * NOTEXTMETRIC - typedef TEXTMETRIC and associated routines
  40. * NOWH - SetWindowsHook and WH_*
  41. * NOWINOFFSETS - GWL_*, GCL_*, associated routines
  42. * NOCOMM - COMM driver routines
  43. * NOKANJI - Kanji support stuff.
  44. * NOHELP - Help engine interface.
  45. * NOPROFILER - Profiler interface.
  46. * NODEFERWINDOWPOS - DeferWindowPos routines
  47. */
  48. #ifdef RC_INVOKED
  49. /* Turn off a bunch of stuff to ensure that RC files compile OK. */
  50. #define NOATOM
  51. #define NOGDI
  52. #define NOGDICAPMASKS
  53. #define NOMETAFILE
  54. #define NOMINMAX
  55. #define NOMSG
  56. #define NOOPENFILE
  57. #define NORASTEROPS
  58. #define NOSCROLL
  59. #define NOSOUND
  60. #define NOSYSMETRICS
  61. #define NOTEXTMETRIC
  62. #define NOWH
  63. #define NOCOMM
  64. #define NOKANJI
  65. #endif /* RC_INVOKED */
  66. /*--------------------------------------------------------------------------*/
  67. /* General Purpose Defines */
  68. /*--------------------------------------------------------------------------*/
  69. #define NULL 0
  70. #define FALSE 0
  71. #define TRUE 1
  72. #define FAR far
  73. #define NEAR near
  74. #define LONG long
  75. #define VOID void
  76. #define PASCAL pascal
  77. #ifndef NOMINMAX
  78. #ifndef max
  79. #define max(a,b) (((a) > (b)) ? (a) : (b))
  80. #endif
  81. #ifndef min
  82. #define min(a,b) (((a) < (b)) ? (a) : (b))
  83. #endif
  84. #endif /* NOMINMAX */
  85. #define MAKELONG(a, b) ((LONG)(((WORD)(a)) | ((DWORD)((WORD)(b))) << 16))
  86. #define LOWORD(l) ((WORD)(l))
  87. #define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
  88. #define LOBYTE(w) ((BYTE)(w))
  89. #define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))
  90. typedef int BOOL;
  91. typedef unsigned char BYTE;
  92. typedef unsigned int WORD;
  93. typedef unsigned long DWORD;
  94. typedef char near *PSTR;
  95. typedef char near *NPSTR;
  96. typedef char far *LPSTR;
  97. typedef BYTE near *PBYTE;
  98. typedef BYTE far *LPBYTE;
  99. typedef int near *PINT;
  100. typedef int far *LPINT;
  101. typedef WORD near *PWORD;
  102. typedef WORD far *LPWORD;
  103. typedef long near *PLONG;
  104. typedef long far *LPLONG;
  105. typedef DWORD near *PDWORD;
  106. typedef DWORD far *LPDWORD;
  107. typedef void far *LPVOID;
  108. #ifndef WIN_INTERNAL
  109. typedef WORD HANDLE;
  110. typedef HANDLE HWND;
  111. #endif
  112. typedef HANDLE *PHANDLE;
  113. typedef HANDLE NEAR *SPHANDLE;
  114. typedef HANDLE FAR *LPHANDLE;
  115. typedef HANDLE GLOBALHANDLE;
  116. typedef HANDLE LOCALHANDLE;
  117. typedef int (FAR PASCAL *FARPROC)();
  118. typedef int (NEAR PASCAL *NEARPROC)();
  119. typedef HANDLE HSTR;
  120. typedef HANDLE HICON;
  121. typedef HANDLE HDC;
  122. typedef HANDLE HMENU;
  123. typedef HANDLE HPEN;
  124. typedef HANDLE HFONT;
  125. typedef HANDLE HBRUSH;
  126. typedef HANDLE HBITMAP;
  127. typedef HANDLE HCURSOR;
  128. typedef HANDLE HRGN;
  129. typedef HANDLE HPALETTE;
  130. typedef DWORD COLORREF;
  131. #ifndef WIN_INTERNAL
  132. typedef struct tagRECT
  133. {
  134. int left;
  135. int top;
  136. int right;
  137. int bottom;
  138. } RECT;
  139. #endif
  140. typedef RECT *PRECT;
  141. typedef RECT NEAR *NPRECT;
  142. typedef RECT FAR *LPRECT;
  143. typedef struct tagPOINT
  144. {
  145. int x;
  146. int y;
  147. } POINT;
  148. typedef POINT *PPOINT;
  149. typedef POINT NEAR *NPPOINT;
  150. typedef POINT FAR *LPPOINT;
  151. /*--------------------------------------------------------------------------*/
  152. /* KERNEL Section */
  153. /*--------------------------------------------------------------------------*/
  154. #ifndef NOKERNEL
  155. /* Loader Routines */
  156. WORD FAR PASCAL GetVersion(void);
  157. WORD FAR PASCAL GetNumTasks(void);
  158. HANDLE FAR PASCAL GetCodeHandle(FARPROC);
  159. void FAR PASCAL GetCodeInfo(FARPROC lpProc, LPVOID lpSegInfo);
  160. HANDLE FAR PASCAL GetModuleHandle(LPSTR);
  161. int FAR PASCAL GetModuleUsage(HANDLE);
  162. int FAR PASCAL GetModuleFileName(HANDLE, LPSTR, int);
  163. int FAR PASCAL GetInstanceData(HANDLE, NPSTR, int);
  164. FARPROC FAR PASCAL GetProcAddress(HANDLE, LPSTR);
  165. FARPROC FAR PASCAL MakeProcInstance(FARPROC, HANDLE);
  166. void FAR PASCAL FreeProcInstance(FARPROC);
  167. HANDLE FAR PASCAL LoadLibrary(LPSTR);
  168. HANDLE FAR PASCAL LoadModule(LPSTR, LPVOID);
  169. BOOL FAR PASCAL FreeModule(HANDLE);
  170. void FAR PASCAL FreeLibrary(HANDLE);
  171. DWORD FAR PASCAL GetFreeSpace(WORD);
  172. WORD FAR PASCAL WinExec(LPSTR, WORD);
  173. void FAR PASCAL DebugBreak();
  174. void FAR PASCAL OutputDebugString(LPSTR);
  175. void FAR PASCAL SwitchStackBack();
  176. void FAR PASCAL SwitchStackTo(WORD, WORD, WORD);
  177. WORD FAR PASCAL GetCurrentPDB(void);
  178. #ifndef NOOPENFILE
  179. /* OpenFile() Structure */
  180. typedef struct tagOFSTRUCT
  181. {
  182. BYTE cBytes;
  183. BYTE fFixedDisk;
  184. WORD nErrCode;
  185. BYTE reserved[4];
  186. BYTE szPathName[128];
  187. } OFSTRUCT;
  188. typedef OFSTRUCT *POFSTRUCT;
  189. typedef OFSTRUCT NEAR *NPOFSTRUCT;
  190. typedef OFSTRUCT FAR *LPOFSTRUCT;
  191. /* OpenFile() Flags */
  192. #define OF_READ 0x0000
  193. #define OF_WRITE 0x0001
  194. #define OF_READWRITE 0x0002
  195. #define OF_SHARE_COMPAT 0x0000
  196. #define OF_SHARE_EXCLUSIVE 0x0010
  197. #define OF_SHARE_DENY_WRITE 0x0020
  198. #define OF_SHARE_DENY_READ 0x0030
  199. #define OF_SHARE_DENY_NONE 0x0040
  200. #define OF_PARSE 0x0100
  201. #define OF_DELETE 0x0200
  202. #define OF_VERIFY 0x0400
  203. #define OF_CANCEL 0x0800
  204. #define OF_CREATE 0x1000
  205. #define OF_PROMPT 0x2000
  206. #define OF_EXIST 0x4000
  207. #define OF_REOPEN 0x8000
  208. int FAR PASCAL OpenFile(LPSTR, LPOFSTRUCT, WORD);
  209. /* GetTempFileName() Flags */
  210. #define TF_FORCEDRIVE (BYTE)0x80
  211. BYTE FAR PASCAL GetTempDrive(BYTE);
  212. int FAR PASCAL GetTempFileName(BYTE, LPSTR, WORD, LPSTR);
  213. WORD FAR PASCAL SetHandleCount(WORD);
  214. WORD FAR PASCAL GetDriveType(int);
  215. /* GetDriveType return values */
  216. #define DRIVE_REMOVABLE 2
  217. #define DRIVE_FIXED 3
  218. #define DRIVE_REMOTE 4
  219. #endif /* NOOPENFILE */
  220. #ifndef NOMEMMGR
  221. /* Global Memory Flags */
  222. #define GMEM_FIXED 0x0000
  223. #define GMEM_MOVEABLE 0x0002
  224. #define GMEM_NOCOMPACT 0x0010
  225. #define GMEM_NODISCARD 0x0020
  226. #define GMEM_ZEROINIT 0x0040
  227. #define GMEM_MODIFY 0x0080
  228. #define GMEM_DISCARDABLE 0x0100
  229. #define GMEM_NOT_BANKED 0x1000
  230. #define GMEM_SHARE 0x2000
  231. #define GMEM_DDESHARE 0x2000
  232. #define GMEM_NOTIFY 0x4000
  233. #define GMEM_LOWER GMEM_NOT_BANKED
  234. #define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
  235. #define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
  236. #define GlobalDiscard(h) GlobalReAlloc(h, 0L, GMEM_MOVEABLE)
  237. HANDLE FAR PASCAL GlobalAlloc(WORD, DWORD);
  238. DWORD FAR PASCAL GlobalCompact(DWORD);
  239. HANDLE FAR PASCAL GlobalFree(HANDLE);
  240. DWORD FAR PASCAL GlobalHandle(WORD);
  241. LPSTR FAR PASCAL GlobalLock(HANDLE);
  242. HANDLE FAR PASCAL GlobalReAlloc(HANDLE, DWORD, WORD);
  243. DWORD FAR PASCAL GlobalSize(HANDLE);
  244. BOOL FAR PASCAL GlobalUnlock(HANDLE);
  245. WORD FAR PASCAL GlobalFlags(HANDLE);
  246. LPSTR FAR PASCAL GlobalWire(HANDLE);
  247. BOOL FAR PASCAL GlobalUnWire(HANDLE);
  248. BOOL FAR PASCAL GlobalUnlock(HANDLE);
  249. HANDLE FAR PASCAL GlobalLRUNewest(HANDLE);
  250. HANDLE FAR PASCAL GlobalLRUOldest(HANDLE);
  251. VOID FAR PASCAL GlobalNotify(FARPROC);
  252. WORD FAR PASCAL GlobalPageLock(HANDLE);
  253. WORD FAR PASCAL GlobalPageUnlock(HANDLE);
  254. VOID FAR PASCAL GlobalFix(HANDLE);
  255. BOOL FAR PASCAL GlobalUnfix(HANDLE);
  256. /* Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE) */
  257. #define GMEM_DISCARDED 0x4000
  258. #define GMEM_LOCKCOUNT 0x00FF
  259. #define LockData(dummy) LockSegment(0xFFFF)
  260. #define UnlockData(dummy) UnlockSegment(0xFFFF)
  261. HANDLE FAR PASCAL LockSegment(WORD);
  262. HANDLE FAR PASCAL UnlockSegment(WORD);
  263. /* Local Memory Flags */
  264. #define LMEM_FIXED 0x0000
  265. #define LMEM_MOVEABLE 0x0002
  266. #define LMEM_NOCOMPACT 0x0010
  267. #define LMEM_NODISCARD 0x0020
  268. #define LMEM_ZEROINIT 0x0040
  269. #define LMEM_MODIFY 0x0080
  270. #define LMEM_DISCARDABLE 0x0F00
  271. #define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
  272. #define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
  273. #define NONZEROLHND (LMEM_MOVEABLE)
  274. #define NONZEROLPTR (LMEM_FIXED)
  275. #define LNOTIFY_OUTOFMEM 0
  276. #define LNOTIFY_MOVE 1
  277. #define LNOTIFY_DISCARD 2
  278. WORD NEAR * PASCAL pLocalHeap;
  279. #define LocalDiscard(h) LocalReAlloc(h, 0, LMEM_MOVEABLE)
  280. HANDLE FAR PASCAL LocalAlloc(WORD, WORD);
  281. WORD FAR PASCAL LocalCompact(WORD);
  282. HANDLE FAR PASCAL LocalFree(HANDLE);
  283. HANDLE FAR PASCAL LocalHandle(WORD);
  284. BOOL FAR PASCAL LocalInit( WORD, WORD, WORD);
  285. char NEAR * FAR PASCAL LocalLock(HANDLE);
  286. FARPROC FAR PASCAL LocalNotify(FARPROC);
  287. HANDLE FAR PASCAL LocalReAlloc(HANDLE, WORD, WORD);
  288. WORD FAR PASCAL LocalSize(HANDLE);
  289. BOOL FAR PASCAL LocalUnlock(HANDLE);
  290. WORD FAR PASCAL LocalFlags(HANDLE);
  291. WORD FAR PASCAL LocalShrink(HANDLE, WORD);
  292. /* Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) */
  293. #define LMEM_DISCARDED 0x4000
  294. #define LMEM_LOCKCOUNT 0x00FF
  295. #endif /* NOMEMMGR */
  296. LONG FAR PASCAL SetSwapAreaSize(WORD);
  297. LPSTR FAR PASCAL ValidateFreeSpaces(void);
  298. VOID FAR PASCAL LimitEmsPages(DWORD);
  299. BOOL FAR PASCAL SetErrorMode(WORD);
  300. VOID FAR PASCAL ValidateCodeSegments(void);
  301. LPSTR FAR PASCAL GetDOSEnvironment(void);
  302. WORD FAR PASCAL AllocDStoCSAlias(WORD);
  303. WORD FAR PASCAL AllocSelector(WORD);
  304. WORD FAR PASCAL ChangeSelector(WORD, WORD);
  305. WORD FAR PASCAL FreeSelector(WORD);
  306. #define UnlockResource(h) GlobalUnlock(h)
  307. HANDLE FAR PASCAL FindResource(HANDLE, LPSTR, LPSTR);
  308. HANDLE FAR PASCAL LoadResource(HANDLE, HANDLE);
  309. BOOL FAR PASCAL FreeResource(HANDLE);
  310. LPSTR FAR PASCAL LockResource(HANDLE);
  311. FARPROC FAR PASCAL SetResourceHandler(HANDLE, LPSTR, FARPROC);
  312. HANDLE FAR PASCAL AllocResource(HANDLE, HANDLE, DWORD);
  313. WORD FAR PASCAL SizeofResource(HANDLE, HANDLE);
  314. int FAR PASCAL AccessResource(HANDLE, HANDLE);
  315. #define MAKEINTRESOURCE(i) (LPSTR)((DWORD)((WORD)(i)))
  316. #ifndef NORESOURCE
  317. /* Predefined Resource Types */
  318. #define RT_CURSOR MAKEINTRESOURCE(1)
  319. #define RT_BITMAP MAKEINTRESOURCE(2)
  320. #define RT_ICON MAKEINTRESOURCE(3)
  321. #define RT_MENU MAKEINTRESOURCE(4)
  322. #define RT_DIALOG MAKEINTRESOURCE(5)
  323. #define RT_STRING MAKEINTRESOURCE(6)
  324. #define RT_FONTDIR MAKEINTRESOURCE(7)
  325. #define RT_FONT MAKEINTRESOURCE(8)
  326. #define RT_ACCELERATOR MAKEINTRESOURCE(9)
  327. #define RT_RCDATA MAKEINTRESOURCE(10)
  328. #endif /* NORESOURCE */
  329. void FAR PASCAL Yield(void);
  330. HANDLE FAR PASCAL GetCurrentTask(void);
  331. #ifndef NOATOM
  332. typedef WORD ATOM;
  333. #define MAKEINTATOM(i) (LPSTR)((DWORD)((WORD)(i)))
  334. BOOL FAR PASCAL InitAtomTable(int);
  335. ATOM FAR PASCAL AddAtom(LPSTR);
  336. ATOM FAR PASCAL DeleteAtom(ATOM);
  337. ATOM FAR PASCAL FindAtom(LPSTR);
  338. WORD FAR PASCAL GetAtomName(ATOM, LPSTR, int);
  339. ATOM FAR PASCAL GlobalAddAtom(LPSTR);
  340. ATOM FAR PASCAL GlobalDeleteAtom(ATOM);
  341. ATOM FAR PASCAL GlobalFindAtom(LPSTR);
  342. WORD FAR PASCAL GlobalGetAtomName(ATOM, LPSTR, int);
  343. HANDLE FAR PASCAL GetAtomHandle(ATOM);
  344. #endif /* NOATOM */
  345. /* User Profile Routines */
  346. WORD FAR PASCAL GetProfileInt(LPSTR, LPSTR, int);
  347. int FAR PASCAL GetProfileString(LPSTR, LPSTR, LPSTR, LPSTR, int);
  348. BOOL FAR PASCAL WriteProfileString(LPSTR, LPSTR, LPSTR);
  349. WORD FAR PASCAL GetPrivateProfileInt(LPSTR, LPSTR, int, LPSTR);
  350. int FAR PASCAL GetPrivateProfileString(LPSTR, LPSTR, LPSTR, LPSTR, int, LPSTR);
  351. BOOL FAR PASCAL WritePrivateProfileString(LPSTR, LPSTR, LPSTR, LPSTR);
  352. WORD FAR PASCAL GetWindowsDirectory(LPSTR,WORD);
  353. WORD FAR PASCAL GetSystemDirectory(LPSTR,WORD);
  354. /* Catch() and Throw() */
  355. typedef int CATCHBUF[9];
  356. typedef int FAR *LPCATCHBUF;
  357. int FAR PASCAL Catch(LPCATCHBUF);
  358. void FAR PASCAL Throw(LPCATCHBUF, int);
  359. void FAR PASCAL FatalExit(int);
  360. void FAR PASCAL SwapRecording(WORD);
  361. /* Character Translation Routines */
  362. int FAR PASCAL AnsiToOem(LPSTR, LPSTR);
  363. BOOL FAR PASCAL OemToAnsi(LPSTR, LPSTR);
  364. void FAR PASCAL AnsiToOemBuff(LPSTR, LPSTR, int);
  365. void FAR PASCAL OemToAnsiBuff(LPSTR, LPSTR, int);
  366. LPSTR FAR PASCAL AnsiUpper(LPSTR);
  367. WORD FAR PASCAL AnsiUpperBuff(LPSTR, WORD);
  368. LPSTR FAR PASCAL AnsiLower(LPSTR);
  369. WORD FAR PASCAL AnsiLowerBuff(LPSTR, WORD);
  370. LPSTR FAR PASCAL AnsiNext(LPSTR);
  371. LPSTR FAR PASCAL AnsiPrev(LPSTR, LPSTR);
  372. /* Keyboard Information Routines */
  373. #ifndef NOKEYBOARDINFO
  374. DWORD FAR PASCAL OemKeyScan(WORD);
  375. WORD FAR PASCAL VkKeyScan(WORD);
  376. int FAR PASCAL GetKeyboardType(int);
  377. WORD FAR PASCAL MapVirtualKey(WORD, WORD);
  378. int FAR PASCAL GetKBCodePage();
  379. int FAR PASCAL GetKeyNameText(LONG, LPSTR, int);
  380. int FAR PASCAL ToAscii(WORD wVirtKey, WORD wScanCode, LPSTR lpKeyState, LPVOID lpChar, WORD wFlags);
  381. #endif
  382. #ifndef NOLANGUAGE
  383. /* Language dependent Routines */
  384. BOOL FAR PASCAL IsCharAlpha(char);
  385. BOOL FAR PASCAL IsCharAlphaNumeric(char);
  386. BOOL FAR PASCAL IsCharUpper(char);
  387. BOOL FAR PASCAL IsCharLower(char);
  388. #endif
  389. LONG FAR PASCAL GetWinFlags(void);
  390. #define WF_PMODE 0x0001
  391. #define WF_CPU286 0x0002
  392. #define WF_CPU386 0x0004
  393. #define WF_CPU486 0x0008
  394. #define WF_STANDARD 0x0010
  395. #define WF_WIN286 0x0010
  396. #define WF_ENHANCED 0x0020
  397. #define WF_WIN386 0x0020
  398. #define WF_CPU086 0x0040
  399. #define WF_CPU186 0x0080
  400. #define WF_LARGEFRAME 0x0100
  401. #define WF_SMALLFRAME 0x0200
  402. #define WF_80x87 0x0400
  403. /* WEP fSystemExit flag values */
  404. #define WEP_SYSTEM_EXIT 1
  405. #define WEP_FREE_DLL 0
  406. #ifdef OEMRESOURCE
  407. /* OEM Resource Ordinal Numbers */
  408. #define OBM_CLOSE 32754
  409. #define OBM_UPARROW 32753
  410. #define OBM_DNARROW 32752
  411. #define OBM_RGARROW 32751
  412. #define OBM_LFARROW 32750
  413. #define OBM_REDUCE 32749
  414. #define OBM_ZOOM 32748
  415. #define OBM_RESTORE 32747
  416. #define OBM_REDUCED 32746
  417. #define OBM_ZOOMD 32745
  418. #define OBM_RESTORED 32744
  419. #define OBM_UPARROWD 32743
  420. #define OBM_DNARROWD 32742
  421. #define OBM_RGARROWD 32741
  422. #define OBM_LFARROWD 32740
  423. #define OBM_MNARROW 32739
  424. #define OBM_COMBO 32738
  425. #define OBM_OLD_CLOSE 32767
  426. #define OBM_SIZE 32766
  427. #define OBM_OLD_UPARROW 32765
  428. #define OBM_OLD_DNARROW 32764
  429. #define OBM_OLD_RGARROW 32763
  430. #define OBM_OLD_LFARROW 32762
  431. #define OBM_BTSIZE 32761
  432. #define OBM_CHECK 32760
  433. #define OBM_CHECKBOXES 32759
  434. #define OBM_BTNCORNERS 32758
  435. #define OBM_OLD_REDUCE 32757
  436. #define OBM_OLD_ZOOM 32756
  437. #define OBM_OLD_RESTORE 32755
  438. #define OCR_NORMAL 32512
  439. #define OCR_IBEAM 32513
  440. #define OCR_WAIT 32514
  441. #define OCR_CROSS 32515
  442. #define OCR_UP 32516
  443. #define OCR_SIZE 32640
  444. #define OCR_ICON 32641
  445. #define OCR_SIZENWSE 32642
  446. #define OCR_SIZENESW 32643
  447. #define OCR_SIZEWE 32644
  448. #define OCR_SIZENS 32645
  449. #define OCR_SIZEALL 32646
  450. #define OCR_ICOCUR 32647
  451. #define OIC_SAMPLE 32512
  452. #define OIC_HAND 32513
  453. #define OIC_QUES 32514
  454. #define OIC_BANG 32515
  455. #define OIC_NOTE 32516
  456. #endif /* OEMRESOURCE */
  457. #endif /* NOKERNEL */
  458. /*--------------------------------------------------------------------------*/
  459. /* GDI Section */
  460. /*--------------------------------------------------------------------------*/
  461. #ifndef NOGDI
  462. #ifndef NORASTEROPS
  463. /* Binary raster ops */
  464. #define R2_BLACK 1 /* 0 */
  465. #define R2_NOTMERGEPEN 2 /* DPon */
  466. #define R2_MASKNOTPEN 3 /* DPna */
  467. #define R2_NOTCOPYPEN 4 /* PN */
  468. #define R2_MASKPENNOT 5 /* PDna */
  469. #define R2_NOT 6 /* Dn */
  470. #define R2_XORPEN 7 /* DPx */
  471. #define R2_NOTMASKPEN 8 /* DPan */
  472. #define R2_MASKPEN 9 /* DPa */
  473. #define R2_NOTXORPEN 10 /* DPxn */
  474. #define R2_NOP 11 /* D */
  475. #define R2_MERGENOTPEN 12 /* DPno */
  476. #define R2_COPYPEN 13 /* P */
  477. #define R2_MERGEPENNOT 14 /* PDno */
  478. #define R2_MERGEPEN 15 /* DPo */
  479. #define R2_WHITE 16 /* 1 */
  480. /* Ternary raster operations */
  481. #define SRCCOPY (DWORD)0x00CC0020 /* dest = source */
  482. #define SRCPAINT (DWORD)0x00EE0086 /* dest = source OR dest */
  483. #define SRCAND (DWORD)0x008800C6 /* dest = source AND dest */
  484. #define SRCINVERT (DWORD)0x00660046 /* dest = source XOR dest */
  485. #define SRCERASE (DWORD)0x00440328 /* dest = source AND (NOT dest ) */
  486. #define NOTSRCCOPY (DWORD)0x00330008 /* dest = (NOT source) */
  487. #define NOTSRCERASE (DWORD)0x001100A6 /* dest = (NOT src) AND (NOT dest) */
  488. #define MERGECOPY (DWORD)0x00C000CA /* dest = (source AND pattern) */
  489. #define MERGEPAINT (DWORD)0x00BB0226 /* dest = (NOT source) OR dest */
  490. #define PATCOPY (DWORD)0x00F00021 /* dest = pattern */
  491. #define PATPAINT (DWORD)0x00FB0A09 /* dest = DPSnoo */
  492. #define PATINVERT (DWORD)0x005A0049 /* dest = pattern XOR dest */
  493. #define DSTINVERT (DWORD)0x00550009 /* dest = (NOT dest) */
  494. #define BLACKNESS (DWORD)0x00000042 /* dest = BLACK */
  495. #define WHITENESS (DWORD)0x00FF0062 /* dest = WHITE */
  496. #endif /* NORASTEROPS */
  497. /* StretchBlt() Modes */
  498. #define BLACKONWHITE 1
  499. #define WHITEONBLACK 2
  500. #define COLORONCOLOR 3
  501. /* PolyFill() Modes */
  502. #define ALTERNATE 1
  503. #define WINDING 2
  504. /* Text Alignment Options */
  505. #define TA_NOUPDATECP 0
  506. #define TA_UPDATECP 1
  507. #define TA_LEFT 0
  508. #define TA_RIGHT 2
  509. #define TA_CENTER 6
  510. #define TA_TOP 0
  511. #define TA_BOTTOM 8
  512. #define TA_BASELINE 24
  513. #define ETO_GRAYED 1
  514. #define ETO_OPAQUE 2
  515. #define ETO_CLIPPED 4
  516. #define ASPECT_FILTERING 0x0001
  517. #ifndef NOMETAFILE
  518. /* Metafile Functions */
  519. #define META_SETBKCOLOR 0x0201
  520. #define META_SETBKMODE 0x0102
  521. #define META_SETMAPMODE 0x0103
  522. #define META_SETROP2 0x0104
  523. #define META_SETRELABS 0x0105
  524. #define META_SETPOLYFILLMODE 0x0106
  525. #define META_SETSTRETCHBLTMODE 0x0107
  526. #define META_SETTEXTCHAREXTRA 0x0108
  527. #define META_SETTEXTCOLOR 0x0209
  528. #define META_SETTEXTJUSTIFICATION 0x020A
  529. #define META_SETWINDOWORG 0x020B
  530. #define META_SETWINDOWEXT 0x020C
  531. #define META_SETVIEWPORTORG 0x020D
  532. #define META_SETVIEWPORTEXT 0x020E
  533. #define META_OFFSETWINDOWORG 0x020F
  534. #define META_SCALEWINDOWEXT 0x0400
  535. #define META_OFFSETVIEWPORTORG 0x0211
  536. #define META_SCALEVIEWPORTEXT 0x0412
  537. #define META_LINETO 0x0213
  538. #define META_MOVETO 0x0214
  539. #define META_EXCLUDECLIPRECT 0x0415
  540. #define META_INTERSECTCLIPRECT 0x0416
  541. #define META_ARC 0x0817
  542. #define META_ELLIPSE 0x0418
  543. #define META_FLOODFILL 0x0419
  544. #define META_PIE 0x081A
  545. #define META_RECTANGLE 0x041B
  546. #define META_ROUNDRECT 0x061C
  547. #define META_PATBLT 0x061D
  548. #define META_SAVEDC 0x001E
  549. #define META_SETPIXEL 0x041F
  550. #define META_OFFSETCLIPRGN 0x0220
  551. #define META_TEXTOUT 0x0521
  552. #define META_BITBLT 0x0922
  553. #define META_STRETCHBLT 0x0B23
  554. #define META_POLYGON 0x0324
  555. #define META_POLYLINE 0x0325
  556. #define META_ESCAPE 0x0626
  557. #define META_RESTOREDC 0x0127
  558. #define META_FILLREGION 0x0228
  559. #define META_FRAMEREGION 0x0429
  560. #define META_INVERTREGION 0x012A
  561. #define META_PAINTREGION 0x012B
  562. #define META_SELECTCLIPREGION 0x012C
  563. #define META_SELECTOBJECT 0x012D
  564. #define META_SETTEXTALIGN 0x012E
  565. #define META_DRAWTEXT 0x062F
  566. #define META_CHORD 0x0830
  567. #define META_SETMAPPERFLAGS 0x0231
  568. #define META_EXTTEXTOUT 0x0a32
  569. #define META_SETDIBTODEV 0x0d33
  570. #define META_SELECTPALETTE 0x0234
  571. #define META_REALIZEPALETTE 0x0035
  572. #define META_ANIMATEPALETTE 0x0436
  573. #define META_SETPALENTRIES 0x0037
  574. #define META_POLYPOLYGON 0x0538
  575. #define META_RESIZEPALETTE 0x0139
  576. #define META_DIBBITBLT 0x0940
  577. #define META_DIBSTRETCHBLT 0x0b41
  578. #define META_DIBCREATEPATTERNBRUSH 0x0142
  579. #define META_STRETCHDIB 0x0f43
  580. #define META_DELETEOBJECT 0x01f0
  581. #define META_CREATEPALETTE 0x00f7
  582. #define META_CREATEBRUSH 0x00F8
  583. #define META_CREATEPATTERNBRUSH 0x01F9
  584. #define META_CREATEPENINDIRECT 0x02FA
  585. #define META_CREATEFONTINDIRECT 0x02FB
  586. #define META_CREATEBRUSHINDIRECT 0x02FC
  587. #define META_CREATEBITMAPINDIRECT 0x02FD
  588. #define META_CREATEBITMAP 0x06FE
  589. #define META_CREATEREGION 0x06FF
  590. #endif /* NOMETAFILE */
  591. /* GDI Escapes */
  592. #define NEWFRAME 1
  593. #define ABORTDOC 2
  594. #define NEXTBAND 3
  595. #define SETCOLORTABLE 4
  596. #define GETCOLORTABLE 5
  597. #define FLUSHOUTPUT 6
  598. #define DRAFTMODE 7
  599. #define QUERYESCSUPPORT 8
  600. #define SETABORTPROC 9
  601. #define STARTDOC 10
  602. #define ENDDOC 11
  603. #define GETPHYSPAGESIZE 12
  604. #define GETPRINTINGOFFSET 13
  605. #define GETSCALINGFACTOR 14
  606. #define MFCOMMENT 15
  607. #define GETPENWIDTH 16
  608. #define SETCOPYCOUNT 17
  609. #define SELECTPAPERSOURCE 18
  610. #define DEVICEDATA 19
  611. #define PASSTHROUGH 19
  612. #define GETTECHNOLGY 20
  613. #define GETTECHNOLOGY 20
  614. #define SETENDCAP 21
  615. #define SETLINEJOIN 22
  616. #define SETMITERLIMIT 23
  617. #define BANDINFO 24
  618. #define DRAWPATTERNRECT 25
  619. #define GETVECTORPENSIZE 26
  620. #define GETVECTORBRUSHSIZE 27
  621. #define ENABLEDUPLEX 28
  622. #define GETSETPAPERBINS 29
  623. #define GETSETPRINTORIENT 30
  624. #define ENUMPAPERBINS 31
  625. #define SETDIBSCALING 32
  626. #define EPSPRINTING 33
  627. #define ENUMPAPERMETRICS 34
  628. #define GETSETPAPERMETRICS 35
  629. #define POSTSCRIPT_DATA 37
  630. #define POSTSCRIPT_IGNORE 38
  631. #define GETEXTENDEDTEXTMETRICS 256
  632. #define GETEXTENTTABLE 257
  633. #define GETPAIRKERNTABLE 258
  634. #define GETTRACKKERNTABLE 259
  635. #define EXTTEXTOUT 512
  636. #define ENABLERELATIVEWIDTHS 768
  637. #define ENABLEPAIRKERNING 769
  638. #define SETKERNTRACK 770
  639. #define SETALLJUSTVALUES 771
  640. #define SETCHARSET 772
  641. #define STRETCHBLT 2048
  642. #define BEGIN_PATH 4096
  643. #define CLIP_TO_PATH 4097
  644. #define END_PATH 4098
  645. #define EXT_DEVICE_CAPS 4099
  646. #define RESTORE_CTM 4100
  647. #define SAVE_CTM 4101
  648. #define SET_ARC_DIRECTION 4102
  649. #define SET_BACKGROUND_COLOR 4103
  650. #define SET_POLY_MODE 4104
  651. #define SET_SCREEN_ANGLE 4105
  652. #define SET_SPREAD 4106
  653. #define TRANSFORM_CTM 4107
  654. #define SET_CLIP_BOX 4108
  655. #define SET_BOUNDS 4109
  656. #define SET_MIRROR_MODE 4110
  657. /* Spooler Error Codes */
  658. #define SP_NOTREPORTED 0x4000
  659. #define SP_ERROR (-1)
  660. #define SP_APPABORT (-2)
  661. #define SP_USERABORT (-3)
  662. #define SP_OUTOFDISK (-4)
  663. #define SP_OUTOFMEMORY (-5)
  664. #define PR_JOBSTATUS 0x0000
  665. /* Object Definitions for EnumObjects() */
  666. #define OBJ_PEN 1
  667. #define OBJ_BRUSH 2
  668. /* Bitmap Header Definition */
  669. typedef struct tagBITMAP
  670. {
  671. int bmType;
  672. int bmWidth;
  673. int bmHeight;
  674. int bmWidthBytes;
  675. BYTE bmPlanes;
  676. BYTE bmBitsPixel;
  677. LPSTR bmBits;
  678. } BITMAP;
  679. typedef BITMAP *PBITMAP;
  680. typedef BITMAP NEAR *NPBITMAP;
  681. typedef BITMAP FAR *LPBITMAP;
  682. typedef struct tagRGBTRIPLE {
  683. BYTE rgbtBlue;
  684. BYTE rgbtGreen;
  685. BYTE rgbtRed;
  686. } RGBTRIPLE;
  687. typedef struct tagRGBQUAD {
  688. BYTE rgbBlue;
  689. BYTE rgbGreen;
  690. BYTE rgbRed;
  691. BYTE rgbReserved;
  692. } RGBQUAD;
  693. /* structures for defining DIBs */
  694. typedef struct tagBITMAPCOREHEADER {
  695. DWORD bcSize; /* used to get to color table */
  696. WORD bcWidth;
  697. WORD bcHeight;
  698. WORD bcPlanes;
  699. WORD bcBitCount;
  700. } BITMAPCOREHEADER;
  701. typedef BITMAPCOREHEADER FAR *LPBITMAPCOREHEADER;
  702. typedef BITMAPCOREHEADER *PBITMAPCOREHEADER;
  703. typedef struct tagBITMAPINFOHEADER{
  704. DWORD biSize;
  705. DWORD biWidth;
  706. DWORD biHeight;
  707. WORD biPlanes;
  708. WORD biBitCount;
  709. DWORD biCompression;
  710. DWORD biSizeImage;
  711. DWORD biXPelsPerMeter;
  712. DWORD biYPelsPerMeter;
  713. DWORD biClrUsed;
  714. DWORD biClrImportant;
  715. } BITMAPINFOHEADER;
  716. typedef BITMAPINFOHEADER FAR *LPBITMAPINFOHEADER;
  717. typedef BITMAPINFOHEADER *PBITMAPINFOHEADER;
  718. /* constants for the biCompression field */
  719. #define BI_RGB 0L
  720. #define BI_RLE8 1L
  721. #define BI_RLE4 2L
  722. typedef struct tagBITMAPINFO {
  723. BITMAPINFOHEADER bmiHeader;
  724. RGBQUAD bmiColors[1];
  725. } BITMAPINFO;
  726. typedef BITMAPINFO FAR *LPBITMAPINFO;
  727. typedef BITMAPINFO *PBITMAPINFO;
  728. typedef struct tagBITMAPCOREINFO {
  729. BITMAPCOREHEADER bmciHeader;
  730. RGBTRIPLE bmciColors[1];
  731. } BITMAPCOREINFO;
  732. typedef BITMAPCOREINFO FAR *LPBITMAPCOREINFO;
  733. typedef BITMAPCOREINFO *PBITMAPCOREINFO;
  734. typedef struct tagBITMAPFILEHEADER {
  735. WORD bfType;
  736. DWORD bfSize;
  737. WORD bfReserved1;
  738. WORD bfReserved2;
  739. DWORD bfOffBits;
  740. } BITMAPFILEHEADER;
  741. typedef BITMAPFILEHEADER FAR *LPBITMAPFILEHEADER;
  742. typedef BITMAPFILEHEADER *PBITMAPFILEHEADER;
  743. #define MAKEPOINT(l) (*((POINT FAR *)&(l)))
  744. #ifndef NOMETAFILE
  745. /* Clipboard Metafile Picture Structure */
  746. typedef struct tagHANDLETABLE
  747. {
  748. HANDLE objectHandle[1];
  749. } HANDLETABLE;
  750. typedef HANDLETABLE *PHANDLETABLE;
  751. typedef HANDLETABLE FAR *LPHANDLETABLE;
  752. typedef struct tagMETARECORD
  753. {
  754. DWORD rdSize;
  755. WORD rdFunction;
  756. WORD rdParm[1];
  757. } METARECORD;
  758. typedef METARECORD *PMETARECORD;
  759. typedef METARECORD FAR *LPMETARECORD;
  760. typedef struct tagMETAFILEPICT
  761. {
  762. int mm;
  763. int xExt;
  764. int yExt;
  765. HANDLE hMF;
  766. } METAFILEPICT;
  767. typedef METAFILEPICT FAR *LPMETAFILEPICT;
  768. typedef struct tagMETAHEADER
  769. {
  770. WORD mtType;
  771. WORD mtHeaderSize;
  772. WORD mtVersion;
  773. DWORD mtSize;
  774. WORD mtNoObjects;
  775. DWORD mtMaxRecord;
  776. WORD mtNoParameters;
  777. } METAHEADER;
  778. #endif /* NOMETAFILE */
  779. #ifndef NOTEXTMETRIC
  780. typedef struct tagTEXTMETRIC
  781. {
  782. int tmHeight;
  783. int tmAscent;
  784. int tmDescent;
  785. int tmInternalLeading;
  786. int tmExternalLeading;
  787. int tmAveCharWidth;
  788. int tmMaxCharWidth;
  789. int tmWeight;
  790. BYTE tmItalic;
  791. BYTE tmUnderlined;
  792. BYTE tmStruckOut;
  793. BYTE tmFirstChar;
  794. BYTE tmLastChar;
  795. BYTE tmDefaultChar;
  796. BYTE tmBreakChar;
  797. BYTE tmPitchAndFamily;
  798. BYTE tmCharSet;
  799. int tmOverhang;
  800. int tmDigitizedAspectX;
  801. int tmDigitizedAspectY;
  802. } TEXTMETRIC;
  803. typedef TEXTMETRIC *PTEXTMETRIC;
  804. typedef TEXTMETRIC NEAR *NPTEXTMETRIC;
  805. typedef TEXTMETRIC FAR *LPTEXTMETRIC;
  806. #endif /* NOTEXTMETRIC */
  807. /* GDI Logical Objects: */
  808. /* Pel Array */
  809. typedef struct tagPELARRAY
  810. {
  811. int paXCount;
  812. int paYCount;
  813. int paXExt;
  814. int paYExt;
  815. BYTE paRGBs;
  816. } PELARRAY;
  817. typedef PELARRAY *PPELARRAY;
  818. typedef PELARRAY NEAR *NPPELARRAY;
  819. typedef PELARRAY FAR *LPPELARRAY;
  820. /* Logical Brush (or Pattern) */
  821. typedef struct tagLOGBRUSH
  822. {
  823. WORD lbStyle;
  824. DWORD lbColor;
  825. int lbHatch;
  826. } LOGBRUSH;
  827. typedef LOGBRUSH *PLOGBRUSH;
  828. typedef LOGBRUSH NEAR *NPLOGBRUSH;
  829. typedef LOGBRUSH FAR *LPLOGBRUSH;
  830. typedef LOGBRUSH PATTERN;
  831. typedef PATTERN *PPATTERN;
  832. typedef PATTERN NEAR *NPPATTERN;
  833. typedef PATTERN FAR *LPPATTERN;
  834. /* Logical Pen */
  835. typedef struct tagLOGPEN
  836. {
  837. WORD lopnStyle;
  838. POINT lopnWidth;
  839. DWORD lopnColor;
  840. } LOGPEN;
  841. typedef LOGPEN *PLOGPEN;
  842. typedef LOGPEN NEAR *NPLOGPEN;
  843. typedef LOGPEN FAR *LPLOGPEN;
  844. typedef struct tagPALETTEENTRY {
  845. BYTE peRed;
  846. BYTE peGreen;
  847. BYTE peBlue;
  848. BYTE peFlags;
  849. } PALETTEENTRY;
  850. typedef PALETTEENTRY FAR *LPPALETTEENTRY;
  851. /* Logical Palette */
  852. typedef struct tagLOGPALETTE {
  853. WORD palVersion;
  854. WORD palNumEntries;
  855. PALETTEENTRY palPalEntry[1];
  856. } LOGPALETTE;
  857. typedef LOGPALETTE *PLOGPALETTE;
  858. typedef LOGPALETTE NEAR *NPLOGPALETTE;
  859. typedef LOGPALETTE FAR *LPLOGPALETTE;
  860. /* Logical Font */
  861. #define LF_FACESIZE 32
  862. typedef struct tagLOGFONT
  863. {
  864. int lfHeight;
  865. int lfWidth;
  866. int lfEscapement;
  867. int lfOrientation;
  868. int lfWeight;
  869. BYTE lfItalic;
  870. BYTE lfUnderline;
  871. BYTE lfStrikeOut;
  872. BYTE lfCharSet;
  873. BYTE lfOutPrecision;
  874. BYTE lfClipPrecision;
  875. BYTE lfQuality;
  876. BYTE lfPitchAndFamily;
  877. BYTE lfFaceName[LF_FACESIZE];
  878. } LOGFONT;
  879. typedef LOGFONT *PLOGFONT;
  880. typedef LOGFONT NEAR *NPLOGFONT;
  881. typedef LOGFONT FAR *LPLOGFONT;
  882. #define OUT_DEFAULT_PRECIS 0
  883. #define OUT_STRING_PRECIS 1
  884. #define OUT_CHARACTER_PRECIS 2
  885. #define OUT_STROKE_PRECIS 3
  886. #define CLIP_DEFAULT_PRECIS 0
  887. #define CLIP_CHARACTER_PRECIS 1
  888. #define CLIP_STROKE_PRECIS 2
  889. #define DEFAULT_QUALITY 0
  890. #define DRAFT_QUALITY 1
  891. #define PROOF_QUALITY 2
  892. #define DEFAULT_PITCH 0
  893. #define FIXED_PITCH 1
  894. #define VARIABLE_PITCH 2
  895. #define ANSI_CHARSET 0
  896. #define SYMBOL_CHARSET 2
  897. #define SHIFTJIS_CHARSET 128
  898. #define OEM_CHARSET 255
  899. /* Font Families */
  900. #define FF_DONTCARE (0<<4) /* Don't care or don't know. */
  901. #define FF_ROMAN (1<<4) /* Variable stroke width, serifed. */
  902. /* Times Roman, Century Schoolbook, etc. */
  903. #define FF_SWISS (2<<4) /* Variable stroke width, sans-serifed. */
  904. /* Helvetica, Swiss, etc. */
  905. #define FF_MODERN (3<<4) /* Constant stroke width, serifed or sans-serifed. */
  906. /* Pica, Elite, Courier, etc. */
  907. #define FF_SCRIPT (4<<4) /* Cursive, etc. */
  908. #define FF_DECORATIVE (5<<4) /* Old English, etc. */
  909. /* Font Weights */
  910. #define FW_DONTCARE 0
  911. #define FW_THIN 100
  912. #define FW_EXTRALIGHT 200
  913. #define FW_LIGHT 300
  914. #define FW_NORMAL 400
  915. #define FW_MEDIUM 500
  916. #define FW_SEMIBOLD 600
  917. #define FW_BOLD 700
  918. #define FW_EXTRABOLD 800
  919. #define FW_HEAVY 900
  920. #define FW_ULTRALIGHT FW_EXTRALIGHT
  921. #define FW_REGULAR FW_NORMAL
  922. #define FW_DEMIBOLD FW_SEMIBOLD
  923. #define FW_ULTRABOLD FW_EXTRABOLD
  924. #define FW_BLACK FW_HEAVY
  925. /* EnumFonts Masks */
  926. #define RASTER_FONTTYPE 0x0001
  927. #define DEVICE_FONTTYPE 0X0002
  928. #define RGB(r,g,b) ((DWORD)(((BYTE)(r)|((WORD)(g)<<8))|(((DWORD)(BYTE)(b))<<16)))
  929. #define PALETTERGB(r,g,b) (0x02000000 | RGB(r,g,b))
  930. #define PALETTEINDEX(i) ((DWORD)(0x01000000 | (WORD)(i)))
  931. #define GetRValue(rgb) ((BYTE)(rgb))
  932. #define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
  933. #define GetBValue(rgb) ((BYTE)((rgb)>>16))
  934. /* Background Modes */
  935. #define TRANSPARENT 1
  936. #define OPAQUE 2
  937. /* Mapping Modes */
  938. #define MM_TEXT 1
  939. #define MM_LOMETRIC 2
  940. #define MM_HIMETRIC 3
  941. #define MM_LOENGLISH 4
  942. #define MM_HIENGLISH 5
  943. #define MM_TWIPS 6
  944. #define MM_ISOTROPIC 7
  945. #define MM_ANISOTROPIC 8
  946. /* Coordinate Modes */
  947. #define ABSOLUTE 1
  948. #define RELATIVE 2
  949. /* Stock Logical Objects */
  950. #define WHITE_BRUSH 0
  951. #define LTGRAY_BRUSH 1
  952. #define GRAY_BRUSH 2
  953. #define DKGRAY_BRUSH 3
  954. #define BLACK_BRUSH 4
  955. #define NULL_BRUSH 5
  956. #define HOLLOW_BRUSH NULL_BRUSH
  957. #define WHITE_PEN 6
  958. #define BLACK_PEN 7
  959. #define NULL_PEN 8
  960. #define OEM_FIXED_FONT 10
  961. #define ANSI_FIXED_FONT 11
  962. #define ANSI_VAR_FONT 12
  963. #define SYSTEM_FONT 13
  964. #define DEVICE_DEFAULT_FONT 14
  965. #define DEFAULT_PALETTE 15
  966. #define SYSTEM_FIXED_FONT 16
  967. /* Brush Styles */
  968. #define BS_SOLID 0
  969. #define BS_NULL 1
  970. #define BS_HOLLOW BS_NULL
  971. #define BS_HATCHED 2
  972. #define BS_PATTERN 3
  973. #define BS_INDEXED 4
  974. #define BS_DIBPATTERN 5
  975. /* Hatch Styles */
  976. #define HS_HORIZONTAL 0 /* ----- */
  977. #define HS_VERTICAL 1 /* ||||| */
  978. #define HS_FDIAGONAL 2 /* \\\\\ */
  979. #define HS_BDIAGONAL 3 /* ///// */
  980. #define HS_CROSS 4 /* +++++ */
  981. #define HS_DIAGCROSS 5 /* xxxxx */
  982. /* Pen Styles */
  983. #define PS_SOLID 0
  984. #define PS_DASH 1 /* ------- */
  985. #define PS_DOT 2 /* ....... */
  986. #define PS_DASHDOT 3 /* _._._._ */
  987. #define PS_DASHDOTDOT 4 /* _.._.._ */
  988. #define PS_NULL 5
  989. #define PS_INSIDEFRAME 6
  990. /* Device Parameters for GetDeviceCaps() */
  991. #define DRIVERVERSION 0 /* Device driver version */
  992. #define TECHNOLOGY 2 /* Device classification */
  993. #define HORZSIZE 4 /* Horizontal size in millimeters */
  994. #define VERTSIZE 6 /* Vertical size in millimeters */
  995. #define HORZRES 8 /* Horizontal width in pixels */
  996. #define VERTRES 10 /* Vertical width in pixels */
  997. #define BITSPIXEL 12 /* Number of bits per pixel */
  998. #define PLANES 14 /* Number of planes */
  999. #define NUMBRUSHES 16 /* Number of brushes the device has */
  1000. #define NUMPENS 18 /* Number of pens the device has */
  1001. #define NUMMARKERS 20 /* Number of markers the device has */
  1002. #define NUMFONTS 22 /* Number of fonts the device has */
  1003. #define NUMCOLORS 24 /* Number of colors the device supports */
  1004. #define PDEVICESIZE 26 /* Size required for device descriptor */
  1005. #define CURVECAPS 28 /* Curve capabilities */
  1006. #define LINECAPS 30 /* Line capabilities */
  1007. #define POLYGONALCAPS 32 /* Polygonal capabilities */
  1008. #define TEXTCAPS 34 /* Text capabilities */
  1009. #define CLIPCAPS 36 /* Clipping capabilities */
  1010. #define RASTERCAPS 38 /* Bitblt capabilities */
  1011. #define ASPECTX 40 /* Length of the X leg */
  1012. #define ASPECTY 42 /* Length of the Y leg */
  1013. #define ASPECTXY 44 /* Length of the hypotenuse */
  1014. #define LOGPIXELSX 88 /* Logical pixels/inch in X */
  1015. #define LOGPIXELSY 90 /* Logical pixels/inch in Y */
  1016. #define SIZEPALETTE 104 /* Number of entries in physical palette */
  1017. #define NUMRESERVED 106 /* Number of reserved entries in palette */
  1018. #define COLORRES 108 /* Actual color resolution */
  1019. #ifndef NOGDICAPMASKS
  1020. /* Device Capability Masks: */
  1021. /* Device Technologies */
  1022. #define DT_PLOTTER 0 /* Vector plotter */
  1023. #define DT_RASDISPLAY 1 /* Raster display */
  1024. #define DT_RASPRINTER 2 /* Raster printer */
  1025. #define DT_RASCAMERA 3 /* Raster camera */
  1026. #define DT_CHARSTREAM 4 /* Character-stream, PLP */
  1027. #define DT_METAFILE 5 /* Metafile, VDM */
  1028. #define DT_DISPFILE 6 /* Display-file */
  1029. /* Curve Capabilities */
  1030. #define CC_NONE 0 /* Curves not supported */
  1031. #define CC_CIRCLES 1 /* Can do circles */
  1032. #define CC_PIE 2 /* Can do pie wedges */
  1033. #define CC_CHORD 4 /* Can do chord arcs */
  1034. #define CC_ELLIPSES 8 /* Can do ellipese */
  1035. #define CC_WIDE 16 /* Can do wide lines */
  1036. #define CC_STYLED 32 /* Can do styled lines */
  1037. #define CC_WIDESTYLED 64 /* Can do wide styled lines */
  1038. #define CC_INTERIORS 128 /* Can do interiors */
  1039. /* Line Capabilities */
  1040. #define LC_NONE 0 /* Lines not supported */
  1041. #define LC_POLYLINE 2 /* Can do polylines */
  1042. #define LC_MARKER 4 /* Can do markers */
  1043. #define LC_POLYMARKER 8 /* Can do polymarkers */
  1044. #define LC_WIDE 16 /* Can do wide lines */
  1045. #define LC_STYLED 32 /* Can do styled lines */
  1046. #define LC_WIDESTYLED 64 /* Can do wide styled lines */
  1047. #define LC_INTERIORS 128 /* Can do interiors */
  1048. /* Polygonal Capabilities */
  1049. #define PC_NONE 0 /* Polygonals not supported */
  1050. #define PC_POLYGON 1 /* Can do polygons */
  1051. #define PC_RECTANGLE 2 /* Can do rectangles */
  1052. #define PC_WINDPOLYGON 4 /* Can do winding polygons */
  1053. #define PC_TRAPEZOID 4 /* Can do trapezoids */
  1054. #define PC_SCANLINE 8 /* Can do scanlines */
  1055. #define PC_WIDE 16 /* Can do wide borders */
  1056. #define PC_STYLED 32 /* Can do styled borders */
  1057. #define PC_WIDESTYLED 64 /* Can do wide styled borders */
  1058. #define PC_INTERIORS 128 /* Can do interiors */
  1059. /* Polygonal Capabilities */
  1060. #define CP_NONE 0 /* No clipping of output */
  1061. #define CP_RECTANGLE 1 /* Output clipped to rects */
  1062. /* Text Capabilities */
  1063. #define TC_OP_CHARACTER 0x0001 /* Can do OutputPrecision CHARACTER */
  1064. #define TC_OP_STROKE 0x0002 /* Can do OutputPrecision STROKE */
  1065. #define TC_CP_STROKE 0x0004 /* Can do ClipPrecision STROKE */
  1066. #define TC_CR_90 0x0008 /* Can do CharRotAbility 90 */
  1067. #define TC_CR_ANY 0x0010 /* Can do CharRotAbility ANY */
  1068. #define TC_SF_X_YINDEP 0x0020 /* Can do ScaleFreedom X_YINDEPENDENT */
  1069. #define TC_SA_DOUBLE 0x0040 /* Can do ScaleAbility DOUBLE */
  1070. #define TC_SA_INTEGER 0x0080 /* Can do ScaleAbility INTEGER */
  1071. #define TC_SA_CONTIN 0x0100 /* Can do ScaleAbility CONTINUOUS */
  1072. #define TC_EA_DOUBLE 0x0200 /* Can do EmboldenAbility DOUBLE */
  1073. #define TC_IA_ABLE 0x0400 /* Can do ItalisizeAbility ABLE */
  1074. #define TC_UA_ABLE 0x0800 /* Can do UnderlineAbility ABLE */
  1075. #define TC_SO_ABLE 0x1000 /* Can do StrikeOutAbility ABLE */
  1076. #define TC_RA_ABLE 0x2000 /* Can do RasterFontAble ABLE */
  1077. #define TC_VA_ABLE 0x4000 /* Can do VectorFontAble ABLE */
  1078. #define TC_RESERVED 0x8000
  1079. #endif /* NOGDICAPMASKS */
  1080. /* Raster Capabilities */
  1081. #define RC_BITBLT 1 /* Can do standard BLT. */
  1082. #define RC_BANDING 2 /* Device requires banding support */
  1083. #define RC_SCALING 4 /* Device requires scaling support */
  1084. #define RC_BITMAP64 8 /* Device can support >64K bitmap */
  1085. #define RC_GDI20_OUTPUT 0x0010 /* has 2.0 output calls */
  1086. #define RC_DI_BITMAP 0x0080 /* supports DIB to memory */
  1087. #define RC_PALETTE 0x0100 /* supports a palette */
  1088. #define RC_DIBTODEV 0x0200 /* supports DIBitsToDevice */
  1089. #define RC_BIGFONT 0x0400 /* supports >64K fonts */
  1090. #define RC_STRETCHBLT 0x0800 /* supports StretchBlt */
  1091. #define RC_FLOODFILL 0x1000 /* supports FloodFill */
  1092. #define RC_STRETCHDIB 0x2000 /* supports StretchDIBits */
  1093. /* palette entry flags */
  1094. #define PC_RESERVED 0x01 /* palette index used for animation */
  1095. #define PC_EXPLICIT 0x02 /* palette index is explicit to device */
  1096. #define PC_NOCOLLAPSE 0x04 /* do not match color to system palette */
  1097. /* DIB color table identifiers */
  1098. #define DIB_RGB_COLORS 0 /* color table in RGBTriples */
  1099. #define DIB_PAL_COLORS 1 /* color table in palette indices */
  1100. /* constants for Get/SetSystemPaletteUse() */
  1101. #define SYSPAL_STATIC 1
  1102. #define SYSPAL_NOSTATIC 2
  1103. /* constants for CreateDIBitmap */
  1104. #define CBM_INIT 0x04L /* initialize bitmap */
  1105. #ifndef NODRAWTEXT
  1106. /* DrawText() Format Flags */
  1107. #define DT_TOP 0x0000
  1108. #define DT_LEFT 0x0000
  1109. #define DT_CENTER 0x0001
  1110. #define DT_RIGHT 0x0002
  1111. #define DT_VCENTER 0x0004
  1112. #define DT_BOTTOM 0x0008
  1113. #define DT_WORDBREAK 0x0010
  1114. #define DT_SINGLELINE 0x0020
  1115. #define DT_EXPANDTABS 0x0040
  1116. #define DT_TABSTOP 0x0080
  1117. #define DT_NOCLIP 0x0100
  1118. #define DT_EXTERNALLEADING 0x0200
  1119. #define DT_CALCRECT 0x0400
  1120. #define DT_NOPREFIX 0x0800
  1121. #define DT_INTERNAL 0x1000
  1122. int FAR PASCAL DrawText(HDC, LPSTR, int, LPRECT, WORD);
  1123. BOOL FAR PASCAL DrawIcon(HDC, int, int, HICON);
  1124. #endif /* NODRAWTEXT */
  1125. /* ExtFloodFill style flags */
  1126. #define FLOODFILLBORDER 0
  1127. #define FLOODFILLSURFACE 1
  1128. HDC FAR PASCAL GetWindowDC(HWND);
  1129. HDC FAR PASCAL GetDC(HWND);
  1130. int FAR PASCAL ReleaseDC(HWND, HDC);
  1131. HDC FAR PASCAL CreateDC(LPSTR, LPSTR, LPSTR, LPSTR);
  1132. HDC FAR PASCAL CreateIC(LPSTR, LPSTR, LPSTR, LPSTR);
  1133. HDC FAR PASCAL CreateCompatibleDC(HDC);
  1134. BOOL FAR PASCAL DeleteDC(HDC);
  1135. int FAR PASCAL SaveDC(HDC);
  1136. BOOL FAR PASCAL RestoreDC(HDC, int);
  1137. DWORD FAR PASCAL MoveTo(HDC, int, int);
  1138. DWORD FAR PASCAL GetCurrentPosition(HDC);
  1139. BOOL FAR PASCAL LineTo(HDC, int, int);
  1140. DWORD FAR PASCAL GetDCOrg(HDC);
  1141. int FAR PASCAL MulDiv(int, int, int);
  1142. BOOL FAR PASCAL ExtTextOut(HDC, int, int, WORD, LPRECT, LPSTR, WORD, LPINT);
  1143. BOOL FAR PASCAL Polyline(HDC, LPPOINT, int);
  1144. BOOL FAR PASCAL Polygon(HDC, LPPOINT, int);
  1145. BOOL FAR PASCAL PolyPolygon(HDC, LPPOINT, LPINT, int);
  1146. BOOL FAR PASCAL Rectangle(HDC, int, int, int, int);
  1147. BOOL FAR PASCAL RoundRect(HDC, int, int, int, int, int, int);
  1148. BOOL FAR PASCAL Ellipse(HDC, int, int, int, int);
  1149. BOOL FAR PASCAL Arc(HDC, int, int, int, int, int, int, int, int);
  1150. BOOL FAR PASCAL Chord(HDC, int, int, int, int, int, int, int, int);
  1151. BOOL FAR PASCAL Pie(HDC, int, int, int, int, int, int, int, int);
  1152. BOOL FAR PASCAL PatBlt(HDC, int, int, int, int, DWORD);
  1153. BOOL FAR PASCAL BitBlt(HDC, int, int, int, int, HDC, int, int, DWORD);
  1154. BOOL FAR PASCAL StretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD);
  1155. BOOL FAR PASCAL TextOut(HDC, int, int, LPSTR, int);
  1156. LONG FAR PASCAL TabbedTextOut(HDC, int, int, LPSTR, int, int, LPINT, int);
  1157. BOOL FAR PASCAL GetCharWidth(HDC, WORD, WORD, LPINT);
  1158. DWORD FAR PASCAL SetPixel( HDC, int, int, DWORD);
  1159. DWORD FAR PASCAL GetPixel( HDC, int, int);
  1160. BOOL FAR PASCAL FloodFill( HDC, int, int, DWORD);
  1161. BOOL FAR PASCAL ExtFloodFill(HDC, int, int, DWORD, WORD);
  1162. void FAR PASCAL LineDDA(int, int, int, int, FARPROC, LPSTR);
  1163. HANDLE FAR PASCAL GetStockObject(int);
  1164. HPEN FAR PASCAL CreatePen(int, int, DWORD);
  1165. HPEN FAR PASCAL CreatePenIndirect(LOGPEN FAR *);
  1166. HBRUSH FAR PASCAL CreateSolidBrush(DWORD);
  1167. HBRUSH FAR PASCAL CreateHatchBrush(int,DWORD);
  1168. DWORD FAR PASCAL SetBrushOrg(HDC, int, int);
  1169. DWORD FAR PASCAL GetBrushOrg(HDC);
  1170. HBRUSH FAR PASCAL CreatePatternBrush(HBITMAP);
  1171. HBRUSH FAR PASCAL CreateBrushIndirect(LOGBRUSH FAR *);
  1172. HBITMAP FAR PASCAL CreateBitmap(int, int, BYTE, BYTE, LPSTR);
  1173. HBITMAP FAR PASCAL CreateBitmapIndirect(BITMAP FAR *);
  1174. HBITMAP FAR PASCAL CreateCompatibleBitmap(HDC, int, int);
  1175. HBITMAP FAR PASCAL CreateDiscardableBitmap(HDC, int, int);
  1176. LONG FAR PASCAL SetBitmapBits(HBITMAP, DWORD, LPSTR);
  1177. LONG FAR PASCAL GetBitmapBits(HBITMAP, LONG, LPSTR);
  1178. DWORD FAR PASCAL SetBitmapDimension(HBITMAP, int, int);
  1179. DWORD FAR PASCAL GetBitmapDimension(HBITMAP);
  1180. HFONT FAR PASCAL CreateFont(int, int, int, int, int, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, LPSTR);
  1181. HFONT FAR PASCAL CreateFontIndirect(LOGFONT FAR *);
  1182. int FAR PASCAL SelectClipRgn(HDC, HRGN);
  1183. HRGN FAR PASCAL CreateRectRgn(int, int, int, int);
  1184. void FAR PASCAL SetRectRgn(HRGN, int, int, int, int);
  1185. HRGN FAR PASCAL CreateRectRgnIndirect(LPRECT);
  1186. HRGN FAR PASCAL CreateEllipticRgnIndirect(LPRECT);
  1187. HRGN FAR PASCAL CreateEllipticRgn(int, int, int, int);
  1188. HRGN FAR PASCAL CreatePolygonRgn(LPPOINT, int, int);
  1189. HRGN FAR PASCAL CreatePolyPolygonRgn(LPPOINT, LPINT, int, int);
  1190. HRGN FAR PASCAL CreateRoundRectRgn(int, int, int, int, int, int);
  1191. int FAR PASCAL GetObject(HANDLE, int, LPSTR);
  1192. BOOL FAR PASCAL DeleteObject(HANDLE);
  1193. HANDLE FAR PASCAL SelectObject(HDC, HANDLE);
  1194. BOOL FAR PASCAL UnrealizeObject(HBRUSH);
  1195. DWORD FAR PASCAL SetBkColor(HDC, DWORD);
  1196. DWORD FAR PASCAL GetBkColor(HDC);
  1197. int FAR PASCAL SetBkMode(HDC, int);
  1198. int FAR PASCAL GetBkMode(HDC);
  1199. DWORD FAR PASCAL SetTextColor(HDC, DWORD);
  1200. DWORD FAR PASCAL GetTextColor(HDC);
  1201. WORD FAR PASCAL SetTextAlign(HDC, WORD);
  1202. WORD FAR PASCAL GetTextAlign(HDC);
  1203. DWORD FAR PASCAL SetMapperFlags(HDC, DWORD);
  1204. DWORD FAR PASCAL GetAspectRatioFilter(HDC);
  1205. DWORD FAR PASCAL GetNearestColor(HDC, DWORD);
  1206. int FAR PASCAL SetROP2(HDC, int);
  1207. int FAR PASCAL GetROP2(HDC);
  1208. int FAR PASCAL SetStretchBltMode(HDC, int);
  1209. int FAR PASCAL GetStretchBltMode(HDC);
  1210. int FAR PASCAL SetPolyFillMode(HDC, int);
  1211. int FAR PASCAL GetPolyFillMode(HDC);
  1212. int FAR PASCAL SetMapMode(HDC, int);
  1213. int FAR PASCAL GetMapMode(HDC);
  1214. DWORD FAR PASCAL SetWindowOrg(HDC, int, int);
  1215. DWORD FAR PASCAL GetWindowOrg(HDC);
  1216. DWORD FAR PASCAL SetWindowExt(HDC, int, int);
  1217. DWORD FAR PASCAL GetWindowExt(HDC);
  1218. DWORD FAR PASCAL SetViewportOrg(HDC, int, int);
  1219. DWORD FAR PASCAL GetViewportOrg(HDC);
  1220. DWORD FAR PASCAL SetViewportExt(HDC, int, int);
  1221. DWORD FAR PASCAL GetViewportExt(HDC);
  1222. DWORD FAR PASCAL OffsetViewportOrg(HDC, int, int);
  1223. DWORD FAR PASCAL ScaleViewportExt(HDC, int, int, int, int);
  1224. DWORD FAR PASCAL OffsetWindowOrg(HDC, int, int);
  1225. DWORD FAR PASCAL ScaleWindowExt(HDC, int, int, int, int);
  1226. int FAR PASCAL GetClipBox(HDC, LPRECT);
  1227. int FAR PASCAL IntersectClipRect(HDC, int, int, int, int);
  1228. int FAR PASCAL OffsetClipRgn(HDC, int, int);
  1229. int FAR PASCAL ExcludeClipRect(HDC, int, int, int, int);
  1230. BOOL FAR PASCAL PtVisible(HDC, int, int);
  1231. int FAR PASCAL CombineRgn(HRGN, HRGN, HRGN, int);
  1232. BOOL FAR PASCAL EqualRgn(HRGN, HRGN);
  1233. int FAR PASCAL OffsetRgn(HRGN, int, int);
  1234. int FAR PASCAL GetRgnBox(HRGN, LPRECT);
  1235. int FAR PASCAL SetTextJustification(HDC, int, int);
  1236. DWORD FAR PASCAL GetTextExtent(HDC, LPSTR, int);
  1237. DWORD FAR PASCAL GetTabbedTextExtent(HDC, LPSTR, int, int, LPINT);
  1238. int FAR PASCAL SetTextCharacterExtra(HDC, int);
  1239. int FAR PASCAL GetTextCharacterExtra(HDC);
  1240. HANDLE FAR PASCAL GetMetaFile(LPSTR);
  1241. BOOL FAR PASCAL DeleteMetaFile(HANDLE);
  1242. HANDLE FAR PASCAL CopyMetaFile(HANDLE, LPSTR);
  1243. #ifndef NOMETAFILE
  1244. void FAR PASCAL PlayMetaFileRecord(HDC, LPHANDLETABLE, LPMETARECORD, WORD);
  1245. BOOL FAR PASCAL EnumMetaFile(HDC, LOCALHANDLE, FARPROC, BYTE FAR *);
  1246. #endif
  1247. BOOL FAR PASCAL PlayMetaFile(HDC, HANDLE);
  1248. int FAR PASCAL Escape(HDC, int, int, LPSTR, LPSTR);
  1249. int FAR PASCAL EnumFonts(HDC, LPSTR, FARPROC, LPSTR);
  1250. int FAR PASCAL EnumObjects(HDC, int, FARPROC, LPSTR);
  1251. int FAR PASCAL GetTextFace(HDC, int, LPSTR);
  1252. #ifndef NOTEXTMETRIC
  1253. BOOL FAR PASCAL GetTextMetrics(HDC, LPTEXTMETRIC );
  1254. #endif
  1255. int FAR PASCAL GetDeviceCaps(HDC, int);
  1256. int FAR PASCAL SetEnvironment(LPSTR, LPSTR, WORD);
  1257. int FAR PASCAL GetEnvironment(LPSTR, LPSTR, WORD);
  1258. BOOL FAR PASCAL DPtoLP(HDC, LPPOINT, int);
  1259. BOOL FAR PASCAL LPtoDP(HDC, LPPOINT, int);
  1260. HANDLE FAR PASCAL CreateMetaFile(LPSTR);
  1261. HANDLE FAR PASCAL CloseMetaFile(HANDLE);
  1262. HANDLE FAR PASCAL GetMetaFileBits(HANDLE);
  1263. HANDLE FAR PASCAL SetMetaFileBits(HANDLE);
  1264. int FAR PASCAL SetDIBits(HDC,HANDLE,WORD,WORD,LPSTR,LPBITMAPINFO,WORD);
  1265. int FAR PASCAL GetDIBits(HDC,HANDLE,WORD,WORD,LPSTR,LPBITMAPINFO,WORD);
  1266. int FAR PASCAL SetDIBitsToDevice(HDC,WORD,WORD,WORD,WORD,
  1267. WORD,WORD,WORD,WORD,
  1268. LPSTR,LPBITMAPINFO,WORD);
  1269. HBITMAP FAR PASCAL CreateDIBitmap(HDC,LPBITMAPINFOHEADER,DWORD,LPSTR,
  1270. LPBITMAPINFO,WORD);
  1271. HBRUSH FAR PASCAL CreateDIBPatternBrush(HANDLE,WORD);
  1272. int FAR PASCAL StretchDIBits(HDC, WORD, WORD, WORD, WORD, WORD,
  1273. WORD, WORD, WORD, LPSTR, LPBITMAPINFO, WORD, DWORD);
  1274. HPALETTE FAR PASCAL CreatePalette (LPLOGPALETTE);
  1275. HPALETTE FAR PASCAL SelectPalette (HDC,HPALETTE, BOOL) ;
  1276. WORD FAR PASCAL RealizePalette (HDC) ;
  1277. int FAR PASCAL UpdateColors (HDC) ;
  1278. void FAR PASCAL AnimatePalette(HPALETTE, WORD, WORD, LPPALETTEENTRY);
  1279. WORD FAR PASCAL SetPaletteEntries(HPALETTE,WORD,WORD,LPPALETTEENTRY);
  1280. WORD FAR PASCAL GetPaletteEntries(HPALETTE,WORD,WORD,LPPALETTEENTRY);
  1281. WORD FAR PASCAL GetNearestPaletteIndex(HPALETTE, DWORD);
  1282. BOOL FAR PASCAL ResizePalette(HPALETTE, WORD);
  1283. WORD FAR PASCAL GetSystemPaletteEntries(HDC,WORD,WORD,LPPALETTEENTRY);
  1284. WORD FAR PASCAL GetSystemPaletteUse(HDC, WORD);
  1285. WORD FAR PASCAL SetSystemPaletteUse(HDC, WORD);
  1286. #endif /* NOGDI */
  1287. /*--------------------------------------------------------------------------*/
  1288. /* USER Section */
  1289. /*--------------------------------------------------------------------------*/
  1290. #ifndef NOUSER
  1291. int FAR PASCAL wvsprintf(LPSTR,LPSTR,LPSTR);
  1292. int FAR cdecl wsprintf(LPSTR,LPSTR,...);
  1293. #ifndef NOSCROLL
  1294. /* Scroll Bar Constants */
  1295. #define SB_HORZ 0
  1296. #define SB_VERT 1
  1297. #define SB_CTL 2
  1298. #define SB_BOTH 3
  1299. /* Scroll Bar Commands */
  1300. #define SB_LINEUP 0
  1301. #define SB_LINEDOWN 1
  1302. #define SB_PAGEUP 2
  1303. #define SB_PAGEDOWN 3
  1304. #define SB_THUMBPOSITION 4
  1305. #define SB_THUMBTRACK 5
  1306. #define SB_TOP 6
  1307. #define SB_BOTTOM 7
  1308. #define SB_ENDSCROLL 8
  1309. #endif /* NOSCROLL */
  1310. #ifndef NOSHOWWINDOW
  1311. /* ShowWindow() Commands */
  1312. #define SW_HIDE 0
  1313. #define SW_SHOWNORMAL 1
  1314. #define SW_NORMAL 1
  1315. #define SW_SHOWMINIMIZED 2
  1316. #define SW_SHOWMAXIMIZED 3
  1317. #define SW_MAXIMIZE 3
  1318. #define SW_SHOWNOACTIVATE 4
  1319. #define SW_SHOW 5
  1320. #define SW_MINIMIZE 6
  1321. #define SW_SHOWMINNOACTIVE 7
  1322. #define SW_SHOWNA 8
  1323. #define SW_RESTORE 9
  1324. /* Old ShowWindow() Commands */
  1325. #define HIDE_WINDOW 0
  1326. #define SHOW_OPENWINDOW 1
  1327. #define SHOW_ICONWINDOW 2
  1328. #define SHOW_FULLSCREEN 3
  1329. #define SHOW_OPENNOACTIVATE 4
  1330. /* Identifiers for the WM_SHOWWINDOW message */
  1331. #define SW_PARENTCLOSING 1
  1332. #define SW_OTHERZOOM 2
  1333. #define SW_PARENTOPENING 3
  1334. #define SW_OTHERUNZOOM 4
  1335. #endif /* NOSHOWWINDOW */
  1336. /* Region Flags */
  1337. #define ERROR 0
  1338. #define NULLREGION 1
  1339. #define SIMPLEREGION 2
  1340. #define COMPLEXREGION 3
  1341. /* CombineRgn() Styles */
  1342. #define RGN_AND 1
  1343. #define RGN_OR 2
  1344. #define RGN_XOR 3
  1345. #define RGN_DIFF 4
  1346. #define RGN_COPY 5
  1347. #ifndef NOVIRTUALKEYCODES
  1348. /* Virtual Keys, Standard Set */
  1349. #define VK_LBUTTON 0x01
  1350. #define VK_RBUTTON 0x02
  1351. #define VK_CANCEL 0x03
  1352. #define VK_MBUTTON 0x04 /* NOT contiguous with L & RBUTTON */
  1353. #define VK_BACK 0x08
  1354. #define VK_TAB 0x09
  1355. #define VK_CLEAR 0x0C
  1356. #define VK_RETURN 0x0D
  1357. #define VK_SHIFT 0x10
  1358. #define VK_CONTROL 0x11
  1359. #define VK_MENU 0x12
  1360. #define VK_PAUSE 0x13
  1361. #define VK_CAPITAL 0x14
  1362. #define VK_ESCAPE 0x1B
  1363. #define VK_SPACE 0x20
  1364. #define VK_PRIOR 0x21
  1365. #define VK_NEXT 0x22
  1366. #define VK_END 0x23
  1367. #define VK_HOME 0x24
  1368. #define VK_LEFT 0x25
  1369. #define VK_UP 0x26
  1370. #define VK_RIGHT 0x27
  1371. #define VK_DOWN 0x28
  1372. #define VK_SELECT 0x29
  1373. #define VK_PRINT 0x2A
  1374. #define VK_EXECUTE 0x2B
  1375. #define VK_SNAPSHOT 0x2C
  1376. /* #define VK_COPY 0x2C not used by keyboards. */
  1377. #define VK_INSERT 0x2D
  1378. #define VK_DELETE 0x2E
  1379. #define VK_HELP 0x2F
  1380. /* VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z' */
  1381. /* VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '0' */
  1382. #define VK_NUMPAD0 0x60
  1383. #define VK_NUMPAD1 0x61
  1384. #define VK_NUMPAD2 0x62
  1385. #define VK_NUMPAD3 0x63
  1386. #define VK_NUMPAD4 0x64
  1387. #define VK_NUMPAD5 0x65
  1388. #define VK_NUMPAD6 0x66
  1389. #define VK_NUMPAD7 0x67
  1390. #define VK_NUMPAD8 0x68
  1391. #define VK_NUMPAD9 0x69
  1392. #define VK_MULTIPLY 0x6A
  1393. #define VK_ADD 0x6B
  1394. #define VK_SEPARATOR 0x6C
  1395. #define VK_SUBTRACT 0x6D
  1396. #define VK_DECIMAL 0x6E
  1397. #define VK_DIVIDE 0x6F
  1398. #define VK_F1 0x70
  1399. #define VK_F2 0x71
  1400. #define VK_F3 0x72
  1401. #define VK_F4 0x73
  1402. #define VK_F5 0x74
  1403. #define VK_F6 0x75
  1404. #define VK_F7 0x76
  1405. #define VK_F8 0x77
  1406. #define VK_F9 0x78
  1407. #define VK_F10 0x79
  1408. #define VK_F11 0x7A
  1409. #define VK_F12 0x7B
  1410. #define VK_F13 0x7C
  1411. #define VK_F14 0x7D
  1412. #define VK_F15 0x7E
  1413. #define VK_F16 0x7F
  1414. #define VK_NUMLOCK 0x90
  1415. #endif /* NOVIRTUALKEYCODES */
  1416. #ifndef NOWH
  1417. /* SetWindowsHook() codes */
  1418. #define WH_MSGFILTER (-1)
  1419. #define WH_JOURNALRECORD 0
  1420. #define WH_JOURNALPLAYBACK 1
  1421. #define WH_KEYBOARD 2
  1422. #define WH_GETMESSAGE 3
  1423. #define WH_CALLWNDPROC 4
  1424. #define WH_CBT 5
  1425. #define WH_SYSMSGFILTER 6
  1426. #define WH_WINDOWMGR 7
  1427. /* Hook Codes */
  1428. #define HC_LPLPFNNEXT (-2)
  1429. #define HC_LPFNNEXT (-1)
  1430. #define HC_ACTION 0
  1431. #define HC_GETNEXT 1
  1432. #define HC_SKIP 2
  1433. #define HC_NOREM 3
  1434. #define HC_NOREMOVE 3
  1435. #define HC_SYSMODALON 4
  1436. #define HC_SYSMODALOFF 5
  1437. /* CBT Hook Codes */
  1438. #define HCBT_MOVESIZE 0
  1439. #define HCBT_MINMAX 1
  1440. #define HCBT_QS 2
  1441. /* WH_MSGFILTER Filter Proc Codes */
  1442. #define MSGF_DIALOGBOX 0
  1443. #define MSGF_MESSAGEBOX 1
  1444. #define MSGF_MENU 2
  1445. #define MSGF_MOVE 3
  1446. #define MSGF_SIZE 4
  1447. #define MSGF_SCROLLBAR 5
  1448. #define MSGF_NEXTWINDOW 6
  1449. /* Window Manager Hook Codes */
  1450. #define WC_INIT 1
  1451. #define WC_SWP 2
  1452. #define WC_DEFWINDOWPROC 3
  1453. #define WC_MINMAX 4
  1454. #define WC_MOVE 5
  1455. #define WC_SIZE 6
  1456. #define WC_DRAWCAPTION 7
  1457. /* Message Structure used in Journaling */
  1458. typedef struct tagEVENTMSG
  1459. {
  1460. WORD message;
  1461. WORD paramL;
  1462. WORD paramH;
  1463. DWORD time;
  1464. } EVENTMSG;
  1465. typedef EVENTMSG *PEVENTMSGMSG;
  1466. typedef EVENTMSG NEAR *NPEVENTMSGMSG;
  1467. typedef EVENTMSG FAR *LPEVENTMSGMSG;
  1468. #endif /* NOWH */
  1469. typedef struct tagWNDCLASS
  1470. {
  1471. WORD style;
  1472. LONG (FAR PASCAL *lpfnWndProc)();
  1473. int cbClsExtra;
  1474. int cbWndExtra;
  1475. HANDLE hInstance;
  1476. HICON hIcon;
  1477. HCURSOR hCursor;
  1478. HBRUSH hbrBackground;
  1479. LPSTR lpszMenuName;
  1480. LPSTR lpszClassName;
  1481. } WNDCLASS;
  1482. typedef WNDCLASS *PWNDCLASS;
  1483. typedef WNDCLASS NEAR *NPWNDCLASS;
  1484. typedef WNDCLASS FAR *LPWNDCLASS;
  1485. #ifndef NOMSG
  1486. /* Message structure */
  1487. typedef struct tagMSG
  1488. {
  1489. HWND hwnd;
  1490. WORD message;
  1491. WORD wParam;
  1492. LONG lParam;
  1493. DWORD time;
  1494. POINT pt;
  1495. } MSG;
  1496. typedef MSG *PMSG;
  1497. typedef MSG NEAR *NPMSG;
  1498. typedef MSG FAR *LPMSG;
  1499. #endif /* NOMSG */
  1500. #ifndef NOWINOFFSETS
  1501. /* Window field offsets for GetWindowLong() and GetWindowWord() */
  1502. #define GWL_WNDPROC (-4)
  1503. #define GWW_HINSTANCE (-6)
  1504. #define GWW_HWNDPARENT (-8)
  1505. #define GWW_ID (-12)
  1506. #define GWL_STYLE (-16)
  1507. #define GWL_EXSTYLE (-20)
  1508. /* Class field offsets for GetClassLong() and GetClassWord() */
  1509. #define GCL_MENUNAME (-8)
  1510. #define GCW_HBRBACKGROUND (-10)
  1511. #define GCW_HCURSOR (-12)
  1512. #define GCW_HICON (-14)
  1513. #define GCW_HMODULE (-16)
  1514. #define GCW_CBWNDEXTRA (-18)
  1515. #define GCW_CBCLSEXTRA (-20)
  1516. #define GCL_WNDPROC (-24)
  1517. #define GCW_STYLE (-26)
  1518. #endif /* NOWINOFFSETS */
  1519. #ifndef NOWINMESSAGES
  1520. /* Window Messages */
  1521. #define WM_NULL 0x0000
  1522. #define WM_CREATE 0x0001
  1523. #define WM_DESTROY 0x0002
  1524. #define WM_MOVE 0x0003
  1525. #define WM_SIZE 0x0005
  1526. #define WM_ACTIVATE 0x0006
  1527. #define WM_SETFOCUS 0x0007
  1528. #define WM_KILLFOCUS 0x0008
  1529. #define WM_ENABLE 0x000A
  1530. #define WM_SETREDRAW 0x000B
  1531. #define WM_SETTEXT 0x000C
  1532. #define WM_GETTEXT 0x000D
  1533. #define WM_GETTEXTLENGTH 0x000E
  1534. #define WM_PAINT 0x000F
  1535. #define WM_CLOSE 0x0010
  1536. #define WM_QUERYENDSESSION 0x0011
  1537. #define WM_QUIT 0x0012
  1538. #define WM_QUERYOPEN 0x0013
  1539. #define WM_ERASEBKGND 0x0014
  1540. #define WM_SYSCOLORCHANGE 0x0015
  1541. #define WM_ENDSESSION 0x0016
  1542. #define WM_SHOWWINDOW 0x0018
  1543. #define WM_CTLCOLOR 0x0019
  1544. #define WM_SETTINGCHANGE 0x001A
  1545. #define WM_DEVMODECHANGE 0x001B
  1546. #define WM_ACTIVATEAPP 0x001C
  1547. #define WM_FONTCHANGE 0x001D
  1548. #define WM_TIMECHANGE 0x001E
  1549. #define WM_CANCELMODE 0x001F
  1550. #define WM_SETCURSOR 0x0020
  1551. #define WM_MOUSEACTIVATE 0x0021
  1552. #define WM_CHILDACTIVATE 0x0022
  1553. #define WM_QUEUESYNC 0x0023
  1554. #define WM_GETMINMAXINFO 0x0024
  1555. #define WM_PAINTICON 0x0026
  1556. #define WM_ICONERASEBKGND 0x0027
  1557. #define WM_NEXTDLGCTL 0x0028
  1558. #define WM_SPOOLERSTATUS 0x002A
  1559. #define WM_DRAWITEM 0x002B
  1560. #define WM_MEASUREITEM 0x002C
  1561. #define WM_DELETEITEM 0x002D
  1562. #define WM_VKEYTOITEM 0x002E
  1563. #define WM_CHARTOITEM 0x002F
  1564. #define WM_SETFONT 0x0030
  1565. #define WM_GETFONT 0x0031
  1566. #define WM_QUERYDRAGICON 0x0037
  1567. #define WM_COMPAREITEM 0x0039
  1568. #define WM_COMPACTING 0x0041
  1569. #define WM_NCCREATE 0x0081
  1570. #define WM_NCDESTROY 0x0082
  1571. #define WM_NCCALCSIZE 0x0083
  1572. #define WM_NCHITTEST 0x0084
  1573. #define WM_NCPAINT 0x0085
  1574. #define WM_NCACTIVATE 0x0086
  1575. #define WM_GETDLGCODE 0x0087
  1576. #define WM_NCMOUSEMOVE 0x00A0
  1577. #define WM_NCLBUTTONDOWN 0x00A1
  1578. #define WM_NCLBUTTONUP 0x00A2
  1579. #define WM_NCLBUTTONDBLCLK 0x00A3
  1580. #define WM_NCRBUTTONDOWN 0x00A4
  1581. #define WM_NCRBUTTONUP 0x00A5
  1582. #define WM_NCRBUTTONDBLCLK 0x00A6
  1583. #define WM_NCMBUTTONDOWN 0x00A7
  1584. #define WM_NCMBUTTONUP 0x00A8
  1585. #define WM_NCMBUTTONDBLCLK 0x00A9
  1586. #define WM_KEYFIRST 0x0100
  1587. #define WM_KEYDOWN 0x0100
  1588. #define WM_KEYUP 0x0101
  1589. #define WM_CHAR 0x0102
  1590. #define WM_DEADCHAR 0x0103
  1591. #define WM_SYSKEYDOWN 0x0104
  1592. #define WM_SYSKEYUP 0x0105
  1593. #define WM_SYSCHAR 0x0106
  1594. #define WM_SYSDEADCHAR 0x0107
  1595. #define WM_KEYLAST 0x0108
  1596. #define WM_INITDIALOG 0x0110
  1597. #define WM_COMMAND 0x0111
  1598. #define WM_SYSCOMMAND 0x0112
  1599. #define WM_TIMER 0x0113
  1600. #define WM_HSCROLL 0x0114
  1601. #define WM_VSCROLL 0x0115
  1602. #define WM_INITMENU 0x0116
  1603. #define WM_INITMENUPOPUP 0x0117
  1604. #define WM_MENUSELECT 0x011F
  1605. #define WM_MENUCHAR 0x0120
  1606. #define WM_ENTERIDLE 0x0121
  1607. #define WM_MOUSEFIRST 0x0200
  1608. #define WM_MOUSEMOVE 0x0200
  1609. #define WM_LBUTTONDOWN 0x0201
  1610. #define WM_LBUTTONUP 0x0202
  1611. #define WM_LBUTTONDBLCLK 0x0203
  1612. #define WM_RBUTTONDOWN 0x0204
  1613. #define WM_RBUTTONUP 0x0205
  1614. #define WM_RBUTTONDBLCLK 0x0206
  1615. #define WM_MBUTTONDOWN 0x0207
  1616. #define WM_MBUTTONUP 0x0208
  1617. #define WM_MBUTTONDBLCLK 0x0209
  1618. #define WM_MOUSELAST 0x0209
  1619. #define WM_PARENTNOTIFY 0x0210
  1620. #define WM_MDICREATE 0x0220
  1621. #define WM_MDIDESTROY 0x0221
  1622. #define WM_MDIACTIVATE 0x0222
  1623. #define WM_MDIRESTORE 0x0223
  1624. #define WM_MDINEXT 0x0224
  1625. #define WM_MDIMAXIMIZE 0x0225
  1626. #define WM_MDITILE 0x0226
  1627. #define WM_MDICASCADE 0x0227
  1628. #define WM_MDIICONARRANGE 0x0228
  1629. #define WM_MDIGETACTIVE 0x0229
  1630. #define WM_MDISETMENU 0x0230
  1631. #define WM_CUT 0x0300
  1632. #define WM_COPY 0x0301
  1633. #define WM_PASTE 0x0302
  1634. #define WM_CLEAR 0x0303
  1635. #define WM_UNDO 0x0304
  1636. #define WM_RENDERFORMAT 0x0305
  1637. #define WM_RENDERALLFORMATS 0x0306
  1638. #define WM_DESTROYCLIPBOARD 0x0307
  1639. #define WM_DRAWCLIPBOARD 0x0308
  1640. #define WM_PAINTCLIPBOARD 0x0309
  1641. #define WM_VSCROLLCLIPBOARD 0x030A
  1642. #define WM_SIZECLIPBOARD 0x030B
  1643. #define WM_ASKCBFORMATNAME 0x030C
  1644. #define WM_CHANGECBCHAIN 0x030D
  1645. #define WM_HSCROLLCLIPBOARD 0x030E
  1646. #define WM_QUERYNEWPALETTE 0x030F
  1647. #define WM_PALETTEISCHANGING 0x0310
  1648. #define WM_PALETTECHANGED 0x0311
  1649. /* NOTE: All Message Numbers below 0x0400 are RESERVED. */
  1650. /* Private Window Messages Start Here: */
  1651. #define WM_USER 0x0400
  1652. #ifndef NONCMESSAGES
  1653. /* WM_SYNCTASK Commands */
  1654. #define ST_BEGINSWP 0
  1655. #define ST_ENDSWP 1
  1656. /* WinWhere() Area Codes */
  1657. #define HTERROR (-2)
  1658. #define HTTRANSPARENT (-1)
  1659. #define HTNOWHERE 0
  1660. #define HTCLIENT 1
  1661. #define HTCAPTION 2
  1662. #define HTSYSMENU 3
  1663. #define HTGROWBOX 4
  1664. #define HTSIZE HTGROWBOX
  1665. #define HTMENU 5
  1666. #define HTHSCROLL 6
  1667. #define HTVSCROLL 7
  1668. #define HTREDUCE 8
  1669. #define HTZOOM 9
  1670. #define HTLEFT 10
  1671. #define HTRIGHT 11
  1672. #define HTTOP 12
  1673. #define HTTOPLEFT 13
  1674. #define HTTOPRIGHT 14
  1675. #define HTBOTTOM 15
  1676. #define HTBOTTOMLEFT 16
  1677. #define HTBOTTOMRIGHT 17
  1678. #define HTSIZEFIRST HTLEFT
  1679. #define HTSIZELAST HTBOTTOMRIGHT
  1680. #endif /* NONCMESSAGES */
  1681. /* WM_MOUSEACTIVATE Return Codes */
  1682. #define MA_ACTIVATE 1
  1683. #define MA_ACTIVATEANDEAT 2
  1684. #define MA_NOACTIVATE 3
  1685. WORD FAR PASCAL RegisterWindowMessage(LPSTR);
  1686. /* Size Message Commands */
  1687. #define SIZENORMAL 0
  1688. #define SIZEICONIC 1
  1689. #define SIZEFULLSCREEN 2
  1690. #define SIZEZOOMSHOW 3
  1691. #define SIZEZOOMHIDE 4
  1692. #ifndef NOKEYSTATES
  1693. /* Key State Masks for Mouse Messages */
  1694. #define MK_LBUTTON 0x0001
  1695. #define MK_RBUTTON 0x0002
  1696. #define MK_SHIFT 0x0004
  1697. #define MK_CONTROL 0x0008
  1698. #define MK_MBUTTON 0x0010
  1699. #endif /* NOKEYSTATES */
  1700. #endif /* NOWINMESSAGES */
  1701. #ifndef NOWINSTYLES
  1702. /* Window Styles */
  1703. #define WS_OVERLAPPED 0x00000000L
  1704. #define WS_POPUP 0x80000000L
  1705. #define WS_CHILD 0x40000000L
  1706. #define WS_MINIMIZE 0x20000000L
  1707. #define WS_VISIBLE 0x10000000L
  1708. #define WS_DISABLED 0x08000000L
  1709. #define WS_CLIPSIBLINGS 0x04000000L
  1710. #define WS_CLIPCHILDREN 0x02000000L
  1711. #define WS_MAXIMIZE 0x01000000L
  1712. #define WS_CAPTION 0x00C00000L /* WS_BORDER | WS_DLGFRAME */
  1713. #define WS_BORDER 0x00800000L
  1714. #define WS_DLGFRAME 0x00400000L
  1715. #define WS_VSCROLL 0x00200000L
  1716. #define WS_HSCROLL 0x00100000L
  1717. #define WS_SYSMENU 0x00080000L
  1718. #define WS_THICKFRAME 0x00040000L
  1719. #define WS_GROUP 0x00020000L
  1720. #define WS_TABSTOP 0x00010000L
  1721. #define WS_MINIMIZEBOX 0x00020000L
  1722. #define WS_MAXIMIZEBOX 0x00010000L
  1723. #define WS_TILED WS_OVERLAPPED
  1724. #define WS_ICONIC WS_MINIMIZE
  1725. #define WS_SIZEBOX WS_THICKFRAME
  1726. /* Common Window Styles */
  1727. #define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
  1728. #define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU)
  1729. #define WS_CHILDWINDOW (WS_CHILD)
  1730. #define WS_TILEDWINDOW (WS_OVERLAPPEDWINDOW)
  1731. /* Extended Window Styles */
  1732. #define WS_EX_DLGMODALFRAME 0x00000001L
  1733. #define WS_EX_NOPARENTNOTIFY 0x00000004L
  1734. /* Class styles */
  1735. #define CS_VREDRAW 0x0001
  1736. #define CS_HREDRAW 0x0002
  1737. #define CS_KEYCVTWINDOW 0x0004
  1738. #define CS_DBLCLKS 0x0008
  1739. /* 0x0010 -- no longer used */
  1740. #define CS_OWNDC 0x0020
  1741. #define CS_CLASSDC 0x0040
  1742. #define CS_PARENTDC 0x0080
  1743. #define CS_NOKEYCVT 0x0100
  1744. #define CS_NOCLOSE 0x0200
  1745. #define CS_SAVEBITS 0x0800
  1746. #define CS_BYTEALIGNCLIENT 0x1000
  1747. #define CS_BYTEALIGNWINDOW 0x2000
  1748. #define CS_GLOBALCLASS 0x4000 /* Global window class */
  1749. #endif /* NOWINSTYLES */
  1750. #ifndef NOCLIPBOARD
  1751. /* Predefined Clipboard Formats */
  1752. #define CF_TEXT 1
  1753. #define CF_BITMAP 2
  1754. #define CF_METAFILEPICT 3
  1755. #define CF_SYLK 4
  1756. #define CF_DIF 5
  1757. #define CF_TIFF 6
  1758. #define CF_OEMTEXT 7
  1759. #define CF_DIB 8
  1760. #define CF_PALETTE 9
  1761. #define CF_OWNERDISPLAY 0x0080
  1762. #define CF_DSPTEXT 0x0081
  1763. #define CF_DSPBITMAP 0x0082
  1764. #define CF_DSPMETAFILEPICT 0x0083
  1765. /* "Private" formats don't get GlobalFree()'d */
  1766. #define CF_PRIVATEFIRST 0x0200
  1767. #define CF_PRIVATELAST 0x02FF
  1768. /* "GDIOBJ" formats do get DeleteObject()'d */
  1769. #define CF_GDIOBJFIRST 0x0300
  1770. #define CF_GDIOBJLAST 0x03FF
  1771. #endif /* NOCLIPBOARD */
  1772. typedef struct tagPAINTSTRUCT
  1773. {
  1774. HDC hdc;
  1775. BOOL fErase;
  1776. RECT rcPaint;
  1777. BOOL fRestore;
  1778. BOOL fIncUpdate;
  1779. BYTE rgbReserved[16];
  1780. } PAINTSTRUCT;
  1781. typedef PAINTSTRUCT *PPAINTSTRUCT;
  1782. typedef PAINTSTRUCT NEAR *NPPAINTSTRUCT;
  1783. typedef PAINTSTRUCT FAR *LPPAINTSTRUCT;
  1784. typedef struct tagCREATESTRUCT
  1785. {
  1786. LPSTR lpCreateParams;
  1787. HANDLE hInstance;
  1788. HANDLE hMenu;
  1789. HWND hwndParent;
  1790. int cy;
  1791. int cx;
  1792. int y;
  1793. int x;
  1794. LONG style;
  1795. LPSTR lpszName;
  1796. LPSTR lpszClass;
  1797. DWORD dwExStyle;
  1798. } CREATESTRUCT;
  1799. typedef CREATESTRUCT FAR *LPCREATESTRUCT;
  1800. /* Owner draw control types */
  1801. #define ODT_MENU 1
  1802. #define ODT_LISTBOX 2
  1803. #define ODT_COMBOBOX 3
  1804. #define ODT_BUTTON 4
  1805. /* Owner draw actions */
  1806. #define ODA_DRAWENTIRE 0x0001
  1807. #define ODA_SELECT 0x0002
  1808. #define ODA_FOCUS 0x0004
  1809. /* Owner draw state */
  1810. #define ODS_SELECTED 0x0001
  1811. #define ODS_GRAYED 0x0002
  1812. #define ODS_DISABLED 0x0004
  1813. #define ODS_CHECKED 0x0008
  1814. #define ODS_FOCUS 0x0010
  1815. /* MEASUREITEMSTRUCT for ownerdraw */
  1816. typedef struct tagMEASUREITEMSTRUCT
  1817. {
  1818. WORD CtlType;
  1819. WORD CtlID;
  1820. WORD itemID;
  1821. WORD itemWidth;
  1822. WORD itemHeight;
  1823. DWORD itemData;
  1824. } MEASUREITEMSTRUCT;
  1825. typedef MEASUREITEMSTRUCT NEAR *PMEASUREITEMSTRUCT;
  1826. typedef MEASUREITEMSTRUCT FAR *LPMEASUREITEMSTRUCT;
  1827. /* DRAWITEMSTRUCT for ownerdraw */
  1828. typedef struct tagDRAWITEMSTRUCT
  1829. {
  1830. WORD CtlType;
  1831. WORD CtlID;
  1832. WORD itemID;
  1833. WORD itemAction;
  1834. WORD itemState;
  1835. HWND hwndItem;
  1836. HDC hDC;
  1837. RECT rcItem;
  1838. DWORD itemData;
  1839. } DRAWITEMSTRUCT;
  1840. typedef DRAWITEMSTRUCT NEAR *PDRAWITEMSTRUCT;
  1841. typedef DRAWITEMSTRUCT FAR *LPDRAWITEMSTRUCT;
  1842. /* DELETEITEMSTRUCT for ownerdraw */
  1843. typedef struct tagDELETEITEMSTRUCT
  1844. {
  1845. WORD CtlType;
  1846. WORD CtlID;
  1847. WORD itemID;
  1848. HWND hwndItem;
  1849. DWORD itemData;
  1850. } DELETEITEMSTRUCT;
  1851. typedef DELETEITEMSTRUCT NEAR *PDELETEITEMSTRUCT;
  1852. typedef DELETEITEMSTRUCT FAR *LPDELETEITEMSTRUCT;
  1853. /* COMPAREITEMSTUCT for ownerdraw sorting */
  1854. typedef struct tagCOMPAREITEMSTRUCT
  1855. {
  1856. WORD CtlType;
  1857. WORD CtlID;
  1858. HWND hwndItem;
  1859. WORD itemID1;
  1860. DWORD itemData1;
  1861. WORD itemID2;
  1862. DWORD itemData2;
  1863. } COMPAREITEMSTRUCT;
  1864. typedef COMPAREITEMSTRUCT NEAR *PCOMPAREITEMSTRUCT;
  1865. typedef COMPAREITEMSTRUCT FAR *LPCOMPAREITEMSTRUCT;
  1866. #ifndef NOMSG
  1867. /* Message Function Templates */
  1868. BOOL FAR PASCAL GetMessage(LPMSG, HWND, WORD, WORD);
  1869. BOOL FAR PASCAL TranslateMessage(LPMSG);
  1870. LONG FAR PASCAL DispatchMessage(LPMSG);
  1871. BOOL FAR PASCAL PeekMessage(LPMSG, HWND, WORD, WORD, WORD);
  1872. /* PeekMessage() Options */
  1873. #define PM_NOREMOVE 0x0000
  1874. #define PM_REMOVE 0x0001
  1875. #define PM_NOYIELD 0x0002
  1876. #endif /* NOMSG */
  1877. #ifdef WIN_INTERNAL
  1878. #ifndef LSTRING
  1879. #define NOLSTRING
  1880. #endif
  1881. #ifndef LFILEIO
  1882. #define NOLFILEIO
  1883. #endif
  1884. #endif
  1885. #ifndef NOLSTRING
  1886. int FAR PASCAL lstrcmp( LPSTR, LPSTR );
  1887. int FAR PASCAL lstrcmpi( LPSTR, LPSTR );
  1888. LPSTR FAR PASCAL lstrcpy( LPSTR, LPSTR );
  1889. LPSTR FAR PASCAL lstrcat( LPSTR, LPSTR );
  1890. int FAR PASCAL lstrlen( LPSTR );
  1891. #endif /* NOLSTRING */
  1892. #ifndef NOLFILEIO
  1893. int FAR PASCAL _lopen( LPSTR, int );
  1894. int FAR PASCAL _lclose( int );
  1895. int FAR PASCAL _lcreat( LPSTR, int );
  1896. LONG FAR PASCAL _llseek( int, long, int );
  1897. WORD FAR PASCAL _lread( int, LPSTR, int );
  1898. WORD FAR PASCAL _lwrite( int, LPSTR, int );
  1899. #define READ 0 /* Flags for _lopen */
  1900. #define WRITE 1
  1901. #define READ_WRITE 2
  1902. #endif /* NOLFILEIO */
  1903. BOOL FAR PASCAL ExitWindows(DWORD dwReserved, WORD wReturnCode);
  1904. BOOL FAR PASCAL SwapMouseButton(BOOL);
  1905. DWORD FAR PASCAL GetMessagePos(void);
  1906. LONG FAR PASCAL GetMessageTime(void);
  1907. HWND FAR PASCAL GetSysModalWindow(void);
  1908. HWND FAR PASCAL SetSysModalWindow(HWND);
  1909. LONG FAR PASCAL SendMessage(HWND, WORD, WORD, LONG);
  1910. BOOL FAR PASCAL PostMessage(HWND, WORD, WORD, LONG);
  1911. BOOL FAR PASCAL PostAppMessage(HANDLE, WORD, WORD, LONG);
  1912. void FAR PASCAL ReplyMessage(LONG);
  1913. void FAR PASCAL WaitMessage(void);
  1914. LONG FAR PASCAL DefWindowProc(HWND, WORD, WORD, LONG);
  1915. void FAR PASCAL PostQuitMessage(int);
  1916. LONG FAR PASCAL CallWindowProc(FARPROC, HWND, WORD, WORD, LONG);
  1917. BOOL FAR PASCAL InSendMessage(void);
  1918. DWORD FAR PASCAL InSendMessageEx(LPVOID);
  1919. WORD FAR PASCAL GetDoubleClickTime(void);
  1920. void FAR PASCAL SetDoubleClickTime(WORD);
  1921. BOOL FAR PASCAL RegisterClass(LPWNDCLASS);
  1922. BOOL FAR PASCAL UnregisterClass(LPSTR, HANDLE);
  1923. BOOL FAR PASCAL GetClassInfo(HANDLE, LPSTR, LPWNDCLASS);
  1924. BOOL FAR PASCAL SetMessageQueue(int);
  1925. #define CW_USEDEFAULT ((int)0x8000)
  1926. HWND FAR PASCAL CreateWindow(LPSTR, LPSTR, DWORD, int, int, int, int, HWND, HMENU, HANDLE, LPSTR);
  1927. HWND FAR PASCAL CreateWindowEx(DWORD, LPSTR, LPSTR, DWORD, int, int, int, int, HWND, HMENU, HANDLE, LPSTR);
  1928. BOOL FAR PASCAL IsWindow(HWND);
  1929. BOOL FAR PASCAL IsChild(HWND, HWND);
  1930. BOOL FAR PASCAL DestroyWindow(HWND);
  1931. BOOL FAR PASCAL ShowWindow(HWND, int);
  1932. BOOL FAR PASCAL FlashWindow(HWND, BOOL);
  1933. void FAR PASCAL ShowOwnedPopups(HWND, BOOL);
  1934. BOOL FAR PASCAL OpenIcon(HWND);
  1935. void FAR PASCAL CloseWindow(HWND);
  1936. void FAR PASCAL MoveWindow(HWND, int, int, int, int, BOOL);
  1937. void FAR PASCAL SetWindowPos(HWND, HWND, int, int, int, int, WORD);
  1938. #ifndef NODEFERWINDOWPOS
  1939. HANDLE FAR PASCAL BeginDeferWindowPos(int nNumWindows);
  1940. HANDLE FAR PASCAL DeferWindowPos(HANDLE hWinPosInfo, HWND hWnd, HWND hWndInsertAfter, int x, int y, int cx, int cy, WORD wFlags);
  1941. void FAR PASCAL EndDeferWindowPos(HANDLE hWinPosInfo);
  1942. #endif /* NODEFERWINDOWPOS */
  1943. BOOL FAR PASCAL IsWindowVisible(HWND);
  1944. BOOL FAR PASCAL IsIconic(HWND);
  1945. BOOL FAR PASCAL AnyPopup(void);
  1946. void FAR PASCAL BringWindowToTop(HWND);
  1947. BOOL FAR PASCAL IsZoomed(HWND);
  1948. /* SetWindowPos Flags */
  1949. #define SWP_NOSIZE 0x0001
  1950. #define SWP_NOMOVE 0x0002
  1951. #define SWP_NOZORDER 0x0004
  1952. #define SWP_NOREDRAW 0x0008
  1953. #define SWP_NOACTIVATE 0x0010
  1954. #define SWP_DRAWFRAME 0x0020
  1955. #define SWP_SHOWWINDOW 0x0040
  1956. #define SWP_HIDEWINDOW 0x0080
  1957. #define SWP_NOCOPYBITS 0x0100
  1958. #define SWP_NOREPOSITION 0x0200
  1959. #ifndef NOCTLMGR
  1960. HWND FAR PASCAL CreateDialog(HANDLE, LPSTR, HWND, FARPROC);
  1961. HWND FAR PASCAL CreateDialogIndirect(HANDLE, LPSTR, HWND, FARPROC);
  1962. HWND FAR PASCAL CreateDialogParam(HANDLE, LPSTR, HWND, FARPROC, LONG);
  1963. HWND FAR PASCAL CreateDialogIndirectParam(HANDLE, LPSTR, HWND, FARPROC, LONG);
  1964. int FAR PASCAL DialogBox(HANDLE, LPSTR, HWND, FARPROC);
  1965. int FAR PASCAL DialogBoxIndirect(HANDLE, HANDLE, HWND, FARPROC);
  1966. int FAR PASCAL DialogBoxParam(HANDLE, LPSTR, HWND, FARPROC, LONG);
  1967. int FAR PASCAL DialogBoxIndirectParam(HANDLE, HANDLE, HWND, FARPROC, LONG);
  1968. void FAR PASCAL EndDialog(HWND, int);
  1969. HWND FAR PASCAL GetDlgItem(HWND, int);
  1970. void FAR PASCAL SetDlgItemInt(HWND, int, WORD, BOOL);
  1971. WORD FAR PASCAL GetDlgItemInt(HWND, int, BOOL FAR *, BOOL);
  1972. void FAR PASCAL SetDlgItemText(HWND, int, LPSTR);
  1973. int FAR PASCAL GetDlgItemText(HWND, int, LPSTR, int);
  1974. void FAR PASCAL CheckDlgButton(HWND, int, WORD);
  1975. void FAR PASCAL CheckRadioButton(HWND, int, int, int);
  1976. WORD FAR PASCAL IsDlgButtonChecked(HWND, int);
  1977. LONG FAR PASCAL SendDlgItemMessage(HWND, int, WORD, WORD, LONG);
  1978. HWND FAR PASCAL GetNextDlgGroupItem(HWND, HWND, BOOL);
  1979. HWND FAR PASCAL GetNextDlgTabItem(HWND, HWND, BOOL);
  1980. int FAR PASCAL GetDlgCtrlID(HWND);
  1981. long FAR PASCAL GetDialogBaseUnits(void);
  1982. LONG FAR PASCAL DefDlgProc(HWND, WORD, WORD, LONG);
  1983. #define DLGWINDOWEXTRA 30 /* Window extra byted needed for private dialog classes */
  1984. #endif /* NOCTLMGR */
  1985. #ifndef NOMSG
  1986. BOOL FAR PASCAL CallMsgFilter(LPMSG, int);
  1987. #endif
  1988. #ifndef NOCLIPBOARD
  1989. /* Clipboard Manager Functions */
  1990. BOOL FAR PASCAL OpenClipboard(HWND);
  1991. BOOL FAR PASCAL CloseClipboard(void);
  1992. HWND FAR PASCAL GetClipboardOwner(void);
  1993. HWND FAR PASCAL SetClipboardViewer(HWND);
  1994. HWND FAR PASCAL GetClipboardViewer(void);
  1995. BOOL FAR PASCAL ChangeClipboardChain(HWND, HWND);
  1996. HANDLE FAR PASCAL SetClipboardData(WORD, HANDLE);
  1997. HANDLE FAR PASCAL GetClipboardData(WORD);
  1998. WORD FAR PASCAL RegisterClipboardFormat(LPSTR);
  1999. int FAR PASCAL CountClipboardFormats(void);
  2000. WORD FAR PASCAL EnumClipboardFormats(WORD);
  2001. int FAR PASCAL GetClipboardFormatName(WORD, LPSTR, int);
  2002. BOOL FAR PASCAL EmptyClipboard(void);
  2003. BOOL FAR PASCAL IsClipboardFormatAvailable(WORD);
  2004. int FAR PASCAL GetPriorityClipboardFormat(WORD FAR *, int);
  2005. #endif /* NOCLIPBOARD */
  2006. HWND FAR PASCAL SetFocus(HWND);
  2007. HWND FAR PASCAL GetFocus(void);
  2008. HWND FAR PASCAL GetActiveWindow(void);
  2009. int FAR PASCAL GetKeyState(int);
  2010. int FAR PASCAL GetAsyncKeyState(int);
  2011. void FAR PASCAL GetKeyboardState(BYTE FAR *);
  2012. void FAR PASCAL SetKeyboardState(BYTE FAR *);
  2013. BOOL FAR PASCAL EnableHardwareInput(BOOL);
  2014. BOOL FAR PASCAL GetInputState(void);
  2015. HWND FAR PASCAL GetCapture(void);
  2016. HWND FAR PASCAL SetCapture(HWND);
  2017. void FAR PASCAL ReleaseCapture(void);
  2018. /* Windows Functions */
  2019. WORD FAR PASCAL SetTimer(HWND, int, WORD, FARPROC);
  2020. BOOL FAR PASCAL KillTimer(HWND, int);
  2021. BOOL FAR PASCAL EnableWindow(HWND,BOOL);
  2022. BOOL FAR PASCAL IsWindowEnabled(HWND);
  2023. HANDLE FAR PASCAL LoadAccelerators(HANDLE, LPSTR);
  2024. #ifndef NOMSG
  2025. int FAR PASCAL TranslateAccelerator(HWND, HANDLE, LPMSG);
  2026. #endif
  2027. #ifndef NOSYSMETRICS
  2028. /* GetSystemMetrics() codes */
  2029. #define SM_CXSCREEN 0
  2030. #define SM_CYSCREEN 1
  2031. #define SM_CXVSCROLL 2
  2032. #define SM_CYHSCROLL 3
  2033. #define SM_CYCAPTION 4
  2034. #define SM_CXBORDER 5
  2035. #define SM_CYBORDER 6
  2036. #define SM_CXDLGFRAME 7
  2037. #define SM_CYDLGFRAME 8
  2038. #define SM_CYVTHUMB 9
  2039. #define SM_CXHTHUMB 10
  2040. #define SM_CXICON 11
  2041. #define SM_CYICON 12
  2042. #define SM_CXCURSOR 13
  2043. #define SM_CYCURSOR 14
  2044. #define SM_CYMENU 15
  2045. #define SM_CXFULLSCREEN 16
  2046. #define SM_CYFULLSCREEN 17
  2047. #define SM_CYKANJIWINDOW 18
  2048. #define SM_MOUSEPRESENT 19
  2049. #define SM_CYVSCROLL 20
  2050. #define SM_CXHSCROLL 21
  2051. #define SM_DEBUG 22
  2052. #define SM_SWAPBUTTON 23
  2053. #define SM_RESERVED1 24
  2054. #define SM_RESERVED2 25
  2055. #define SM_RESERVED3 26
  2056. #define SM_RESERVED4 27
  2057. #define SM_CXMIN 28
  2058. #define SM_CYMIN 29
  2059. #define SM_CXSIZE 30
  2060. #define SM_CYSIZE 31
  2061. #define SM_CXFRAME 32
  2062. #define SM_CYFRAME 33
  2063. #define SM_CXMINTRACK 34
  2064. #define SM_CYMINTRACK 35
  2065. #define SM_CMETRICS 36
  2066. int FAR PASCAL GetSystemMetrics(int);
  2067. #endif /* NOSYSMETRICS */
  2068. #ifndef NOMENUS
  2069. HMENU FAR PASCAL LoadMenu(HANDLE, LPSTR);
  2070. HMENU FAR PASCAL LoadMenuIndirect(LPSTR);
  2071. HMENU FAR PASCAL GetMenu(HWND);
  2072. BOOL FAR PASCAL SetMenu(HWND, HMENU);
  2073. BOOL FAR PASCAL ChangeMenu(HMENU, WORD, LPSTR, WORD, WORD);
  2074. BOOL FAR PASCAL HiliteMenuItem(HWND, HMENU, WORD, WORD);
  2075. int FAR PASCAL GetMenuString(HMENU, WORD, LPSTR, int, WORD);
  2076. WORD FAR PASCAL GetMenuState(HMENU, WORD, WORD);
  2077. void FAR PASCAL DrawMenuBar(HWND);
  2078. HMENU FAR PASCAL GetSystemMenu(HWND, BOOL);
  2079. HMENU FAR PASCAL CreateMenu(void);
  2080. HMENU FAR PASCAL CreatePopupMenu(void);
  2081. BOOL FAR PASCAL DestroyMenu(HMENU);
  2082. BOOL FAR PASCAL CheckMenuItem(HMENU, WORD, WORD);
  2083. BOOL FAR PASCAL EnableMenuItem(HMENU, WORD, WORD);
  2084. HMENU FAR PASCAL GetSubMenu(HMENU, int);
  2085. WORD FAR PASCAL GetMenuItemID(HMENU, int);
  2086. WORD FAR PASCAL GetMenuItemCount(HMENU);
  2087. BOOL FAR PASCAL InsertMenu(HMENU, WORD, WORD, WORD, LPSTR);
  2088. BOOL FAR PASCAL AppendMenu(HMENU, WORD, WORD, LPSTR);
  2089. BOOL FAR PASCAL ModifyMenu(HMENU, WORD, WORD, WORD, LPSTR);
  2090. BOOL FAR PASCAL RemoveMenu(HMENU, WORD, WORD);
  2091. BOOL FAR PASCAL DeleteMenu(HMENU, WORD, WORD);
  2092. BOOL FAR PASCAL SetMenuItemBitmaps(HMENU, WORD, WORD, HBITMAP, HBITMAP);
  2093. LONG FAR PASCAL GetMenuCheckMarkDimensions(void);
  2094. BOOL FAR PASCAL TrackPopupMenu(HMENU, WORD, int, int, int, HWND, LPRECT);
  2095. #endif /* NOMENUS */
  2096. BOOL FAR PASCAL GrayString(HDC, HBRUSH, FARPROC, DWORD, int, int, int, int, int);
  2097. void FAR PASCAL UpdateWindow(HWND);
  2098. HWND FAR PASCAL SetActiveWindow(HWND);
  2099. HDC FAR PASCAL BeginPaint(HWND, LPPAINTSTRUCT);
  2100. void FAR PASCAL EndPaint(HWND, LPPAINTSTRUCT);
  2101. BOOL FAR PASCAL GetUpdateRect(HWND, LPRECT, BOOL);
  2102. int FAR PASCAL GetUpdateRgn(HWND, HRGN, BOOL);
  2103. int FAR PASCAL ExcludeUpdateRgn(HDC, HWND);
  2104. void FAR PASCAL InvalidateRect(HWND, LPRECT, BOOL);
  2105. void FAR PASCAL ValidateRect(HWND, LPRECT);
  2106. void FAR PASCAL InvalidateRgn(HWND, HRGN, BOOL);
  2107. void FAR PASCAL ValidateRgn(HWND, HRGN);
  2108. void FAR PASCAL ScrollWindow(HWND, int, int, LPRECT, LPRECT);
  2109. BOOL FAR PASCAL ScrollDC(HDC, int, int, LPRECT, LPRECT, HRGN, LPRECT);
  2110. #ifndef NOSCROLL
  2111. int FAR PASCAL SetScrollPos(HWND, int, int, BOOL);
  2112. int FAR PASCAL GetScrollPos(HWND, int);
  2113. void FAR PASCAL SetScrollRange(HWND, int, int, int, BOOL);
  2114. void FAR PASCAL GetScrollRange(HWND, int, LPINT, LPINT);
  2115. void FAR PASCAL ShowScrollBar(HWND, WORD, BOOL);
  2116. #endif
  2117. BOOL FAR PASCAL SetProp(HWND, LPSTR, HANDLE);
  2118. HANDLE FAR PASCAL GetProp(HWND, LPSTR);
  2119. HANDLE FAR PASCAL RemoveProp(HWND, LPSTR);
  2120. int FAR PASCAL EnumProps(HWND, FARPROC);
  2121. void FAR PASCAL SetWindowText(HWND, LPSTR);
  2122. int FAR PASCAL GetWindowText(HWND, LPSTR, int);
  2123. int FAR PASCAL GetWindowTextLength(HWND);
  2124. void FAR PASCAL GetClientRect(HWND, LPRECT);
  2125. void FAR PASCAL GetWindowRect(HWND, LPRECT);
  2126. void FAR PASCAL AdjustWindowRect(LPRECT, LONG, BOOL);
  2127. void FAR PASCAL AdjustWindowRectEx(LPRECT, LONG, BOOL, DWORD);
  2128. #ifndef NOMB
  2129. /* MessageBox() Flags */
  2130. #define MB_OK 0x0000
  2131. #define MB_OKCANCEL 0x0001
  2132. #define MB_ABORTRETRYIGNORE 0x0002
  2133. #define MB_YESNOCANCEL 0x0003
  2134. #define MB_YESNO 0x0004
  2135. #define MB_RETRYCANCEL 0x0005
  2136. #define MB_ICONHAND 0x0010
  2137. #define MB_ICONQUESTION 0x0020
  2138. #define MB_ICONEXCLAMATION 0x0030
  2139. #define MB_ICONASTERISK 0x0040
  2140. #define MB_ICONINFORMATION MB_ICONASTERISK
  2141. #define MB_ICONSTOP MB_ICONHAND
  2142. #define MB_DEFBUTTON1 0x0000
  2143. #define MB_DEFBUTTON2 0x0100
  2144. #define MB_DEFBUTTON3 0x0200
  2145. #define MB_APPLMODAL 0x0000
  2146. #define MB_SYSTEMMODAL 0x1000
  2147. #define MB_TASKMODAL 0x2000
  2148. #define MB_NOFOCUS 0x8000
  2149. #define MB_TYPEMASK 0x000F
  2150. #define MB_ICONMASK 0x00F0
  2151. #define MB_DEFMASK 0x0F00
  2152. #define MB_MODEMASK 0x3000
  2153. #define MB_MISCMASK 0xC000
  2154. int FAR PASCAL MessageBox(HWND, LPSTR, LPSTR, WORD);
  2155. void FAR PASCAL MessageBeep(WORD);
  2156. #endif /* NOMB */
  2157. int FAR PASCAL ShowCursor(BOOL);
  2158. void FAR PASCAL SetCursorPos(int, int);
  2159. HCURSOR FAR PASCAL SetCursor(HCURSOR);
  2160. void FAR PASCAL GetCursorPos(LPPOINT);
  2161. void FAR PASCAL ClipCursor(LPRECT);
  2162. void FAR PASCAL CreateCaret(HWND, HBITMAP, int, int);
  2163. WORD FAR PASCAL GetCaretBlinkTime(void);
  2164. void FAR PASCAL SetCaretBlinkTime(WORD);
  2165. void FAR PASCAL DestroyCaret(void);
  2166. void FAR PASCAL HideCaret(HWND);
  2167. void FAR PASCAL ShowCaret(HWND);
  2168. void FAR PASCAL SetCaretPos(int, int);
  2169. void FAR PASCAL GetCaretPos(LPPOINT);
  2170. void FAR PASCAL ClientToScreen(HWND, LPPOINT);
  2171. void FAR PASCAL ScreenToClient(HWND, LPPOINT);
  2172. HWND FAR PASCAL WindowFromPoint(POINT);
  2173. HWND FAR PASCAL ChildWindowFromPoint(HWND, POINT);
  2174. #ifndef NOCOLOR
  2175. /* Color Types */
  2176. #define CTLCOLOR_MSGBOX 0
  2177. #define CTLCOLOR_EDIT 1
  2178. #define CTLCOLOR_LISTBOX 2
  2179. #define CTLCOLOR_BTN 3
  2180. #define CTLCOLOR_DLG 4
  2181. #define CTLCOLOR_SCROLLBAR 5
  2182. #define CTLCOLOR_STATIC 6
  2183. #define CTLCOLOR_MAX 8 /* three bits max */
  2184. #define COLOR_SCROLLBAR 0
  2185. #define COLOR_BACKGROUND 1
  2186. #define COLOR_ACTIVECAPTION 2
  2187. #define COLOR_INACTIVECAPTION 3
  2188. #define COLOR_MENU 4
  2189. #define COLOR_WINDOW 5
  2190. #define COLOR_WINDOWFRAME 6
  2191. #define COLOR_MENUTEXT 7
  2192. #define COLOR_WINDOWTEXT 8
  2193. #define COLOR_CAPTIONTEXT 9
  2194. #define COLOR_ACTIVEBORDER 10
  2195. #define COLOR_INACTIVEBORDER 11
  2196. #define COLOR_APPWORKSPACE 12
  2197. #define COLOR_HIGHLIGHT 13
  2198. #define COLOR_HIGHLIGHTTEXT 14
  2199. #define COLOR_BTNFACE 15
  2200. #define COLOR_BTNSHADOW 16
  2201. #define COLOR_GRAYTEXT 17
  2202. #define COLOR_BTNTEXT 18
  2203. #define COLOR_ENDCOLORS COLOR_BTNTEXT
  2204. DWORD FAR PASCAL GetSysColor(int);
  2205. void FAR PASCAL SetSysColors(int, LPINT, LONG FAR *);
  2206. #endif /* NOCOLOR */
  2207. BOOL FAR PASCAL FillRgn(HDC, HRGN, HBRUSH);
  2208. BOOL FAR PASCAL FrameRgn(HDC, HRGN, HBRUSH, int, int);
  2209. BOOL FAR PASCAL InvertRgn(HDC, HRGN);
  2210. BOOL FAR PASCAL PaintRgn(HDC, HRGN);
  2211. BOOL FAR PASCAL PtInRegion(HRGN, int, int);
  2212. void FAR PASCAL DrawFocusRect(HDC, LPRECT);
  2213. int FAR PASCAL FillRect(HDC, LPRECT, HBRUSH);
  2214. int FAR PASCAL FrameRect(HDC, LPRECT, HBRUSH);
  2215. void FAR PASCAL InvertRect(HDC, LPRECT);
  2216. void FAR PASCAL SetRect(LPRECT, int, int, int, int);
  2217. void FAR PASCAL SetRectEmpty(LPRECT);
  2218. int FAR PASCAL CopyRect(LPRECT, LPRECT);
  2219. void FAR PASCAL InflateRect(LPRECT, int, int);
  2220. int FAR PASCAL IntersectRect(LPRECT, LPRECT, LPRECT);
  2221. int FAR PASCAL UnionRect(LPRECT, LPRECT, LPRECT);
  2222. void FAR PASCAL OffsetRect(LPRECT, int, int);
  2223. BOOL FAR PASCAL IsRectEmpty(LPRECT);
  2224. BOOL FAR PASCAL EqualRect(LPRECT, LPRECT);
  2225. BOOL FAR PASCAL PtInRect(LPRECT, POINT);
  2226. BOOL FAR PASCAL RectVisible(HDC, LPRECT);
  2227. BOOL FAR PASCAL RectInRegion(HRGN, LPRECT);
  2228. DWORD FAR PASCAL GetCurrentTime(void);
  2229. DWORD FAR PASCAL GetTickCount(void);
  2230. #ifndef NOWINOFFSETS
  2231. WORD FAR PASCAL GetWindowWord(HWND, int);
  2232. WORD FAR PASCAL SetWindowWord(HWND, int, WORD);
  2233. LONG FAR PASCAL GetWindowLong(HWND, int);
  2234. LONG FAR PASCAL SetWindowLong(HWND, int, LONG);
  2235. WORD FAR PASCAL GetClassWord(HWND, int);
  2236. WORD FAR PASCAL SetClassWord(HWND, int, WORD);
  2237. LONG FAR PASCAL GetClassLong(HWND, int);
  2238. LONG FAR PASCAL SetClassLong(HWND, int, LONG);
  2239. HWND FAR PASCAL GetDesktopHwnd(void);
  2240. HWND FAR PASCAL GetDesktopWindow(void);
  2241. #endif /* NOWINOFFSETS */
  2242. HWND FAR PASCAL GetParent(HWND);
  2243. HWND FAR PASCAL SetParent(HWND, HWND);
  2244. BOOL FAR PASCAL EnumChildWindows(HWND, FARPROC, LONG);
  2245. HWND FAR PASCAL FindWindow(LPSTR, LPSTR);
  2246. BOOL FAR PASCAL EnumWindows(FARPROC, LONG);
  2247. BOOL FAR PASCAL EnumTaskWindows(HANDLE, FARPROC, LONG);
  2248. int FAR PASCAL GetClassName(HWND, LPSTR, int);
  2249. HWND FAR PASCAL GetTopWindow(HWND);
  2250. HWND FAR PASCAL GetNextWindow(HWND, WORD);
  2251. HANDLE FAR PASCAL GetWindowTask(HWND);
  2252. HWND FAR PASCAL GetLastActivePopup(HWND);
  2253. /* GetWindow() Constants */
  2254. #define GW_HWNDFIRST 0
  2255. #define GW_HWNDLAST 1
  2256. #define GW_HWNDNEXT 2
  2257. #define GW_HWNDPREV 3
  2258. #define GW_OWNER 4
  2259. #define GW_CHILD 5
  2260. HWND FAR PASCAL GetWindow(HWND, WORD);
  2261. #ifndef NOWH
  2262. FARPROC FAR PASCAL SetWindowsHook(int, FARPROC);
  2263. BOOL FAR PASCAL UnhookWindowsHook(int, FARPROC);
  2264. DWORD FAR PASCAL DefHookProc(int, WORD, DWORD, FARPROC FAR *);
  2265. #endif
  2266. #ifndef NOMENUS
  2267. /* Menu flags for Add/Check/EnableMenuItem() */
  2268. #define MF_INSERT 0x0000
  2269. #define MF_CHANGE 0x0080
  2270. #define MF_APPEND 0x0100
  2271. #define MF_DELETE 0x0200
  2272. #define MF_REMOVE 0x1000
  2273. #define MF_BYCOMMAND 0x0000
  2274. #define MF_BYPOSITION 0x0400
  2275. #define MF_SEPARATOR 0x0800
  2276. #define MF_ENABLED 0x0000
  2277. #define MF_GRAYED 0x0001
  2278. #define MF_DISABLED 0x0002
  2279. #define MF_UNCHECKED 0x0000
  2280. #define MF_CHECKED 0x0008
  2281. #define MF_USECHECKBITMAPS 0x0200
  2282. #define MF_STRING 0x0000
  2283. #define MF_BITMAP 0x0004
  2284. #define MF_OWNERDRAW 0x0100
  2285. #define MF_POPUP 0x0010
  2286. #define MF_MENUBARBREAK 0x0020
  2287. #define MF_MENUBREAK 0x0040
  2288. #define MF_UNHILITE 0x0000
  2289. #define MF_HILITE 0x0080
  2290. #define MF_SYSMENU 0x2000
  2291. #define MF_HELP 0x4000
  2292. #define MF_MOUSESELECT 0x8000
  2293. /* Menu item resource format */
  2294. typedef struct
  2295. {
  2296. WORD versionNumber;
  2297. WORD offset;
  2298. } MENUITEMTEMPLATEHEADER;
  2299. typedef struct
  2300. {
  2301. WORD mtOption;
  2302. WORD mtID;
  2303. char mtString[1];
  2304. } MENUITEMTEMPLATE;
  2305. #define MF_END 0x0080
  2306. #endif /* NOMENUS */
  2307. #ifndef NOSYSCOMMANDS
  2308. /* System Menu Command Values */
  2309. #define SC_SIZE 0xF000
  2310. #define SC_MOVE 0xF010
  2311. #define SC_MINIMIZE 0xF020
  2312. #define SC_MAXIMIZE 0xF030
  2313. #define SC_NEXTWINDOW 0xF040
  2314. #define SC_PREVWINDOW 0xF050
  2315. #define SC_CLOSE 0xF060
  2316. #define SC_VSCROLL 0xF070
  2317. #define SC_HSCROLL 0xF080
  2318. #define SC_MOUSEMENU 0xF090
  2319. #define SC_KEYMENU 0xF100
  2320. #define SC_ARRANGE 0xF110
  2321. #define SC_RESTORE 0xF120
  2322. #define SC_TASKLIST 0xF130
  2323. #define SC_ICON SC_MINIMIZE
  2324. #define SC_ZOOM SC_MAXIMIZE
  2325. #endif /* NOSYSCOMMANDS */
  2326. /* Resource Loading Routines */
  2327. HBITMAP FAR PASCAL LoadBitmap(HANDLE, LPSTR);
  2328. HCURSOR FAR PASCAL LoadCursor(HANDLE, LPSTR);
  2329. HCURSOR FAR PASCAL CreateCursor(HANDLE, int, int, int, int, LPSTR, LPSTR);
  2330. BOOL FAR PASCAL DestroyCursor(HCURSOR);
  2331. /* Standard Cursor IDs */
  2332. #define IDC_ARROW MAKEINTRESOURCE(32512)
  2333. #define IDC_IBEAM MAKEINTRESOURCE(32513)
  2334. #define IDC_WAIT MAKEINTRESOURCE(32514)
  2335. #define IDC_CROSS MAKEINTRESOURCE(32515)
  2336. #define IDC_UPARROW MAKEINTRESOURCE(32516)
  2337. #define IDC_SIZE MAKEINTRESOURCE(32640)
  2338. #define IDC_ICON MAKEINTRESOURCE(32641)
  2339. #define IDC_SIZENWSE MAKEINTRESOURCE(32642)
  2340. #define IDC_SIZENESW MAKEINTRESOURCE(32643)
  2341. #define IDC_SIZEWE MAKEINTRESOURCE(32644)
  2342. #define IDC_SIZENS MAKEINTRESOURCE(32645)
  2343. HICON FAR PASCAL LoadIcon(HANDLE, LPSTR);
  2344. HICON FAR PASCAL CreateIcon(HANDLE, int, int, BYTE, BYTE, LPSTR, LPSTR);
  2345. BOOL FAR PASCAL DestroyIcon(HICON);
  2346. #define ORD_LANGDRIVER 1 /* The ordinal number for the entry point of
  2347. ** language drivers.
  2348. */
  2349. #ifndef NOICONS
  2350. /* Standard Icon IDs */
  2351. #define IDI_APPLICATION MAKEINTRESOURCE(32512)
  2352. #define IDI_HAND MAKEINTRESOURCE(32513)
  2353. #define IDI_QUESTION MAKEINTRESOURCE(32514)
  2354. #define IDI_EXCLAMATION MAKEINTRESOURCE(32515)
  2355. #define IDI_ASTERISK MAKEINTRESOURCE(32516)
  2356. #endif /* NOICONS */
  2357. int FAR PASCAL LoadString(HANDLE, WORD, LPSTR, int);
  2358. int FAR PASCAL AddFontResource(LPSTR);
  2359. BOOL FAR PASCAL RemoveFontResource(LPSTR);
  2360. #ifndef NOKANJI
  2361. #define CP_HWND 0
  2362. #define CP_OPEN 1
  2363. #define CP_DIRECT 2
  2364. /* VK from the keyboard driver */
  2365. #define VK_KANA 0x15
  2366. #define VK_ROMAJI 0x16
  2367. #define VK_ZENKAKU 0x17
  2368. #define VK_HIRAGANA 0x18
  2369. #define VK_KANJI 0x19
  2370. /* VK to send to Applications */
  2371. #define VK_CONVERT 0x1C
  2372. #define VK_NONCONVERT 0x1D
  2373. #define VK_ACCEPT 0x1E
  2374. #define VK_MODECHANGE 0x1F
  2375. /* Conversion function numbers */
  2376. #define KNJ_START 0x01
  2377. #define KNJ_END 0x02
  2378. #define KNJ_QUERY 0x03
  2379. #define KNJ_LEARN_MODE 0x10
  2380. #define KNJ_GETMODE 0x11
  2381. #define KNJ_SETMODE 0x12
  2382. #define KNJ_CODECONVERT 0x20
  2383. #define KNJ_CONVERT 0x21
  2384. #define KNJ_NEXT 0x22
  2385. #define KNJ_PREVIOUS 0x23
  2386. #define KNJ_ACCEPT 0x24
  2387. #define KNJ_LEARN 0x30
  2388. #define KNJ_REGISTER 0x31
  2389. #define KNJ_REMOVE 0x32
  2390. #define KNJ_CHANGE_UDIC 0x33
  2391. /* NOTE: DEFAULT = 0
  2392. * JIS1 = 1
  2393. * JIS2 = 2
  2394. * SJIS2 = 3
  2395. * JIS1KATAKANA = 4
  2396. * SJIS2HIRAGANA = 5
  2397. * SJIS2KATAKANA = 6
  2398. * OEM = F
  2399. */
  2400. #define KNJ_JIS1toJIS1KATAKANA 0x14
  2401. #define KNJ_JIS1toSJIS2 0x13
  2402. #define KNJ_JIS1toSJIS2HIRAGANA 0x15
  2403. #define KNJ_JIS1toSJIS2KATAKANA 0x16
  2404. #define KNJ_JIS1toDEFAULT 0x10
  2405. #define KNJ_JIS1toSJIS2OEM 0x1F
  2406. #define KNJ_JIS2toSJIS2 0x23
  2407. #define KNJ_SJIS2toJIS2 0x32
  2408. #define KNJ_MD_ALPHA 0x01
  2409. #define KNJ_MD_HIRAGANA 0x02
  2410. #define KNJ_MD_HALF 0x04
  2411. #define KNJ_MD_JIS 0x08
  2412. #define KNJ_MD_SPECIAL 0x10
  2413. #define KNJ_CVT_NEXT 0x01
  2414. #define KNJ_CVT_PREV 0x02
  2415. #define KNJ_CVT_KATAKANA 0x03
  2416. #define KNJ_CVT_HIRAGANA 0x04
  2417. #define KNJ_CVT_JIS1 0x05
  2418. #define KNJ_CVT_SJIS2 0x06
  2419. #define KNJ_CVT_DEFAULT 0x07
  2420. #define KNJ_CVT_TYPED 0x08
  2421. typedef struct
  2422. {
  2423. int fnc;
  2424. int wParam;
  2425. LPSTR lpSource;
  2426. LPSTR lpDest;
  2427. int wCount;
  2428. LPSTR lpReserved1;
  2429. LPSTR lpReserved2;
  2430. } KANJISTRUCT, FAR *LPKANJISTRUCT;
  2431. int FAR PASCAL ConvertRequest(HWND, LPKANJISTRUCT);
  2432. BOOL FAR PASCAL SetConvertParams(int, int);
  2433. VOID FAR PASCAL SetConvertHook(BOOL);
  2434. #endif
  2435. /* Key Conversion Window */
  2436. BOOL FAR PASCAL IsTwoByteCharPrefix(char);
  2437. /* Dialog Box Command IDs */
  2438. #define IDOK 1
  2439. #define IDCANCEL 2
  2440. #define IDABORT 3
  2441. #define IDRETRY 4
  2442. #define IDIGNORE 5
  2443. #define IDYES 6
  2444. #define IDNO 7
  2445. #ifndef NOCTLMGR
  2446. /* Control Manager Structures and Definitions */
  2447. #ifndef NOWINSTYLES
  2448. /* Edit Control Styles */
  2449. #define ES_LEFT 0x0000L
  2450. #define ES_CENTER 0x0001L
  2451. #define ES_RIGHT 0x0002L
  2452. #define ES_MULTILINE 0x0004L
  2453. #define ES_UPPERCASE 0x0008L
  2454. #define ES_LOWERCASE 0x0010L
  2455. #define ES_PASSWORD 0x0020L
  2456. #define ES_AUTOVSCROLL 0x0040L
  2457. #define ES_AUTOHSCROLL 0x0080L
  2458. #define ES_NOHIDESEL 0x0100L
  2459. #define ES_OEMCONVERT 0x0400L
  2460. #endif /* NOWINSTYLES */
  2461. /* Edit Control Notification Codes */
  2462. #define EN_SETFOCUS 0x0100
  2463. #define EN_KILLFOCUS 0x0200
  2464. #define EN_CHANGE 0x0300
  2465. #define EN_UPDATE 0x0400
  2466. #define EN_ERRSPACE 0x0500
  2467. #define EN_MAXTEXT 0x0501
  2468. #define EN_HSCROLL 0x0601
  2469. #define EN_VSCROLL 0x0602
  2470. #ifndef NOWINMESSAGES
  2471. /* Edit Control Messages */
  2472. #define EM_GETSEL (WM_USER+0)
  2473. #define EM_SETSEL (WM_USER+1)
  2474. #define EM_GETRECT (WM_USER+2)
  2475. #define EM_SETRECT (WM_USER+3)
  2476. #define EM_SETRECTNP (WM_USER+4)
  2477. #define EM_SCROLL (WM_USER+5)
  2478. #define EM_LINESCROLL (WM_USER+6)
  2479. #define EM_GETMODIFY (WM_USER+8)
  2480. #define EM_SETMODIFY (WM_USER+9)
  2481. #define EM_GETLINECOUNT (WM_USER+10)
  2482. #define EM_LINEINDEX (WM_USER+11)
  2483. #define EM_SETHANDLE (WM_USER+12)
  2484. #define EM_GETHANDLE (WM_USER+13)
  2485. #define EM_GETTHUMB (WM_USER+14)
  2486. #define EM_LINELENGTH (WM_USER+17)
  2487. #define EM_REPLACESEL (WM_USER+18)
  2488. #define EM_SETFONT (WM_USER+19)
  2489. #define EM_GETLINE (WM_USER+20)
  2490. #define EM_LIMITTEXT (WM_USER+21)
  2491. #define EM_CANUNDO (WM_USER+22)
  2492. #define EM_UNDO (WM_USER+23)
  2493. #define EM_FMTLINES (WM_USER+24)
  2494. #define EM_LINEFROMCHAR (WM_USER+25)
  2495. #define EM_SETWORDBREAK (WM_USER+26)
  2496. #define EM_SETTABSTOPS (WM_USER+27)
  2497. #define EM_SETPASSWORDCHAR (WM_USER+28)
  2498. #define EM_EMPTYUNDOBUFFER (WM_USER+29)
  2499. #define EM_MSGMAX (WM_USER+30)
  2500. #endif /* NOWINMESSAGES */
  2501. /* Button Control Styles */
  2502. #define BS_PUSHBUTTON 0x00L
  2503. #define BS_DEFPUSHBUTTON 0x01L
  2504. #define BS_CHECKBOX 0x02L
  2505. #define BS_AUTOCHECKBOX 0x03L
  2506. #define BS_RADIOBUTTON 0x04L
  2507. #define BS_3STATE 0x05L
  2508. #define BS_AUTO3STATE 0x06L
  2509. #define BS_GROUPBOX 0x07L
  2510. #define BS_USERBUTTON 0x08L
  2511. #define BS_AUTORADIOBUTTON 0x09L
  2512. #define BS_PUSHBOX 0x0AL
  2513. #define BS_OWNERDRAW 0x0BL
  2514. #define BS_LEFTTEXT 0x20L
  2515. /* User Button Notification Codes */
  2516. #define BN_CLICKED 0
  2517. #define BN_PAINT 1
  2518. #define BN_HILITE 2
  2519. #define BN_UNHILITE 3
  2520. #define BN_DISABLE 4
  2521. #define BN_DOUBLECLICKED 5
  2522. /* Button Control Messages */
  2523. #define BM_GETCHECK (WM_USER+0)
  2524. #define BM_SETCHECK (WM_USER+1)
  2525. #define BM_GETSTATE (WM_USER+2)
  2526. #define BM_SETSTATE (WM_USER+3)
  2527. #define BM_SETSTYLE (WM_USER+4)
  2528. /* Static Control Constants */
  2529. #define SS_LEFT 0x00L
  2530. #define SS_CENTER 0x01L
  2531. #define SS_RIGHT 0x02L
  2532. #define SS_ICON 0x03L
  2533. #define SS_BLACKRECT 0x04L
  2534. #define SS_GRAYRECT 0x05L
  2535. #define SS_WHITERECT 0x06L
  2536. #define SS_BLACKFRAME 0x07L
  2537. #define SS_GRAYFRAME 0x08L
  2538. #define SS_WHITEFRAME 0x09L
  2539. #define SS_USERITEM 0x0AL
  2540. #define SS_SIMPLE 0x0BL
  2541. #define SS_LEFTNOWORDWRAP 0x0CL
  2542. #define SS_NOPREFIX 0x80L /* Don't do "&" character translation */
  2543. /* Dialog Manager Routines */
  2544. #ifndef NOMSG
  2545. BOOL FAR PASCAL IsDialogMessage(HWND, LPMSG);
  2546. #endif
  2547. void FAR PASCAL MapDialogRect(HWND, LPRECT);
  2548. int FAR PASCAL DlgDirList(HWND, LPSTR, int, int, WORD);
  2549. BOOL FAR PASCAL DlgDirSelect(HWND, LPSTR, int);
  2550. int FAR PASCAL DlgDirListComboBox(HWND, LPSTR, int, int, WORD);
  2551. BOOL FAR PASCAL DlgDirSelectComboBox(HWND, LPSTR, int);
  2552. /* Dialog Styles */
  2553. #define DS_ABSALIGN 0x01L
  2554. #define DS_SYSMODAL 0x02L
  2555. #define DS_LOCALEDIT 0x20L /* Edit items get Local storage. */
  2556. #define DS_SETFONT 0x40L /* User specified font for Dlg controls */
  2557. #define DS_MODALFRAME 0x80L /* Can be combined with WS_CAPTION */
  2558. #define DS_NOIDLEMSG 0x100L /* WM_ENTERIDLE message will not be sent */
  2559. #define DM_GETDEFID (WM_USER+0)
  2560. #define DM_SETDEFID (WM_USER+1)
  2561. #define DC_HASDEFID 0x534B
  2562. /* Dialog Codes */
  2563. #define DLGC_WANTARROWS 0x0001 /* Control wants arrow keys */
  2564. #define DLGC_WANTTAB 0x0002 /* Control wants tab keys */
  2565. #define DLGC_WANTALLKEYS 0x0004 /* Control wants all keys */
  2566. #define DLGC_WANTMESSAGE 0x0004 /* Pass message to control */
  2567. #define DLGC_HASSETSEL 0x0008 /* Understands EM_SETSEL message */
  2568. #define DLGC_DEFPUSHBUTTON 0x0010 /* Default pushbutton */
  2569. #define DLGC_UNDEFPUSHBUTTON 0x0020 /* Non-default pushbutton */
  2570. #define DLGC_RADIOBUTTON 0x0040 /* Radio button */
  2571. #define DLGC_WANTCHARS 0x0080 /* Want WM_CHAR messages */
  2572. #define DLGC_STATIC 0x0100 /* Static item: don't include */
  2573. #define DLGC_BUTTON 0x2000 /* Button item: can be checked */
  2574. #define LB_CTLCODE 0L
  2575. /* Listbox Return Values */
  2576. #define LB_OKAY 0
  2577. #define LB_ERR (-1)
  2578. #define LB_ERRSPACE (-2)
  2579. /*
  2580. ** The idStaticPath parameter to DlgDirList can have the following values
  2581. ** ORed if the list box should show other details of the files along with
  2582. ** the name of the files;
  2583. */
  2584. /* all other details also will be returned */
  2585. /* Listbox Notification Codes */
  2586. #define LBN_ERRSPACE (-2)
  2587. #define LBN_SELCHANGE 1
  2588. #define LBN_DBLCLK 2
  2589. #define LBN_SELCANCEL 3
  2590. #define LBN_SETFOCUS 4
  2591. #define LBN_KILLFOCUS 5
  2592. #ifndef NOWINMESSAGES
  2593. /* Listbox messages */
  2594. #define LB_ADDSTRING (WM_USER+1)
  2595. #define LB_INSERTSTRING (WM_USER+2)
  2596. #define LB_DELETESTRING (WM_USER+3)
  2597. #define LB_RESETCONTENT (WM_USER+5)
  2598. #define LB_SETSEL (WM_USER+6)
  2599. #define LB_SETCURSEL (WM_USER+7)
  2600. #define LB_GETSEL (WM_USER+8)
  2601. #define LB_GETCURSEL (WM_USER+9)
  2602. #define LB_GETTEXT (WM_USER+10)
  2603. #define LB_GETTEXTLEN (WM_USER+11)
  2604. #define LB_GETCOUNT (WM_USER+12)
  2605. #define LB_SELECTSTRING (WM_USER+13)
  2606. #define LB_DIR (WM_USER+14)
  2607. #define LB_GETTOPINDEX (WM_USER+15)
  2608. #define LB_FINDSTRING (WM_USER+16)
  2609. #define LB_GETSELCOUNT (WM_USER+17)
  2610. #define LB_GETSELITEMS (WM_USER+18)
  2611. #define LB_SETTABSTOPS (WM_USER+19)
  2612. #define LB_GETHORIZONTALEXTENT (WM_USER+20)
  2613. #define LB_SETHORIZONTALEXTENT (WM_USER+21)
  2614. #define LB_SETCOLUMNWIDTH (WM_USER+22)
  2615. #define LB_SETTOPINDEX (WM_USER+24)
  2616. #define LB_GETITEMRECT (WM_USER+25)
  2617. #define LB_GETITEMDATA (WM_USER+26)
  2618. #define LB_SETITEMDATA (WM_USER+27)
  2619. #define LB_SELITEMRANGE (WM_USER+28)
  2620. #define LB_MSGMAX (WM_USER+33)
  2621. #endif /* NOWINMESSAGES */
  2622. #ifndef NOWINSTYLES
  2623. /* Listbox Styles */
  2624. #define LBS_NOTIFY 0x0001L
  2625. #define LBS_SORT 0x0002L
  2626. #define LBS_NOREDRAW 0x0004L
  2627. #define LBS_MULTIPLESEL 0x0008L
  2628. #define LBS_OWNERDRAWFIXED 0x0010L
  2629. #define LBS_OWNERDRAWVARIABLE 0x0020L
  2630. #define LBS_HASSTRINGS 0x0040L
  2631. #define LBS_USETABSTOPS 0x0080L
  2632. #define LBS_NOINTEGRALHEIGHT 0x0100L
  2633. #define LBS_MULTICOLUMN 0x0200L
  2634. #define LBS_WANTKEYBOARDINPUT 0x0400L
  2635. #define LBS_EXTENDEDSEL 0x0800L
  2636. #define LBS_STANDARD (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
  2637. #endif /* NOWINSTYLES */
  2638. /* Combo Box return Values */
  2639. #define CB_OKAY 0
  2640. #define CB_ERR (-1)
  2641. #define CB_ERRSPACE (-2)
  2642. /* Combo Box Notification Codes */
  2643. #define CBN_ERRSPACE (-1)
  2644. #define CBN_SELCHANGE 1
  2645. #define CBN_DBLCLK 2
  2646. #define CBN_SETFOCUS 3
  2647. #define CBN_KILLFOCUS 4
  2648. #define CBN_EDITCHANGE 5
  2649. #define CBN_EDITUPDATE 6
  2650. #define CBN_DROPDOWN 7
  2651. /* Combo Box styles */
  2652. #ifndef NOWINSTYLES
  2653. #define CBS_SIMPLE 0x0001L
  2654. #define CBS_DROPDOWN 0x0002L
  2655. #define CBS_DROPDOWNLIST 0x0003L
  2656. #define CBS_OWNERDRAWFIXED 0x0010L
  2657. #define CBS_OWNERDRAWVARIABLE 0x0020L
  2658. #define CBS_AUTOHSCROLL 0x0040L
  2659. #define CBS_OEMCONVERT 0x0080L
  2660. #define CBS_SORT 0x0100L
  2661. #define CBS_HASSTRINGS 0x0200L
  2662. #define CBS_NOINTEGRALHEIGHT 0x0400L
  2663. #endif /* NOWINSTYLES */
  2664. /* Combo Box messages */
  2665. #ifndef NOWINMESSAGES
  2666. #define CB_GETEDITSEL (WM_USER+0)
  2667. #define CB_LIMITTEXT (WM_USER+1)
  2668. #define CB_SETEDITSEL (WM_USER+2)
  2669. #define CB_ADDSTRING (WM_USER+3)
  2670. #define CB_DELETESTRING (WM_USER+4)
  2671. #define CB_DIR (WM_USER+5)
  2672. #define CB_GETCOUNT (WM_USER+6)
  2673. #define CB_GETCURSEL (WM_USER+7)
  2674. #define CB_GETLBTEXT (WM_USER+8)
  2675. #define CB_GETLBTEXTLEN (WM_USER+9)
  2676. #define CB_INSERTSTRING (WM_USER+10)
  2677. #define CB_RESETCONTENT (WM_USER+11)
  2678. #define CB_FINDSTRING (WM_USER+12)
  2679. #define CB_SELECTSTRING (WM_USER+13)
  2680. #define CB_SETCURSEL (WM_USER+14)
  2681. #define CB_SHOWDROPDOWN (WM_USER+15)
  2682. #define CB_GETITEMDATA (WM_USER+16)
  2683. #define CB_SETITEMDATA (WM_USER+17)
  2684. #define CB_GETDROPPEDCONTROLRECT (WM_USER+18)
  2685. #define CB_MSGMAX (WM_USER+19)
  2686. #endif /* NOWINMESSAGES */
  2687. #ifndef NOWINSTYLES
  2688. /* Scroll Bar Styles */
  2689. #define SBS_HORZ 0x0000L
  2690. #define SBS_VERT 0x0001L
  2691. #define SBS_TOPALIGN 0x0002L
  2692. #define SBS_LEFTALIGN 0x0002L
  2693. #define SBS_BOTTOMALIGN 0x0004L
  2694. #define SBS_RIGHTALIGN 0x0004L
  2695. #define SBS_SIZEBOXTOPLEFTALIGN 0x0002L
  2696. #define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
  2697. #define SBS_SIZEBOX 0x0008L
  2698. #endif /* NOWINSTYLES */
  2699. #endif /* NOCTLMGR */
  2700. #ifndef NOSOUND
  2701. int FAR PASCAL OpenSound(void);
  2702. void FAR PASCAL CloseSound(void);
  2703. int FAR PASCAL SetVoiceQueueSize(int, int);
  2704. int FAR PASCAL SetVoiceNote(int, int, int, int);
  2705. int FAR PASCAL SetVoiceAccent(int, int, int, int, int);
  2706. int FAR PASCAL SetVoiceEnvelope(int, int, int);
  2707. int FAR PASCAL SetSoundNoise(int, int);
  2708. int FAR PASCAL SetVoiceSound(int, LONG, int);
  2709. int FAR PASCAL StartSound(void);
  2710. int FAR PASCAL StopSound(void);
  2711. int FAR PASCAL WaitSoundState(int);
  2712. int FAR PASCAL SyncAllVoices(void);
  2713. int FAR PASCAL CountVoiceNotes(int);
  2714. LPINT FAR PASCAL GetThresholdEvent(void);
  2715. int FAR PASCAL GetThresholdStatus(void);
  2716. int FAR PASCAL SetVoiceThreshold(int, int);
  2717. /* WaitSoundState() Constants */
  2718. #define S_QUEUEEMPTY 0
  2719. #define S_THRESHOLD 1
  2720. #define S_ALLTHRESHOLD 2
  2721. /* Accent Modes */
  2722. #define S_NORMAL 0
  2723. #define S_LEGATO 1
  2724. #define S_STACCATO 2
  2725. /* SetSoundNoise() Sources */
  2726. #define S_PERIOD512 0 /* Freq = N/512 high pitch, less coarse hiss */
  2727. #define S_PERIOD1024 1 /* Freq = N/1024 */
  2728. #define S_PERIOD2048 2 /* Freq = N/2048 low pitch, more coarse hiss */
  2729. #define S_PERIODVOICE 3 /* Source is frequency from voice channel (3) */
  2730. #define S_WHITE512 4 /* Freq = N/512 high pitch, less coarse hiss */
  2731. #define S_WHITE1024 5 /* Freq = N/1024 */
  2732. #define S_WHITE2048 6 /* Freq = N/2048 low pitch, more coarse hiss */
  2733. #define S_WHITEVOICE 7 /* Source is frequency from voice channel (3) */
  2734. #define S_SERDVNA (-1) /* Device not available */
  2735. #define S_SEROFM (-2) /* Out of memory */
  2736. #define S_SERMACT (-3) /* Music active */
  2737. #define S_SERQFUL (-4) /* Queue full */
  2738. #define S_SERBDNT (-5) /* Invalid note */
  2739. #define S_SERDLN (-6) /* Invalid note length */
  2740. #define S_SERDCC (-7) /* Invalid note count */
  2741. #define S_SERDTP (-8) /* Invalid tempo */
  2742. #define S_SERDVL (-9) /* Invalid volume */
  2743. #define S_SERDMD (-10) /* Invalid mode */
  2744. #define S_SERDSH (-11) /* Invalid shape */
  2745. #define S_SERDPT (-12) /* Invalid pitch */
  2746. #define S_SERDFQ (-13) /* Invalid frequency */
  2747. #define S_SERDDR (-14) /* Invalid duration */
  2748. #define S_SERDSR (-15) /* Invalid source */
  2749. #define S_SERDST (-16) /* Invalid state */
  2750. #endif /* NOSOUND */
  2751. #ifndef NOCOMM
  2752. #define NOPARITY 0
  2753. #define ODDPARITY 1
  2754. #define EVENPARITY 2
  2755. #define MARKPARITY 3
  2756. #define SPACEPARITY 4
  2757. #define ONESTOPBIT 0
  2758. #define ONE5STOPBITS 1
  2759. #define TWOSTOPBITS 2
  2760. #define IGNORE 0 /* Ignore signal */
  2761. #define INFINITE 0xFFFF /* Infinite timeout */
  2762. /* Error Flags */
  2763. #define CE_RXOVER 0x0001 /* Receive Queue overflow */
  2764. #define CE_OVERRUN 0x0002 /* Receive Overrun Error */
  2765. #define CE_RXPARITY 0x0004 /* Receive Parity Error */
  2766. #define CE_FRAME 0x0008 /* Receive Framing error */
  2767. #define CE_BREAK 0x0010 /* Break Detected */
  2768. #define CE_CTSTO 0x0020 /* CTS Timeout */
  2769. #define CE_DSRTO 0x0040 /* DSR Timeout */
  2770. #define CE_RLSDTO 0x0080 /* RLSD Timeout */
  2771. #define CE_TXFULL 0x0100 /* TX Queue is full */
  2772. #define CE_PTO 0x0200 /* LPTx Timeout */
  2773. #define CE_IOE 0x0400 /* LPTx I/O Error */
  2774. #define CE_DNS 0x0800 /* LPTx Device not selected */
  2775. #define CE_OOP 0x1000 /* LPTx Out-Of-Paper */
  2776. #define CE_MODE 0x8000 /* Requested mode unsupported */
  2777. #define IE_BADID (-1) /* Invalid or unsupported id */
  2778. #define IE_OPEN (-2) /* Device Already Open */
  2779. #define IE_NOPEN (-3) /* Device Not Open */
  2780. #define IE_MEMORY (-4) /* Unable to allocate queues */
  2781. #define IE_DEFAULT (-5) /* Error in default parameters */
  2782. #define IE_HARDWARE (-10) /* Hardware Not Present */
  2783. #define IE_BYTESIZE (-11) /* Illegal Byte Size */
  2784. #define IE_BAUDRATE (-12) /* Unsupported BaudRate */
  2785. /* Events */
  2786. #define EV_RXCHAR 0x0001 /* Any Character received */
  2787. #define EV_RXFLAG 0x0002 /* Received certain character */
  2788. #define EV_TXEMPTY 0x0004 /* Transmitt Queue Empty */
  2789. #define EV_CTS 0x0008 /* CTS changed state */
  2790. #define EV_DSR 0x0010 /* DSR changed state */
  2791. #define EV_RLSD 0x0020 /* RLSD changed state */
  2792. #define EV_BREAK 0x0040 /* BREAK received */
  2793. #define EV_ERR 0x0080 /* Line status error occurred */
  2794. #define EV_RING 0x0100 /* Ring signal detected */
  2795. #define EV_PERR 0x0200 /* Printer error occured */
  2796. /* Escape Functions */
  2797. #define SETXOFF 1 /* Simulate XOFF received */
  2798. #define SETXON 2 /* Simulate XON received */
  2799. #define SETRTS 3 /* Set RTS high */
  2800. #define CLRRTS 4 /* Set RTS low */
  2801. #define SETDTR 5 /* Set DTR high */
  2802. #define CLRDTR 6 /* Set DTR low */
  2803. #define RESETDEV 7 /* Reset device if possible */
  2804. #define LPTx 0x80 /* Set if ID is for LPT device */
  2805. typedef struct tagDCB
  2806. {
  2807. BYTE Id; /* Internal Device ID */
  2808. WORD BaudRate; /* Baudrate at which runing */
  2809. BYTE ByteSize; /* Number of bits/byte, 4-8 */
  2810. BYTE Parity; /* 0-4=None,Odd,Even,Mark,Space */
  2811. BYTE StopBits; /* 0,1,2 = 1, 1.5, 2 */
  2812. WORD RlsTimeout; /* Timeout for RLSD to be set */
  2813. WORD CtsTimeout; /* Timeout for CTS to be set */
  2814. WORD DsrTimeout; /* Timeout for DSR to be set */
  2815. BYTE fBinary: 1; /* Binary Mode (skip EOF check */
  2816. BYTE fRtsDisable:1; /* Don't assert RTS at init time */
  2817. BYTE fParity: 1; /* Enable parity checking */
  2818. BYTE fOutxCtsFlow:1; /* CTS handshaking on output */
  2819. BYTE fOutxDsrFlow:1; /* DSR handshaking on output */
  2820. BYTE fDummy: 2; /* Reserved */
  2821. BYTE fDtrDisable:1; /* Don't assert DTR at init time */
  2822. BYTE fOutX: 1; /* Enable output X-ON/X-OFF */
  2823. BYTE fInX: 1; /* Enable input X-ON/X-OFF */
  2824. BYTE fPeChar: 1; /* Enable Parity Err Replacement */
  2825. BYTE fNull: 1; /* Enable Null stripping */
  2826. BYTE fChEvt: 1; /* Enable Rx character event. */
  2827. BYTE fDtrflow: 1; /* DTR handshake on input */
  2828. BYTE fRtsflow: 1; /* RTS handshake on input */
  2829. BYTE fDummy2: 1;
  2830. char XonChar; /* Tx and Rx X-ON character */
  2831. char XoffChar; /* Tx and Rx X-OFF character */
  2832. WORD XonLim; /* Transmit X-ON threshold */
  2833. WORD XoffLim; /* Transmit X-OFF threshold */
  2834. char PeChar; /* Parity error replacement char */
  2835. char EofChar; /* End of Input character */
  2836. char EvtChar; /* Recieved Event character */
  2837. WORD TxDelay; /* Amount of time between chars */
  2838. } DCB;
  2839. typedef struct tagCOMSTAT
  2840. {
  2841. BYTE fCtsHold: 1; /* Transmit is on CTS hold */
  2842. BYTE fDsrHold: 1; /* Transmit is on DSR hold */
  2843. BYTE fRlsdHold: 1; /* Transmit is on RLSD hold */
  2844. BYTE fXoffHold: 1; /* Received handshake */
  2845. BYTE fXoffSent: 1; /* Issued handshake */
  2846. BYTE fEof: 1; /* End of file character found */
  2847. BYTE fTxim: 1; /* Character being transmitted */
  2848. WORD cbInQue; /* count of characters in Rx Queue */
  2849. WORD cbOutQue; /* count of characters in Tx Queue */
  2850. } COMSTAT;
  2851. int FAR PASCAL OpenComm(LPSTR, WORD, WORD);
  2852. int FAR PASCAL SetCommState(DCB FAR *);
  2853. int FAR PASCAL GetCommState(int, DCB FAR *);
  2854. int FAR PASCAL ReadComm(int, LPSTR, int);
  2855. int FAR PASCAL UngetCommChar(int, char);
  2856. int FAR PASCAL WriteComm(int, LPSTR, int);
  2857. int FAR PASCAL CloseComm(int);
  2858. int FAR PASCAL GetCommError(int, COMSTAT FAR *);
  2859. int FAR PASCAL BuildCommDCB(LPSTR, DCB FAR *);
  2860. int FAR PASCAL TransmitCommChar(int, char);
  2861. WORD FAR * FAR PASCAL SetCommEventMask(int, WORD);
  2862. WORD FAR PASCAL GetCommEventMask(int, int);
  2863. int FAR PASCAL SetCommBreak(int);
  2864. int FAR PASCAL ClearCommBreak(int);
  2865. int FAR PASCAL FlushComm(int, int);
  2866. int FAR PASCAL EscapeCommFunction(int, int);
  2867. #endif /* NOCOMM */
  2868. #ifndef NOMDI
  2869. typedef struct tagMDICREATESTRUCT
  2870. {
  2871. LPSTR szClass;
  2872. LPSTR szTitle;
  2873. HANDLE hOwner;
  2874. int x,y;
  2875. int cx,cy;
  2876. LONG style;
  2877. LONG lParam; /* app-defined stuff */
  2878. } MDICREATESTRUCT;
  2879. typedef MDICREATESTRUCT FAR * LPMDICREATESTRUCT;
  2880. typedef struct tagCLIENTCREATESTRUCT
  2881. {
  2882. HANDLE hWindowMenu;
  2883. WORD idFirstChild;
  2884. } CLIENTCREATESTRUCT;
  2885. typedef CLIENTCREATESTRUCT FAR * LPCLIENTCREATESTRUCT;
  2886. LONG FAR PASCAL DefFrameProc(HWND,HWND,WORD,WORD,LONG);
  2887. LONG FAR PASCAL DefMDIChildProc(HWND,WORD,WORD,LONG);
  2888. #ifndef NOMSG
  2889. BOOL FAR PASCAL TranslateMDISysAccel(HWND,LPMSG);
  2890. #endif
  2891. WORD FAR PASCAL ArrangeIconicWindows(HWND);
  2892. #endif /* NOMDI */
  2893. #endif /* NOUSER */
  2894. #ifndef NOHELP
  2895. /* Help engine section. */
  2896. /* Commands to pass WinHelp() */
  2897. #define HELP_CONTEXT 0x0001 /* Display topic in ulTopic */
  2898. #define HELP_QUIT 0x0002 /* Terminate help */
  2899. #define HELP_INDEX 0x0003 /* Display index */
  2900. #define HELP_HELPONHELP 0x0004 /* Display help on using help */
  2901. #define HELP_SETINDEX 0x0005 /* Set the current Index for multi index help */
  2902. #define HELP_KEY 0x0101 /* Display topic for keyword in offabData */
  2903. #define HELP_MULTIKEY 0x0201
  2904. BOOL FAR PASCAL WinHelp(HWND hwndMain, LPSTR lpszHelp, WORD usCommand, DWORD ulData);
  2905. typedef struct tagMULTIKEYHELP
  2906. {
  2907. WORD mkSize;
  2908. BYTE mkKeylist;
  2909. BYTE szKeyphrase[1];
  2910. } MULTIKEYHELP;
  2911. #endif /* NOHELP */
  2912. #ifndef NOPROFILER
  2913. /* function declarations for profiler routines contained in Windows libraries */
  2914. int far pascal ProfInsChk(void);
  2915. void far pascal ProfSetup(int,int);
  2916. void far pascal ProfSampRate(int,int);
  2917. void far pascal ProfStart(void);
  2918. void far pascal ProfStop(void);
  2919. void far pascal ProfClear(void);
  2920. void far pascal ProfFlush(void);
  2921. void far pascal ProfFinish(void);
  2922. #endif /* NOPROFILER */