home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk5 / win30api.tx_ / win30api.bin
Text File  |  1993-04-28  |  125KB  |  2,827 lines

  1. ' ------------------------------------------------------------------------
  2. '
  3. '    WIN30API.TXT -- Windows 3.0 API Declarations for Visual Basic
  4. '
  5. '              Copyright (C) 1993 Microsoft Corporation
  6. '
  7. '
  8. '  This file contains only the Const, Type, and Declare statements for
  9. '  Windows 3.0 APIs.  Use WIN31EXT.TXT for Windows 3.1 APIs.
  10. '
  11. '  The Global Constants ABORTDOC, STARTDOC, and ENDDOCAPI are
  12. '  Windows 3.0 specific and have been superseded by the ABORTDOC,
  13. '  STARTDOC, and ENDDOCAPI functions in Windows 3.1.  These constants
  14. '  have been made into comments in this file.  In order to use them you will
  15. '  need to remove the comment symbol preceding each constant.
  16. '
  17. '  You have a royalty-free right to use, modify, reproduce and distribute
  18. '  this file (and/or any modified version) in any way you find useful,
  19. '  provided that you agree that Microsoft has no warranty, obligation or
  20. '  liability for its contents.  Refer to the Microsoft Windows Programmer's
  21. '  Reference for further information.
  22. '
  23. ' ------------------------------------------------------------------------
  24.  
  25.  
  26. ' General Purpose Types
  27.  
  28. Type RECT
  29.     left As Integer
  30.     top As Integer
  31.     right As Integer
  32.     bottom As Integer
  33. End Type
  34.  
  35. Type POINTAPI
  36.     x As Integer
  37.     y As Integer
  38. End Type
  39.  
  40.  
  41. ' ----------------
  42. '  Kernel Section
  43. ' ----------------
  44.  
  45. ' ParameterBlock description structure for use with LoadModule
  46. Type PARAMETERBLOCK
  47.     wEnvSeg As Integer
  48.     lpCmdLine As Long
  49.     lpCmdShow As Long
  50.     dwReserved As Long
  51. End Type
  52.  
  53. ' Loader Routines
  54. Declare Function GetNumTasks Lib "Kernel" () As Integer
  55. Declare Function GetModuleHandle Lib "Kernel" (ByVal lpModuleName As String) As Integer
  56. Declare Function GetModuleUsage Lib "Kernel" (ByVal hModule As Integer) As Integer
  57. Declare Function GetModuleFileName Lib "Kernel" (ByVal hModule As Integer, ByVal lpFilename As String, ByVal nSize As Integer) As Integer
  58. Declare Function GetInstanceData Lib "Kernel" (ByVal hInstance As Integer, ByVal pData As Integer, ByVal nCount As Integer) As Integer
  59. Declare Function LoadLibrary Lib "Kernel" (ByVal lpLibFileName As String) As Integer
  60. Declare Function LoadModule Lib "Kernel" (ByVal lpModuleName As String, lpParameterBlock As PARAMETERBLOCK) As Integer
  61. Declare Sub FreeModule Lib "Kernel" (ByVal hModule As Integer) 
  62. Declare Sub FreeLibrary Lib "Kernel" (ByVal hLibModule As Integer)
  63. Declare Function GetFreeSpace Lib "Kernel" (ByVal wFlags As Integer) As Long
  64. Declare Function WinExec Lib "Kernel" (ByVal lpCmdLine As String, ByVal nCmdShow As Integer) As Integer
  65. Declare Sub DebugBreak Lib "Kernel" ()
  66. Declare Sub OutputDebugString Lib "Kernel" (ByVal lpOutputString As String)
  67. Declare Sub SwitchStackBack Lib "Kernel" ()
  68. Declare Sub SwitchStackTo Lib "Kernel" (ByVal wStackSegment As Integer, ByVal wStackPointer As Integer, ByVal wStackTop As Integer)
  69. Declare Function GetCurrentPDB Lib "Kernel" () As Integer
  70. Declare Function GetVersion Lib "Kernel" () As Long
  71.  
  72. ' OpenFile() Structure
  73. Type OFSTRUCT
  74.     cBytes As String * 1
  75.     fFixedDisk As String * 1
  76.     nErrCode As Integer
  77.     reserved As String * 4
  78.     szPathName As String * 128
  79. End Type
  80.  
  81. ' OpenFile() Flags
  82. Global Const OF_READ = &H0
  83. Global Const OF_WRITE = &H1
  84. Global Const OF_READWRITE = &H2
  85. Global Const OF_SHARE_COMPAT = &H0
  86. Global Const OF_SHARE_EXCLUSIVE = &H10
  87. Global Const OF_SHARE_DENY_WRITE = &H20
  88. Global Const OF_SHARE_DENY_READ = &H30
  89. Global Const OF_SHARE_DENY_NONE = &H40
  90. Global Const OF_PARSE = &H100
  91. Global Const OF_DELETE = &H200
  92. Global Const OF_VERIFY = &H400
  93. Global Const OF_CANCEL = &H800
  94. Global Const OF_CREATE = &H1000
  95. Global Const OF_PROMPT = &H2000
  96. Global Const OF_EXIST = &H4000
  97. Global Const OF_REOPEN = &H8000
  98.  
  99. Declare Function OpenFile Lib "Kernel" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Integer) As Integer
  100.  
  101. ' GetTempFileName() Flags
  102. '
  103. Global Const TF_FORCEDRIVE = &H80
  104.  
  105. Declare Function GetTempDrive Lib "Kernel" (ByVal cDriveLetter as Integer) As Integer
  106. Declare Function GetTempFileName Lib "Kernel" (ByVal cDriveLetter as Integer, ByVal lpPrefixString As String, ByVal wUnique As Integer, ByVal lpTempFileName As String) As Integer
  107. Declare Function SetHandleCount Lib "Kernel" (ByVal wNumber As Integer) As Integer
  108.  
  109. Declare Function GetDriveType Lib "Kernel" (ByVal nDrive As Integer) As Integer
  110.  
  111. ' GetDriveType return values
  112. Global Const DRIVE_REMOVABLE = 2
  113. Global Const DRIVE_FIXED = 3
  114. Global Const DRIVE_REMOTE = 4
  115.  
  116. ' Global Memory Flags
  117. Global Const GMEM_FIXED = &H0
  118. Global Const GMEM_MOVEABLE = &H2
  119. Global Const GMEM_NOCOMPACT = &H10
  120. Global Const GMEM_NODISCARD = &H20
  121. Global Const GMEM_ZEROINIT = &H40
  122. Global Const GMEM_MODIFY = &H80
  123. Global Const GMEM_DISCARDABLE = &H100
  124. Global Const GMEM_NOT_BANKED = &H1000
  125. Global Const GMEM_SHARE = &H2000
  126. Global Const GMEM_DDESHARE = &H2000
  127. Global Const GMEM_NOTIFY = &H4000
  128. Global Const GMEM_LOWER = GMEM_NOT_BANKED
  129.  
  130. Global Const GHND = (GMEM_MOVEABLE Or GMEM_ZEROINIT)
  131. Global Const GPTR = (GMEM_FIXED Or GMEM_ZEROINIT)
  132.  
  133. Declare Function GlobalAlloc Lib "Kernel" (ByVal wFlags As Integer, ByVal dwBytes As Long) As Integer
  134. Declare Function GlobalCompact Lib "Kernel" (ByVal dwMinFree As Long) As Long
  135. Declare Function GlobalFree Lib "Kernel" (ByVal hMem As Integer) As Integer
  136. Declare Function GlobalHandle Lib "Kernel" (ByVal wMem As Integer) As Long
  137. Declare Function GlobalLock Lib "Kernel" (ByVal hMem As Integer) As Long
  138. Declare Function GlobalReAlloc Lib "Kernel" (ByVal hMem As Integer, ByVal dwBytes As Long, ByVal wFlags As Integer) As Integer
  139.  
  140. 'NOTE: instead of declaring the function GlobalDiscard and calling 
  141. '      GlobalDiscard(hMem), call GlobalReAlloc(hMem, 0, GMEM_MOVEABLE)
  142.  
  143. Declare Function GlobalSize Lib "Kernel" (ByVal hMem As Integer) As Long
  144. Declare Function GlobalUnlock Lib "Kernel" (ByVal hMem As Integer) As Integer
  145. Declare Function UnlockResource Lib "Kernel" Alias "GlobalUnlock" (ByVal hMem As Integer) As Integer
  146. Declare Function GlobalFlags Lib "Kernel" (ByVal hMem As Integer) As Integer
  147. Declare Function GlobalWire Lib "Kernel" (ByVal hMem As Integer) As Long
  148. Declare Function GlobalUnWire Lib "Kernel" (ByVal hMem As Integer) As Integer
  149. Declare Function GlobalUnlock Lib "Kernel" (ByVal hMem As Integer) As Integer
  150. Declare Function GlobalLRUNewest Lib "Kernel" (ByVal hMem As Integer) As Integer
  151. Declare Function GlobalLRUOldest Lib "Kernel" (ByVal hMem As Integer) As Integer
  152. Declare Function GlobalPageLock Lib "Kernel" (ByVal wSelector As Integer) As Integer
  153. Declare Function GlobalPageUnlock Lib "Kernel" (ByVal wSelector As Integer) As Integer
  154. Declare Sub GlobalFix Lib "Kernel" (ByVal hMem As Integer)
  155. Declare Function GlobalUnfix Lib "Kernel" (ByVal hMem As Integer) As Integer
  156.  
  157. ' Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE)
  158. Global Const GMEM_DISCARDED = &H4000
  159. Global Const GMEM_LOCKCOUNT = &HFF
  160.  
  161. Declare Function LockSegment Lib "Kernel" (ByVal wSegment As Integer) As Integer
  162. Declare Function UnlockSegment Lib "Kernel" (ByVal wSegment As Integer) As Integer
  163.  
  164. ' Local Memory Flags
  165. Global Const LMEM_FIXED = &H0
  166. Global Const LMEM_MOVEABLE = &H2
  167. Global Const LMEM_NOCOMPACT = &H10
  168. Global Const LMEM_NODISCARD = &H20
  169. Global Const LMEM_ZEROINIT = &H40
  170. Global Const LMEM_MODIFY = &H80
  171. Global Const LMEM_DISCARDABLE = &HF00
  172.  
  173. Global Const LHND = (LMEM_MOVEABLE+LMEM_ZEROINIT)
  174. Global Const LPTR = (LMEM_FIXED+LMEM_ZEROINIT)
  175.  
  176. Global Const NONZEROLHND = (LMEM_MOVEABLE)
  177. Global Const NONZEROLPTR = (LMEM_FIXED)
  178.  
  179. Global Const LNOTIFY_OUTOFMEM = 0
  180. Global Const LNOTIFY_MOVE = 1
  181. Global Const LNOTIFY_DISCARD = 2
  182.  
  183. Declare Function LocalAlloc Lib "Kernel" (ByVal wFlags As Integer, ByVal wBytes As Integer) As Integer
  184. Declare Function LocalCompact Lib "Kernel" (ByVal wMinFree As Integer) As Integer
  185. Declare Function LocalFree Lib "Kernel" (ByVal hMem As Integer) As Integer
  186. Declare Function LocalHandle Lib "Kernel" (ByVal wMem As Integer) As Integer
  187. Declare Function LocalInit Lib "Kernel" (ByVal wSegment As Integer, ByVal pStart As Integer, ByVal pEnd As Integer) As Integer
  188. Declare Function LocalLock Lib "Kernel" (ByVal hMem As Integer) As Integer '(returns a near pointer)
  189. Declare Function LocalReAlloc Lib "Kernel" (ByVal hMem As Integer, ByVal wBytes As Integer, ByVal wFlags As Integer) As Integer
  190.  
  191. 'NOTE: instead of declaring the function LocalDiscard and calling 
  192. '      LocalDiscard(hMem), call LocalReAlloc(hMem, 0, LMEM_MOVEABLE)
  193.  
  194. Declare Function LocalSize Lib "Kernel" (ByVal hMem As Integer) As Integer
  195. Declare Function LocalUnlock Lib "Kernel" (ByVal hMem As Integer) As Integer
  196. Declare Function LocalFlags Lib "Kernel" (ByVal hMem As Integer) As Integer
  197. Declare Function LocalShrink Lib "Kernel" (ByVal hSeg As Integer, ByVal wSize As Integer) As Integer
  198.  
  199. ' Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE)
  200. Global Const LMEM_DISCARDED = &H4000
  201. Global Const LMEM_LOCKCOUNT = &HFF
  202.  
  203. Declare Function SetSwapAreaSize Lib "Kernel" (ByVal rsSize As Integer) As Long
  204. Declare Function ValidateFreeSpaces Lib "Kernel" () As Long
  205. Declare Sub LimitEmsPages Lib "Kernel" (ByVal dwKbytes As Long)
  206. Declare Function SetErrorMode Lib "Kernel" (ByVal wMode As Integer) As Integer
  207. Declare Sub ValidateCodeSegments Lib "Kernel" ()
  208.  
  209. Declare Function GetDOSEnvironment Lib "Kernel" () As Long
  210.  
  211. Declare Function AllocDStoCSAlias Lib "Kernel" (ByVal wSelector As Integer) As Integer
  212. Declare Function AllocSelector Lib "Kernel" (ByVal wSelector As Integer) As Integer
  213. Declare Function ChangeSelector Lib "Kernel" (ByVal wDestSelector As Integer, ByVal wSourceSelector As Integer) As Integer
  214. Declare Function FreeSelector Lib "Kernel" (ByVal wSelector As Integer) As Integer
  215. Declare Function FindResource Lib "Kernel" (ByVal hInstance As Integer, ByVal lpName As String, ByVal lpType As Any) As Integer
  216. Declare Function LoadResource Lib "Kernel" (ByVal hInstance As Integer, ByVal hResInfo As Integer) As Integer
  217. Declare Function FreeResource Lib "Kernel" (ByVal hResData As Integer) As Integer
  218. Declare Function LockResource Lib "Kernel" (ByVal hResData As Integer) As Long
  219. Declare Function AllocResource Lib "Kernel" (ByVal hInstance As Integer, ByVal hResInfo As Integer, ByVal dwSize As Long) As Integer
  220. Declare Function SizeofResource Lib "Kernel" (ByVal hInstance As Integer, ByVal hResInfo As Integer) As Integer
  221. Declare Function AccessResource Lib "Kernel" (ByVal hInstance As Integer, ByVal hResInfo As Integer) As Integer
  222.  
  223. ' Predefined Resource Types
  224. Global Const RT_CURSOR = 1&
  225. Global Const RT_BITMAP = 2&
  226. Global Const RT_ICON = 3&
  227. Global Const RT_MENU = 4&
  228. Global Const RT_DIALOG = 5&
  229. Global Const RT_STRING = 6&
  230. Global Const RT_FONTDIR = 7&
  231. Global Const RT_FONT = 8&
  232. Global Const RT_ACCELERATOR = 9&
  233. Global Const RT_RCDATA = 10&
  234.  
  235. Declare Sub Yield Lib "Kernel" ()
  236. Declare Function GetCurrentTask Lib "Kernel" () As Integer
  237.  
  238. Declare Function InitAtomTable Lib "Kernel" (ByVal nSize As Integer) As Integer
  239. Declare Function AddAtom Lib "Kernel" (ByVal lpString As String) As Integer
  240. Declare Function DeleteAtom Lib "Kernel" (ByVal nAtom As Integer) As Integer
  241. Declare Function FindAtom Lib "Kernel" (ByVal lpString As String) As Integer
  242. Declare Function GetAtomName Lib "Kernel" (ByVal nAtom As Integer, ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  243. Declare Function GlobalAddAtom Lib "Kernel" (ByVal lpString As String) As Integer
  244. Declare Function GlobalDeleteAtom Lib "Kernel" (ByVal nAtom As Integer) As Integer
  245. Declare Function GlobalFindAtom Lib "Kernel" (ByVal lpString As String) As Integer
  246. Declare Function GlobalGetAtomName Lib "Kernel" (ByVal nAtom As Integer, ByVal lpbuffer As String, ByVal nSize As Integer) As Integer
  247. Declare Function GetAtomHandle Lib "Kernel" (ByVal wAtom As Integer) As Integer
  248.  
  249.  
  250. ' User Profile Routines
  251. ' NOTE: The lpKeyName argument for GetProfileString, WriteProfileString,
  252. '       GetPrivateProfileString, and WritePrivateProfileString can be either
  253. '       a string or NULL.  This is why the argument is defined as "By Any".
  254. '          For example, to pass a string specify   ByVal "wallpaper"
  255. '          To pass NULL specify                    ByVal 0&
  256. '       You can also pass NULL for the lpString argument for WriteProfileString
  257. '       and WritePrivateProfileString
  258. Declare Function GetProfileInt Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal nDefault As Integer) As Integer
  259. Declare Function GetProfileString Lib "Kernel" (ByVal lpAppName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer) As Integer
  260. Declare Function WriteProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, lpString As Any) As Integer
  261. Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
  262. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  263. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, lpString As Any, ByVal lplFileName As String) As Integer
  264. Declare Function GetWindowsDirectory Lib "Kernel" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  265. Declare Function GetSystemDirectory Lib "Kernel" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  266.  
  267. 'NOTE: Catch/Throw expect a long pointer to an 18-byte buffer (lpCatchBuf)
  268. ' eg:
  269. '       Dim Buffer(1 To 9) As Integer
  270. '       result% = Catch (Buffer(1))             
  271.  
  272. Declare Function Catch Lib "Kernel" (lpCatchBuf As Any) As Integer
  273. Declare Sub Throw Lib "Kernel" (lpCatchBuf As Any, ByVal nThrowBack As Integer)
  274.  
  275. Declare Sub FatalExit Lib "Kernel" (ByVal Code As Integer)
  276. Declare Sub SwapRecording Lib "Kernel" (ByVal wFlag As Integer)
  277.  
  278. ' Character Translation Routines
  279. Declare Function AnsiToOem Lib "Keyboard" (ByVal lpAnsiStr As String, ByVal lpOemStr As String) As Integer
  280. Declare Function OemToAnsi Lib "Keyboard" (ByVal lpOemStr As String, ByVal lpAnsiStr As String) As Integer
  281. Declare Sub AnsiToOemBuff Lib "Keyboard" (ByVal lpAnsiStr As String, ByVal lpOemStr As String, ByVal nLength As Integer)
  282. Declare Sub OemToAnsiBuff Lib "Keyboard" (ByVal lpOemStr As String, ByVal lpAnsiStr As String, ByVal nLength as Integer)
  283. Declare Function AnsiUpper Lib "User" (ByVal lpString As String) As String
  284. Declare Function AnsiUpperBuff Lib "User" (ByVal lpString As String, ByVal aWORD As Integer) As Integer
  285. Declare Function AnsiLower Lib "User" (ByVal lpString As String) As Long
  286. Declare Function AnsiLowerBuff Lib "User" (ByVal lpString As String, ByVal aWORD As Integer) As Integer
  287. Declare Function AnsiNext Lib "User" (ByVal lpString As String) As Long
  288. Declare Function AnsiPrev Lib "User" (ByVal lpString As String, ByVal lpString As String) As Long
  289.  
  290. ' Keyboard Information Routines
  291. Declare Function OemKeyScan Lib "Keyboard" (ByVal wOemChar As Integer) As Long
  292. Declare Function VkKeyScan Lib "Keyboard" (ByVal cChar As Integer) As Integer
  293. Declare Function GetKeyboardType Lib "Keyboard" (ByVal nTypeFlag As Integer) As Integer
  294. Declare Function MapVirtualKey Lib "Keyboard" (ByVal wCode As Integer, ByVal wMapType As Integer) As Integer
  295. Declare Function GetKBCodePage Lib "Keyboard" ()
  296. Declare Function GetKeyNameText Lib "Keyboard" (ByVal lParam As Long, ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  297. Declare Function ToAscii Lib "Keyboard" (ByVal wVirtKey As Integer, ByVal wScanCode As Integer, lpKeyState As Any, lpChar As Any, Byval wFlags As Integer) As Integer
  298.  
  299. ' Language dependent Routines
  300. Declare Function IsCharAlpha Lib "User" (ByVal cChar As Integer) As Integer
  301. Declare Function IsCharAlphaNumeric Lib "User" (ByVal cChar As Integer) As Integer
  302. Declare Function IsCharUpper Lib "User" (ByVal cChar As Integer) As Integer
  303. Declare Function IsCharLower Lib "User" (ByVal cChar As Integer) As Integer
  304.  
  305. Declare Function GetWinFlags Lib "Kernel" () As Long
  306.  
  307. Global Const WF_PMODE = &H1
  308. Global Const WF_CPU286 = &H2
  309. Global Const WF_CPU386 = &H4
  310. Global Const WF_CPU486 = &H8
  311. Global Const WF_STANDARD = &H10
  312. Global Const WF_WIN286 = &H10
  313. Global Const WF_ENHANCED = &H20
  314. Global Const WF_WIN386 = &H20
  315. Global Const WF_CPU086 = &H40
  316. Global Const WF_CPU186 = &H80
  317. Global Const WF_LARGEFRAME = &H100
  318. Global Const WF_SMALLFRAME = &H200
  319. Global Const WF_80x87 = &H400
  320.  
  321. ' WEP fSystemExit flag values
  322. Global Const WEP_SYSTEM_EXIT = 1
  323. Global Const WEP_FREE_DLL = 0
  324.  
  325. ' OEM Resource Ordinal Numbers
  326. Global Const OBM_CLOSE = 32754
  327. Global Const OBM_UPARROW = 32753
  328. Global Const OBM_DNARROW = 32752
  329. Global Const OBM_RGARROW = 32751
  330. Global Const OBM_LFARROW = 32750
  331. Global Const OBM_REDUCE = 32749
  332. Global Const OBM_ZOOM = 32748
  333. Global Const OBM_RESTORE = 32747
  334. Global Const OBM_REDUCED = 32746
  335. Global Const OBM_ZOOMD = 32745
  336. Global Const OBM_RESTORED = 32744
  337. Global Const OBM_UPARROWD = 32743
  338. Global Const OBM_DNARROWD = 32742
  339. Global Const OBM_RGARROWD = 32741
  340. Global Const OBM_LFARROWD = 32740
  341. Global Const OBM_MNARROW = 32739
  342. Global Const OBM_COMBO = 32738
  343.  
  344. Global Const OBM_OLD_CLOSE = 32767
  345. Global Const OBM_SIZE = 32766
  346. Global Const OBM_OLD_UPARROW = 32765
  347. Global Const OBM_OLD_DNARROW = 32764
  348. Global Const OBM_OLD_RGARROW = 32763
  349. Global Const OBM_OLD_LFARROW = 32762
  350. Global Const OBM_BTSIZE = 32761
  351. Global Const OBM_CHECK = 32760
  352. Global Const OBM_CHECKBOXES = 32759
  353. Global Const OBM_BTNCORNERS = 32758
  354. Global Const OBM_OLD_REDUCE = 32757
  355. Global Const OBM_OLD_ZOOM = 32756
  356. Global Const OBM_OLD_RESTORE = 32755
  357.  
  358. Global Const OCR_NORMAL = 32512
  359. Global Const OCR_IBEAM = 32513
  360. Global Const OCR_WAIT = 32514
  361. Global Const OCR_CROSS = 32515
  362. Global Const OCR_UP = 32516
  363. Global Const OCR_SIZE = 32640
  364. Global Const OCR_ICON = 32641
  365. Global Const OCR_SIZENWSE = 32642
  366. Global Const OCR_SIZENESW = 32643
  367. Global Const OCR_SIZEWE = 32644
  368. Global Const OCR_SIZENS = 32645
  369. Global Const OCR_SIZEALL = 32646
  370. Global Const OCR_ICOCUR = 32647
  371.  
  372. Global Const OIC_SAMPLE = 32512
  373. Global Const OIC_HAND = 32513
  374. Global Const OIC_QUES = 32514
  375. Global Const OIC_BANG = 32515
  376. Global Const OIC_NOTE = 32516
  377.  
  378.  
  379. ' -------------
  380. '  GDI Section
  381. ' -------------
  382.  
  383. ' Binary raster ops
  384. Global Const R2_BLACK = 1       '   0
  385. Global Const R2_NOTMERGEPEN = 2 '  DPon
  386. Global Const R2_MASKNOTPEN = 3  '  DPna
  387. Global Const R2_NOTCOPYPEN = 4  '  PN
  388. Global Const R2_MASKPENNOT = 5  '  PDna
  389. Global Const R2_NOT = 6 '  Dn
  390. Global Const R2_XORPEN = 7      '  DPx
  391. Global Const R2_NOTMASKPEN = 8  '  DPan
  392. Global Const R2_MASKPEN = 9     '  DPa
  393. Global Const R2_NOTXORPEN = 10  '  DPxn
  394. Global Const R2_NOP = 11        '  D
  395. Global Const R2_MERGENOTPEN = 12        '  DPno
  396. Global Const R2_COPYPEN = 13    '  P
  397. Global Const R2_MERGEPENNOT = 14        '  PDno
  398. Global Const R2_MERGEPEN = 15   '  DPo
  399. Global Const R2_WHITE = 16      '   1
  400.  
  401. '  Ternary raster operations
  402. Global Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
  403. Global Const SRCPAINT = &HEE0086        ' (DWORD) dest = source OR dest
  404. Global Const SRCAND = &H8800C6  ' (DWORD) dest = source AND dest
  405. Global Const SRCINVERT = &H660046       ' (DWORD) dest = source XOR dest
  406. Global Const SRCERASE = &H440328        ' (DWORD) dest = source AND (NOT dest )
  407. Global Const NOTSRCCOPY = &H330008      ' (DWORD) dest = (NOT source)
  408. Global Const NOTSRCERASE = &H1100A6     ' (DWORD) dest = (NOT src) AND (NOT dest)
  409. Global Const MERGECOPY = &HC000CA       ' (DWORD) dest = (source AND pattern)
  410. Global Const MERGEPAINT = &HBB0226      ' (DWORD) dest = (NOT source) OR dest
  411. Global Const PATCOPY = &HF00021 ' (DWORD) dest = pattern
  412. Global Const PATPAINT = &HFB0A09        ' (DWORD) dest = DPSnoo
  413. Global Const PATINVERT = &H5A0049       ' (DWORD) dest = pattern XOR dest
  414. Global Const DSTINVERT = &H550009       ' (DWORD) dest = (NOT dest)
  415. Global Const BLACKNESS = &H42&  ' (DWORD) dest = BLACK
  416. Global Const WHITENESS = &HFF0062       ' (DWORD) dest = WHITE
  417.  
  418.  
  419. ' StretchBlt() Modes
  420. Global Const BLACKONWHITE = 1
  421. Global Const WHITEONBLACK = 2
  422. Global Const COLORONCOLOR = 3
  423.  
  424. ' PolyFill() Modes
  425. Global Const ALTERNATE = 1
  426. Global Const WINDING = 2
  427.  
  428. ' Text Alignment Options
  429. Global Const TA_NOUPDATECP = 0
  430. Global Const TA_UPDATECP = 1
  431.  
  432. Global Const TA_LEFT = 0
  433. Global Const TA_RIGHT = 2
  434. Global Const TA_CENTER = 6
  435.  
  436. Global Const TA_TOP = 0
  437. Global Const TA_BOTTOM = 8
  438. Global Const TA_BASELINE = 24
  439.  
  440. Global Const ETO_GRAYED = 1
  441. Global Const ETO_OPAQUE = 2
  442. Global Const ETO_CLIPPED = 4
  443.  
  444. Global Const ASPECT_FILTERING = &H1
  445.  
  446. ' Metafile Functions
  447. Global Const META_SETBKCOLOR = &H201
  448. Global Const META_SETBKMODE = &H102
  449. Global Const META_SETMAPMODE = &H103
  450. Global Const META_SETROP2 = &H104
  451. Global Const META_SETRELABS = &H105
  452. Global Const META_SETPOLYFILLMODE = &H106
  453. Global Const META_SETSTRETCHBLTMODE = &H107
  454. Global Const META_SETTEXTCHAREXTRA = &H108
  455. Global Const META_SETTEXTCOLOR = &H209
  456. Global Const META_SETTEXTJUSTIFICATION = &H20A
  457. Global Const META_SETWINDOWORG = &H20B
  458. Global Const META_SETWINDOWEXT = &H20C
  459. Global Const META_SETVIEWPORTORG = &H20D
  460. Global Const META_SETVIEWPORTEXT = &H20E
  461. Global Const META_OFFSETWINDOWORG = &H20F
  462. Global Const META_SCALEWINDOWEXT = &H400
  463. Global Const META_OFFSETVIEWPORTORG = &H211
  464. Global Const META_SCALEVIEWPORTEXT = &H412
  465. Global Const META_LINETO = &H213
  466. Global Const META_MOVETO = &H214
  467. Global Const META_EXCLUDECLIPRECT = &H415
  468. Global Const META_INTERSECTCLIPRECT = &H416
  469. Global Const META_ARC = &H817
  470. Global Const META_ELLIPSE = &H418
  471. Global Const META_FLOODFILL = &H419
  472. Global Const META_PIE = &H81A
  473. Global Const META_RECTANGLE = &H41B
  474. Global Const META_ROUNDRECT = &H61C
  475. Global Const META_PATBLT = &H61D
  476. Global Const META_SAVEDC = &H1E
  477. Global Const META_SETPIXEL = &H41F
  478. Global Const META_OFFSETCLIPRGN = &H220
  479. Global Const META_TEXTOUT = &H521
  480. Global Const META_BITBLT = &H922
  481. Global Const META_STRETCHBLT = &HB23
  482. Global Const META_POLYGON = &H324
  483. Global Const META_POLYLINE = &H325
  484. Global Const META_ESCAPE = &H626
  485. Global Const META_RESTOREDC = &H127
  486. Global Const META_FILLREGION = &H228
  487. Global Const META_FRAMEREGION = &H429
  488. Global Const META_INVERTREGION = &H12A
  489. Global Const META_PAINTREGION = &H12B
  490. Global Const META_SELECTCLIPREGION = &H12C
  491. Global Const META_SELECTOBJECT = &H12D
  492. Global Const META_SETTEXTALIGN = &H12E
  493. Global Const META_DRAWTEXT = &H62F
  494.  
  495. Global Const META_CHORD = &H830
  496. Global Const META_SETMAPPERFLAGS = &H231
  497. Global Const META_EXTTEXTOUT = &Ha32
  498. Global Const META_SETDIBTODEV = &Hd33
  499. Global Const META_SELECTPALETTE = &H234
  500. Global Const META_REALIZEPALETTE = &H35
  501. Global Const META_ANIMATEPALETTE = &H436
  502. Global Const META_SETPALENTRIES = &H37
  503. Global Const META_POLYPOLYGON = &H538
  504. Global Const META_RESIZEPALETTE = &H139
  505.  
  506. Global Const META_DIBBITBLT = &H940
  507. Global Const META_DIBSTRETCHBLT = &Hb41
  508. Global Const META_DIBCREATEPATTERNBRUSH = &H142
  509. Global Const META_STRETCHDIB = &Hf43
  510.  
  511. Global Const META_DELETEOBJECT = &H1f0
  512.  
  513. Global Const META_CREATEPALETTE = &Hf7
  514. Global Const META_CREATEBRUSH = &HF8
  515. Global Const META_CREATEPATTERNBRUSH = &H1F9
  516. Global Const META_CREATEPENINDIRECT = &H2FA
  517. Global Const META_CREATEFONTINDIRECT = &H2FB
  518. Global Const META_CREATEBRUSHINDIRECT = &H2FC
  519. Global Const META_CREATEBITMAPINDIRECT = &H2FD
  520. Global Const META_CREATEBITMAP = &H6FE
  521. Global Const META_CREATEREGION = &H6FF
  522.  
  523.  
  524. ' GDI Escapes
  525. Global Const NEWFRAME = 1
  526. 'Global Const ABORTDOC = 2
  527. Global Const NEXTBAND = 3
  528. Global Const SETCOLORTABLE = 4
  529. Global Const GETCOLORTABLE = 5
  530. Global Const FLUSHOUTPUT = 6
  531. Global Const DRAFTMODE = 7
  532. Global Const QUERYESCSUPPORT = 8
  533. Global Const SETABORTPROC = 9
  534. 'Global Const STARTDOC = 10
  535. 'Global Const ENDDOCAPI = 11
  536. Global Const GETPHYSPAGESIZE = 12
  537. Global Const GETPRINTINGOFFSET = 13
  538. Global Const GETSCALINGFACTOR = 14
  539. Global Const MFCOMMENT = 15
  540. Global Const GETPENWIDTH = 16
  541. Global Const SETCOPYCOUNT = 17
  542. Global Const SELECTPAPERSOURCE = 18
  543. Global Const DEVICEDATA = 19
  544. Global Const PASSTHROUGH = 19
  545. Global Const GETTECHNOLGY = 20
  546. Global Const GETTECHNOLOGY = 20
  547. Global Const SETENDCAP = 21
  548. Global Const SETLINEJOIN = 22
  549. Global Const SETMITERLIMIT = 23
  550. Global Const BANDINFO = 24
  551. Global Const DRAWPATTERNRECT = 25
  552. Global Const GETVECTORPENSIZE = 26
  553. Global Const GETVECTORBRUSHSIZE = 27
  554. Global Const ENABLEDUPLEX = 28
  555. Global Const GETSETPAPERBINS = 29
  556. Global Const GETSETPRINTORIENT = 30
  557. Global Const ENUMPAPERBINS = 31
  558. Global Const SETDIBSCALING = 32
  559. Global Const EPSPRINTING = 33
  560. Global Const ENUMPAPERMETRICS = 34
  561. Global Const GETSETPAPERMETRICS = 35
  562. Global Const POSTSCRIPT_DATA = 37
  563. Global Const POSTSCRIPT_IGNORE = 38
  564. Global Const GETEXTENDEDTEXTMETRICS = 256
  565. Global Const GETEXTENTTABLE = 257
  566. Global Const GETPAIRKERNTABLE = 258
  567. Global Const GETTRACKKERNTABLE = 259
  568. Global Const EXTTEXTOUTAPI = 512
  569. Global Const ENABLERELATIVEWIDTHS = 768
  570. Global Const ENABLEPAIRKERNING = 769
  571. Global Const SETKERNTRACK = 770
  572. Global Const SETALLJUSTVALUES = 771
  573. Global Const SETCHARSET = 772
  574.  
  575. Global Const STRETCHBLTAPI = 2048
  576. Global Const BEGIN_PATH = 4096
  577. Global Const CLIP_TO_PATH = 4097
  578. Global Const END_PATH = 4098
  579. Global Const EXT_DEVICE_CAPS = 4099
  580. Global Const RESTORE_CTM = 4100
  581. Global Const SAVE_CTM = 4101
  582. Global Const SET_ARC_DIRECTION = 4102
  583. Global Const SET_BACKGROUND_COLOR = 4103
  584. Global Const SET_POLY_MODE = 4104
  585. Global Const SET_SCREEN_ANGLE = 4105
  586. Global Const SET_SPREAD = 4106
  587. Global Const TRANSFORM_CTM = 4107
  588. Global Const SET_CLIP_BOX = 4108
  589. Global Const SET_BOUNDS = 4109
  590. Global Const SET_MIRROR_MODE = 4110
  591.  
  592. ' Spooler Error Codes
  593. Global Const SP_NOTREPORTED = &H4000
  594. Global Const SP_ERROR = (-1)
  595. Global Const SP_APPABORT = (-2)
  596. Global Const SP_USERABORT = (-3)
  597. Global Const SP_OUTOFDISK = (-4)
  598. Global Const SP_OUTOFMEMORY = (-5)
  599.  
  600. Global Const PR_JOBSTATUS = &H0
  601.  
  602. ' Bitmap Header Definition
  603. Type BITMAP '14 bytes
  604.     bmType As Integer
  605.     bmWidth As Integer
  606.     bmHeight As Integer
  607.     bmWidthBytes As Integer
  608.     bmPlanes As String * 1
  609.     bmBitsPixel As String * 1
  610.     bmBits As Long
  611. End Type
  612.  
  613. Type RGBTRIPLE 
  614.     rgbtBlue As String * 1
  615.     rgbtGreen As String * 1
  616.     rgbtRed As String * 1
  617. End Type
  618.  
  619. Type RGBQUAD
  620.     rgbBlue as String * 1
  621.     rgbGreen As String * 1
  622.     rgbRed As String * 1
  623.     rgbReserved As String * 1
  624. End Type
  625.  
  626. ' structures for defining DIBs
  627. Type BITMAPCOREHEADER '12 bytes
  628.     bcSize as Long
  629.     bcWidth As Integer
  630.     bcHeight As Integer
  631.     bcPlanes As Integer
  632.     bcBitCount As Integer
  633. End Type
  634.  
  635. Type BITMAPINFOHEADER '40 bytes
  636.     biSize As Long
  637.     biWidth As Long
  638.     biHeight As Long
  639.     biPlanes As Integer
  640.     biBitCount As Integer
  641.     biCompression As Long
  642.     biSizeImage As Long
  643.     biXPelsPerMeter As Long
  644.     biYPelsPerMeter As Long
  645.     biClrUsed As Long
  646.     biClrImportant As Long
  647. End Type
  648.  
  649. ' constants for the biCompression field
  650. Global Const BI_RGB = 0&
  651. Global Const BI_RLE8 = 1&
  652. Global Const BI_RLE4 = 2&
  653.  
  654. Type BITMAPINFO
  655.     bmiHeader as BITMAPINFOHEADER
  656.     bmiColors As String * 128 ' Array length is arbitrary; may be changed
  657. End Type
  658.  
  659. Type BITMAPCOREINFO
  660.     bmciHeader As BITMAPCOREHEADER
  661.     bmciColors As String * 96 ' Array length is arbitrary; may be changed
  662. End Type
  663.  
  664. Type BITMAPFILEHEADER
  665.     bfType As Integer
  666.     bfSize As Long
  667.     bfReserved1 As Integer
  668.     bfReserved2 As Integer
  669.     bfOffBits As Long
  670. End Type
  671.  
  672.  
  673. ' Clipboard Metafile Picture Structure
  674. Type HANDLETABLE
  675.     objectHandle As String * 512 ' Array length is arbitrary; may be changed
  676. End Type
  677.  
  678. Type METARECORD
  679.     rdSize As Long
  680.     rdFunction As Integer
  681.     rdParm As String * 512 ' Array length is arbitrary; may be changed
  682. End Type
  683.  
  684.  
  685. Type METAFILEPICT
  686.     mm As Integer
  687.     xExt As Integer
  688.     yExt As Integer
  689.     hMF As Integer
  690. End Type
  691.  
  692. Type METAHEADER
  693.     mtType As Integer
  694.     mtHeaderSize As Integer
  695.     mtVersion As Integer
  696.     mtSize As Long
  697.     mtNoObjects As Integer
  698.     mtMaxRecord As Long
  699.     mtNoParameters As Integer
  700. End Type
  701.  
  702. Type TEXTMETRIC
  703.     tmHeight As Integer
  704.     tmAscent As Integer
  705.     tmDescent As Integer
  706.     tmInternalLeading As Integer
  707.     tmExternalLeading As Integer
  708.     tmAveCharWidth As Integer
  709.     tmMaxCharWidth As Integer
  710.     tmWeight As Integer
  711.     tmItalic As String * 1
  712.     tmUnderlined As String * 1
  713.     tmStruckOut As String * 1
  714.     tmFirstChar As String * 1
  715.     tmLastChar As String * 1
  716.     tmDefaultChar As String * 1
  717.     tmBreakChar As String * 1
  718.     tmPitchAndFamily As String * 1
  719.     tmCharSet As String * 1
  720.     tmOverhang As Integer
  721.     tmDigitizedAspectX As Integer
  722.     tmDigitizedAspectY As Integer
  723. End Type
  724.  
  725. ' GDI Logical Objects:
  726.  
  727. '  Pel Array
  728. Type PELARRAY
  729.     paXCount As Integer
  730.     paYCount As Integer
  731.     paXExt As Integer
  732.     paYExt As Integer
  733.     paRGBs As Integer
  734. End Type
  735.  
  736. ' Logical Brush (or Pattern)
  737. Type LOGBRUSH
  738.     lbStyle As Integer
  739.     lbColor As Long
  740.     lbHatch As Integer
  741. End Type
  742.  
  743. ' Logical Pen
  744. Type LOGPEN
  745.     lopnStyle As Integer
  746.     lopnWidth As POINTAPI
  747.     lopnColor As Long
  748. End Type
  749.  
  750. Type PALETTEENTRY
  751.     peRed As String * 1
  752.     peGreen As String * 1
  753.     peBlue As String * 1
  754.     peFlags As String * 1
  755. End Type
  756.  
  757. ' Logical Palette
  758. Type LOGPALETTE
  759.     palVersion As Integer
  760.     palNumEntries As Integer
  761.     palPalEntry As String * 252 ' Array length is arbitrary; may be changed
  762. End Type
  763.  
  764. ' Logical Font
  765. Global Const LF_FACESIZE = 32
  766.  
  767. Type LOGFONT
  768.     lfHeight As Integer
  769.     lfWidth As Integer
  770.     lfEscapement As Integer
  771.     lfOrientation As Integer
  772.     lfWeight As Integer
  773.     lfItalic As String * 1
  774.     lfUnderline As String * 1
  775.     lfStrikeOut As String * 1
  776.     lfCharSet As String * 1
  777.     lfOutPrecision As String * 1
  778.     lfClipPrecision As String * 1
  779.     lfQuality As String * 1
  780.     lfPitchAndFamily As String * 1
  781.     lfFaceName As String * LF_FACESIZE
  782. End Type
  783.  
  784. Global Const OUT_DEFAULT_PRECIS = 0
  785. Global Const OUT_STRING_PRECIS = 1
  786. Global Const OUT_CHARACTER_PRECIS = 2
  787. Global Const OUT_STROKE_PRECIS = 3
  788.  
  789. Global Const CLIP_DEFAULT_PRECIS = 0
  790. Global Const CLIP_CHARACTER_PRECIS = 1
  791. Global Const CLIP_STROKE_PRECIS = 2
  792.  
  793. Global Const DEFAULT_QUALITY = 0
  794. Global Const DRAFT_QUALITY = 1
  795. Global Const PROOF_QUALITY = 2
  796.  
  797. Global Const DEFAULT_PITCH = 0
  798. Global Const FIXED_PITCH = 1
  799. Global Const VARIABLE_PITCH = 2
  800.  
  801. Global Const ANSI_CHARSET = 0
  802. Global Const SYMBOL_CHARSET = 2
  803. Global Const SHIFTJIS_CHARSET = 128
  804. Global Const OEM_CHARSET = 255
  805.  
  806. ' Font Families
  807. '
  808. Global Const FF_DONTCARE = 0    '  Don't care or don't know.
  809. Global Const FF_ROMAN = 16      '  Variable stroke width, serifed.
  810.  
  811. ' Times Roman, Century Schoolbook, etc.
  812. Global Const FF_SWISS = 32      '  Variable stroke width, sans-serifed.
  813.  
  814. ' Helvetica, Swiss, etc.
  815. Global Const FF_MODERN = 48     '  Constant stroke width, serifed or sans-serifed.
  816.  
  817. ' Pica, Elite, Courier, etc.
  818. Global Const FF_SCRIPT = 64     '  Cursive, etc.
  819. Global Const FF_DECORATIVE = 80 '  Old English, etc.
  820.  
  821. ' Font Weights
  822. Global Const FW_DONTCARE = 0
  823. Global Const FW_THIN = 100
  824. Global Const FW_EXTRALIGHT = 200
  825. Global Const FW_LIGHT = 300
  826. Global Const FW_NORMAL = 400
  827. Global Const FW_MEDIUM = 500
  828. Global Const FW_SEMIBOLD = 600
  829. Global Const FW_BOLD = 700
  830. Global Const FW_EXTRABOLD = 800
  831. Global Const FW_HEAVY = 900
  832.  
  833. Global Const FW_ULTRALIGHT = FW_EXTRALIGHT
  834. Global Const FW_REGULAR = FW_NORMAL
  835. Global Const FW_DEMIBOLD = FW_SEMIBOLD
  836. Global Const FW_ULTRABOLD = FW_EXTRABOLD
  837. Global Const FW_BLACK = FW_HEAVY
  838.  
  839. ' Background Modes
  840. Global Const TRANSPARENT = 1
  841. Global Const OPAQUE = 2
  842.  
  843. ' Mapping Modes
  844. Global Const MM_TEXT = 1
  845. Global Const MM_LOMETRIC = 2
  846. Global Const MM_HIMETRIC = 3
  847. Global Const MM_LOENGLISH = 4
  848. Global Const MM_HIENGLISH = 5
  849. Global Const MM_TWIPS = 6
  850. Global Const MM_ISOTROPIC = 7
  851. Global Const MM_ANISOTROPIC = 8
  852.  
  853. ' Coordinate Modes
  854. Global Const ABSOLUTE = 1
  855. Global Const RELATIVE = 2
  856.  
  857. ' Stock Logical Objects
  858. Global Const WHITE_BRUSH = 0
  859. Global Const LTGRAY_BRUSH = 1
  860. Global Const GRAY_BRUSH = 2
  861. Global Const DKGRAY_BRUSH = 3
  862. Global Const BLACK_BRUSH = 4
  863. Global Const NULL_BRUSH = 5
  864. Global Const HOLLOW_BRUSH = NULL_BRUSH
  865. Global Const WHITE_PEN = 6
  866. Global Const BLACK_PEN = 7
  867. Global Const NULL_PEN = 8
  868. Global Const OEM_FIXED_FONT = 10
  869. Global Const ANSI_FIXED_FONT = 11
  870. Global Const ANSI_VAR_FONT = 12
  871. Global Const SYSTEM_FONT = 13
  872. Global Const DEVICE_DEFAULT_FONT = 14
  873. Global Const DEFAULT_PALETTE = 15
  874. Global Const SYSTEM_FIXED_FONT = 16
  875.  
  876. ' Brush Styles
  877. Global Const BS_SOLID = 0
  878. Global Const BS_NULL = 1
  879. Global Const BS_HOLLOW = BS_NULL
  880. Global Const BS_HATCHED = 2
  881. Global Const BS_PATTERN = 3
  882. Global Const BS_INDEXED = 4
  883. Global Const BS_DIBPATTERN = 5
  884.  
  885. ' Hatch Styles
  886. Global Const HS_HORIZONTAL = 0  '  -----
  887. Global Const HS_VERTICAL = 1    '  |||||
  888. Global Const HS_FDIAGONAL = 2   '  \\\\\
  889. Global Const HS_BDIAGONAL = 3   '  /////
  890. Global Const HS_CROSS = 4       '  +++++
  891. Global Const HS_DIAGCROSS = 5   '  xxxxx
  892.  
  893. ' Pen Styles
  894. Global Const PS_SOLID = 0
  895. Global Const PS_DASH = 1        '  -------
  896. Global Const PS_DOT = 2 '  .......
  897. Global Const PS_DASHDOT = 3     '  _._._._
  898. Global Const PS_DASHDOTDOT = 4  '  _.._.._
  899. Global Const PS_NULL = 5
  900. Global Const PS_INSIDEFRAME = 6
  901.  
  902. ' Device Parameters for GetDeviceCaps()
  903. Global Const DRIVERVERSION = 0  '  Device driver version
  904. Global Const TECHNOLOGY = 2     '  Device classification
  905. Global Const HORZSIZE = 4       '  Horizontal size in millimeters
  906. Global Const VERTSIZE = 6       '  Vertical size in millimeters
  907. Global Const HORZRES = 8        '  Horizontal width in pixels
  908. Global Const VERTRES = 10       '  Vertical width in pixels
  909. Global Const BITSPIXEL = 12     '  Number of bits per pixel
  910. Global Const PLANES = 14        '  Number of planes
  911. Global Const NUMBRUSHES = 16    '  Number of brushes the device has
  912. Global Const NUMPENS = 18       '  Number of pens the device has
  913. Global Const NUMMARKERS = 20    '  Number of markers the device has
  914. Global Const NUMFONTS = 22      '  Number of fonts the device has
  915. Global Const NUMCOLORS = 24     '  Number of colors the device supports
  916. Global Const PDEVICESIZE = 26   '  Size required for device descriptor
  917. Global Const CURVECAPS = 28     '  Curve capabilities
  918. Global Const LINECAPS = 30      '  Line capabilities
  919. Global Const POLYGONALCAPS = 32 '  Polygonal capabilities
  920. Global Const TEXTCAPS = 34      '  Text capabilities
  921. Global Const CLIPCAPS = 36      '  Clipping capabilities
  922. Global Const RASTERCAPS = 38    '  Bitblt capabilities
  923. Global Const ASPECTX = 40       '  Length of the X leg
  924. Global Const ASPECTY = 42       '  Length of the Y leg
  925. Global Const ASPECTXY = 44      '  Length of the hypotenuse
  926.  
  927. Global Const LOGPIXELSX = 88    '  Logical pixels/inch in X
  928. Global Const LOGPIXELSY = 90    '  Logical pixels/inch in Y
  929.  
  930. Global Const SIZEPALETTE = 104  '  Number of entries in physical palette
  931. Global Const NUMRESERVED = 106  '  Number of reserved entries in palette
  932. Global Const COLORRES = 108     '  Actual color resolution
  933.  
  934.  
  935. ' Device Capability Masks:
  936.  
  937. ' Device Technologies
  938. Global Const DT_PLOTTER = 0     '  Vector plotter
  939. Global Const DT_RASDISPLAY = 1  '  Raster display
  940. Global Const DT_RASPRINTER = 2  '  Raster printer
  941. Global Const DT_RASCAMERA = 3   '  Raster camera
  942. Global Const DT_CHARSTREAM = 4  '  Character-stream, PLP
  943. Global Const DT_METAFILE = 5    '  Metafile, VDM
  944. Global Const DT_DISPFILE = 6    '  Display-file
  945.  
  946. ' Curve Capabilities
  947. Global Const CC_NONE = 0        '  Curves not supported
  948. Global Const CC_CIRCLES = 1     '  Can do circles
  949. Global Const CC_PIE = 2 '  Can do pie wedges
  950. Global Const CC_CHORD = 4       '  Can do chord arcs
  951. Global Const CC_ELLIPSES = 8    '  Can do ellipese
  952. Global Const CC_WIDE = 16       '  Can do wide lines
  953. Global Const CC_STYLED = 32     '  Can do styled lines
  954. Global Const CC_WIDESTYLED = 64 '  Can do wide styled lines
  955. Global Const CC_INTERIORS = 128 '  Can do interiors
  956.  
  957. ' Line Capabilities
  958. Global Const LC_NONE = 0        '  Lines not supported
  959. Global Const LC_POLYLINE = 2    '  Can do polylines
  960. Global Const LC_MARKER = 4      '  Can do markers
  961. Global Const LC_POLYMARKER = 8  '  Can do polymarkers
  962. Global Const LC_WIDE = 16       '  Can do wide lines
  963. Global Const LC_STYLED = 32     '  Can do styled lines
  964. Global Const LC_WIDESTYLED = 64 '  Can do wide styled lines
  965. Global Const LC_INTERIORS = 128 '  Can do interiors
  966.  
  967. ' Polygonal Capabilities
  968. Global Const PC_NONE = 0        '  Polygonals not supported
  969. Global Const PC_POLYGON = 1     '  Can do polygons
  970. Global Const PC_RECTANGLE = 2   '  Can do rectangles
  971. Global Const PC_WINDPOLYGON = 4 '  Can do winding polygons
  972. Global Const PC_TRAPEZOID = 4   '  Can do trapezoids
  973. Global Const PC_SCANLINE = 8    '  Can do scanlines
  974. Global Const PC_WIDE = 16       '  Can do wide borders
  975. Global Const PC_STYLED = 32     '  Can do styled borders
  976. Global Const PC_WIDESTYLED = 64 '  Can do wide styled borders
  977. Global Const PC_INTERIORS = 128 '  Can do interiors
  978.  
  979. ' Polygonal Capabilities
  980. Global Const CP_NONE = 0        '  No clipping of output
  981. Global Const CP_RECTANGLE = 1   '  Output clipped to rects
  982.  
  983. ' Text Capabilities
  984. Global Const TC_OP_CHARACTER = &H1      '  Can do OutputPrecision       CHARACTER
  985. Global Const TC_OP_STROKE = &H2 '  Can do OutputPrecision       STROKE
  986. Global Const TC_CP_STROKE = &H4 '  Can do ClipPrecision STROKE
  987. Global Const TC_CR_90 = &H8     '  Can do CharRotAbility        90
  988. Global Const TC_CR_ANY = &H10   '  Can do CharRotAbility        ANY
  989. Global Const TC_SF_X_YINDEP = &H20      '  Can do ScaleFreedom  X_YINDEPENDENT
  990. Global Const TC_SA_DOUBLE = &H40        '  Can do ScaleAbility  DOUBLE
  991. Global Const TC_SA_INTEGER = &H80       '  Can do ScaleAbility  INTEGER
  992. Global Const TC_SA_CONTIN = &H100       '  Can do ScaleAbility  CONTINUOUS
  993. Global Const TC_EA_DOUBLE = &H200       '  Can do EmboldenAbility       DOUBLE
  994. Global Const TC_IA_ABLE = &H400 '  Can do ItalisizeAbility      ABLE
  995. Global Const TC_UA_ABLE = &H800 '  Can do UnderlineAbility      ABLE
  996. Global Const TC_SO_ABLE = &H1000        '  Can do StrikeOutAbility      ABLE
  997. Global Const TC_RA_ABLE = &H2000        '  Can do RasterFontAble        ABLE
  998. Global Const TC_VA_ABLE = &H4000        '  Can do VectorFontAble        ABLE
  999. Global Const TC_RESERVED = &H8000
  1000.  
  1001. ' Raster Capabilities
  1002. Global Const RC_BITBLT = 1      '  Can do standard BLT.
  1003. Global Const RC_BANDING = 2     '  Device requires banding support
  1004. Global Const RC_SCALING = 4     '  Device requires scaling support
  1005. Global Const RC_BITMAP64 = 8    '  Device can support >64K bitmap
  1006. Global Const RC_GDI20_OUTPUT = &H10     '  has 2.0 output calls
  1007. Global Const RC_DI_BITMAP = &H80        '  supports DIB to memory
  1008. Global Const RC_PALETTE = &H100 '  supports a palette
  1009. Global Const RC_DIBTODEV = &H200        '  supports DIBitsToDevice
  1010. Global Const RC_BIGFONT = &H400 '  supports >64K fonts
  1011. Global Const RC_STRETCHBLT = &H800      '  supports StretchBlt
  1012. Global Const RC_FLOODFILL = &H1000      '  supports FloodFill
  1013. Global Const RC_STRETCHDIB = &H2000     '  supports StretchDIBits
  1014.  
  1015. ' palette entry flags
  1016. Global Const PC_RESERVED = &H1  '  palette index used for animation
  1017. Global Const PC_EXPLICIT = &H2  '  palette index is explicit to device
  1018. Global Const PC_NOCOLLAPSE = &H4        '  do not match color to system palette
  1019.  
  1020. ' DIB color table identifiers
  1021. Global Const DIB_RGB_COLORS = 0 '  color table in RGBTriples
  1022. Global Const DIB_PAL_COLORS = 1 '  color table in palette indices
  1023.  
  1024. ' constants for Get/SetSystemPaletteUse()
  1025. Global Const SYSPAL_STATIC = 1
  1026. Global Const SYSPAL_NOSTATIC = 2
  1027.  
  1028. ' constants for CreateDIBitmap
  1029. Global Const CBM_INIT = &H4&    '  initialize bitmap
  1030.  
  1031. ' DrawText() Format Flags
  1032. Global Const DT_TOP = &H0
  1033. Global Const DT_LEFT = &H0
  1034. Global Const DT_CENTER = &H1
  1035. Global Const DT_RIGHT = &H2
  1036. Global Const DT_VCENTER = &H4
  1037. Global Const DT_BOTTOM = &H8
  1038. Global Const DT_WORDBREAK = &H10
  1039. Global Const DT_SINGLELINE = &H20
  1040. Global Const DT_EXPANDTABS = &H40
  1041. Global Const DT_TABSTOP = &H80
  1042. Global Const DT_NOCLIP = &H100
  1043. Global Const DT_EXTERNALLEADING = &H200
  1044. Global Const DT_CALCRECT = &H400
  1045. Global Const DT_NOPREFIX = &H800
  1046. Global Const DT_INTERNAL = &H1000
  1047.  
  1048. Declare Function DrawText Lib "User" (ByVal hDC As Integer, ByVal lpStr As String, ByVal nCount As Integer, lpRect As RECT, ByVal wFormat As Integer) As Integer
  1049. Declare Function DrawIcon Lib "User" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal hIcon As Integer) As Integer
  1050.  
  1051. ' ExtFloodFill style flags
  1052. Global Const FLOODFILLBORDER = 0
  1053. Global Const FLOODFILLSURFACE = 1
  1054.  
  1055. Declare Function GetWindowDC Lib "User" (ByVal hWnd As Integer) As Integer
  1056. Declare Function GetDC Lib "User" (ByVal hWnd As Integer) As Integer
  1057. Declare Function ReleaseDC Lib "User" (ByVal hWnd As Integer, ByVal hDC As Integer) As Integer
  1058. Declare Function CreateDC Lib "GDI" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByVal lpInitData As String) As Integer
  1059. Declare Function CreateIC Lib "GDI" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByVal lpInitData As String) As Integer
  1060. Declare Function CreateCompatibleDC Lib "GDI" (ByVal hDC As Integer) As Integer
  1061. Declare Function DeleteDC Lib "GDI" (ByVal hDC As Integer) As Integer
  1062. Declare Function SaveDC Lib "GDI" (ByVal hDC As Integer) As Integer
  1063. Declare Function RestoreDC Lib "GDI" (ByVal hDC As Integer, ByVal nSavedDC As Integer) As Integer
  1064. Declare Function MoveTo Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1065. Declare Function GetCurrentPosition Lib "GDI" (ByVal hDC As Integer) As Long
  1066. Declare Function LineTo Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  1067. Declare Function GetDCOrg Lib "GDI" (ByVal hDC As Integer) As Long
  1068.  
  1069. Declare Function MulDiv Lib "GDI" (ByVal nNumber As Integer, ByVal nNumerator As Integer, ByVal nDenominator As Integer) As Integer
  1070.  
  1071. Declare Function ExtTextOut Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal wOptions As Integer, lpRect As Any, ByVal lpString As String, ByVal nCount As Integer, lpDx As Any) As Integer
  1072.  
  1073. Declare Function Polyline Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  1074. Declare Function Polygon Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  1075. Declare Function PolyPolygon Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, lpPolyCounts As Integer, ByVal nCount As Integer) As Integer
  1076.  
  1077. Declare Function Rectangle Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1078. Declare Function RoundRect Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer) As Integer
  1079. Declare Function Ellipse Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1080. Declare Function Arc Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer, ByVal X4 As Integer, ByVal Y4 As Integer) As Integer
  1081. Declare Function Chord Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer, ByVal X4 As Integer, ByVal Y4 As Integer) As Integer
  1082. Declare Function Pie Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer, ByVal X4 As Integer, ByVal Y4 As Integer) As Integer
  1083. Declare Function PatBlt Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal dwRop As Long) As Integer
  1084. Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer
  1085. Declare Function StretchBlt% Lib "GDI" (ByVal hDC%, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%, ByVal nSrcWidth%, ByVal nSrcHeight%, ByVal dwRop&)
  1086. Declare Function TextOut Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal lpString As String, ByVal nCount As Integer) As Integer
  1087. Declare Function TabbedTextOut Lib "User" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal lpString As String, ByVal nCount As Integer, ByVal nTabPositions As Integer, lpnTabStopPositions As Integer,ByVal nTabOrigin As Integer) As Long
  1088. Declare Function GetCharWidth Lib "GDI" (ByVal hDC As Integer, ByVal wFirstChar As Integer, ByVal wLastChar As Integer, lpBuffer As Integer) As Integer
  1089. Declare Function SetPixel Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal crColor As Long) As Long
  1090. Declare Function GetPixel Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1091. Declare Function FloodFill Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal crColor As Long) As Integer
  1092. Declare Function ExtFloodFill Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal crColor As Long, ByVal wFillType As Integer) As Integer
  1093.  
  1094. Declare Function GetStockObject Lib "GDI" (ByVal nIndex As Integer) As Integer
  1095.  
  1096. Declare Function CreatePen Lib "GDI" (ByVal nPenStyle As Integer, ByVal nWidth As Integer, ByVal crColor As Long) As Integer
  1097. Declare Function CreatePenIndirect Lib "GDI" (lpLogPen As LOGPEN) As Integer
  1098.  
  1099. Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
  1100. Declare Function CreateHatchBrush Lib "GDI" (ByVal nIndex As Integer, ByVal crColor As Long) As Integer
  1101. Declare Function SetBrushOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1102. Declare Function GetBrushOrg Lib "GDI" (ByVal hDC As Integer) As Long
  1103. Declare Function CreatePatternBrush Lib "GDI" (ByVal hBitmap As Integer) As Integer
  1104. Declare Function CreateBrushIndirect Lib "GDI" (lpLogBrush As LOGBRUSH) As Integer
  1105.  
  1106. Declare Function CreateBitmap Lib "GDI" (ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal nPlanes As Integer, ByVal nBitCount As Integer, ByVal lpBits As Any) As Integer
  1107. Declare Function CreateBitmapIndirect Lib "GDI" (lpBitmap As BITMAP) As Integer
  1108. Declare Function CreateCompatibleBitmap Lib "GDI" (ByVal hDC As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer
  1109. Declare Function CreateDiscardableBitmap Lib "GDI" (ByVal hDC As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer
  1110.  
  1111. Declare Function SetBitmapBits Lib "GDI" (ByVal hBitmap As Integer, ByVal dwCount As Long, ByVal lpBits As Any) As Long
  1112. Declare Function GetBitmapBits Lib "GDI" (ByVal hBitmap As Integer, ByVal dwCount As Long, ByVal lpBits As Any) As Long
  1113. Declare Function SetBitmapDimension Lib "GDI" (ByVal hBitmap As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1114. Declare Function GetBitmapDimension Lib "GDI" (ByVal hBitmap As Integer) As Long
  1115.  
  1116. Declare Function CreateFont% Lib "GDI" (ByVal H%, ByVal W%, ByVal E%, ByVal O%, ByVal W%, ByVal I%, ByVal U%, ByVal S%, ByVal C%, ByVal OP%, ByVal CP%, ByVal Q%, ByVal PAF%, ByVal F$)
  1117. Declare Function CreateFontIndirect Lib "GDI" (lpLogFont As LOGFONT) As Integer
  1118.  
  1119. Declare Function SelectClipRgn Lib "GDI" (ByVal hDC As Integer, ByVal hRgn As Integer) As Integer
  1120. Declare Function CreateRectRgn Lib "GDI" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1121. Declare Sub SetRectRgn Lib "GDI" (ByVal hRgn As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer)
  1122. Declare Function CreateRectRgnIndirect Lib "GDI" (lpRect As RECT) As Integer
  1123. Declare Function CreateEllipticRgnIndirect Lib "GDI" (lpRect As RECT) As Integer
  1124. Declare Function CreateEllipticRgn Lib "GDI" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1125. Declare Function CreatePolygonRgn Lib "GDI" (lpPoints As POINTAPI, ByVal nCount As Integer, ByVal nPolyFillMode As Integer) As Integer
  1126. Declare Function CreatePolyPolygonRgn Lib "GDI" (lpPoints As POINTAPI, lpPolyCounts As Integer, ByVal nCount As Integer, ByVal nPolyFillMode As Integer) As Integer
  1127. Declare Function CreateRoundRectRgn Lib "GDI" (ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal X3 As Integer, ByVal Y3 As Integer) As Integer
  1128.  
  1129. 'Declare Function GetObject Lib "GDI" (ByVal hObject As Integer, ByVal nCount As Integer, ByVal lpObject As Long) As Integer
  1130. Declare Function GetObjectGDI Lib "GDI" Alias "GetObject" (ByVal hObject As Integer, ByVal nCount As Integer, ByVal lpObject As Long) As Integer
  1131.  
  1132. Declare Function DeleteObject Lib "GDI" (ByVal hObject As Integer) As Integer
  1133. Declare Function SelectObject Lib "GDI" (ByVal hDC As Integer, ByVal hObject As Integer) As Integer
  1134. Declare Function UnrealizeObject Lib "GDI" (ByVal hObject As Integer) As Integer
  1135.  
  1136. Declare Function SetBkColor Lib "GDI" (ByVal hDC As Integer, ByVal crColor As Long) As Long
  1137. Declare Function GetBkColor Lib "GDI" (ByVal hDC As Integer) As Long
  1138. Declare Function SetBkMode Lib "GDI" (ByVal hDC As Integer, ByVal nBkMode As Integer) As Integer
  1139. Declare Function GetBkMode Lib "GDI" (ByVal hDC As Integer) As Integer
  1140. Declare Function SetTextColor Lib "GDI" (ByVal hDC As Integer, ByVal crColor As Long) As Long
  1141. Declare Function GetTextColor Lib "GDI" (ByVal hDC As Integer) As Long
  1142. Declare Function SetTextAlign Lib "GDI" (ByVal hDC As Integer, ByVal wFlags As Integer) As Integer
  1143. Declare Function GetTextAlign Lib "GDI" (ByVal hDC As Integer) As Integer
  1144. Declare Function SetMapperFlags Lib "GDI" (ByVal hDC As Integer, ByVal dwFlag As Long) As Long
  1145. Declare Function GetAspectRatioFilter Lib "GDI" (ByVal hDC As Integer) As Long
  1146. Declare Function GetNearestColor Lib "GDI" (ByVal hDC As Integer, ByVal crColor As Long) As Long
  1147. Declare Function SetROP2 Lib "GDI" (ByVal hDC As Integer, ByVal nDrawMode As Integer) As Integer
  1148. Declare Function GetROP2 Lib "GDI" (ByVal hDC As Integer) As Integer
  1149. Declare Function SetStretchBltMode Lib "GDI" (ByVal hDC As Integer, ByVal nStretchMode As Integer) As Integer
  1150. Declare Function GetStretchBltMode Lib "GDI" (ByVal hDC As Integer) As Integer
  1151. Declare Function SetPolyFillMode Lib "GDI" (ByVal hDC As Integer, ByVal nPolyFillMode As Integer) As Integer
  1152. Declare Function GetPolyFillMode Lib "GDI" (ByVal hDC As Integer) As Integer
  1153. Declare Function SetMapMode Lib "GDI" (ByVal hDC As Integer, ByVal nMapMode As Integer) As Integer
  1154. Declare Function GetMapMode Lib "GDI" (ByVal hDC As Integer) As Integer
  1155. Declare Function SetWindowOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1156. Declare Function GetWindowOrg Lib "GDI" (ByVal hDC As Integer) As Long
  1157. Declare Function SetWindowExt Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1158. Declare Function GetWindowExt Lib "GDI" (ByVal hDC As Integer) As Long
  1159. Declare Function SetViewportOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1160. Declare Function GetViewportOrg Lib "GDI" (ByVal hDC As Integer) As Long
  1161. Declare Function SetViewportExt Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1162. Declare Function GetViewportExt Lib "GDI" (ByVal hDC As Integer) As Long
  1163. Declare Function OffsetViewportOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1164. Declare Function ScaleViewportExt Lib "GDI" (ByVal hDC As Integer, ByVal Xnum As Integer, ByVal Xdenom As Integer, ByVal Ynum As Integer, ByVal Ydenom As Integer) As Long
  1165. Declare Function OffsetWindowOrg Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  1166. Declare Function ScaleWindowExt Lib "GDI" (ByVal hDC As Integer, ByVal Xnum As Integer, ByVal Xdenom As Integer, ByVal Ynum As Integer, ByVal Ydenom As Integer) As Long
  1167.  
  1168. Declare Function GetClipBox Lib "GDI" (ByVal hDC As Integer, lpRect As RECT) As Integer
  1169. Declare Function IntersectClipRect Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1170. Declare Function OffsetClipRgn Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  1171. Declare Function ExcludeClipRect Lib "GDI" (ByVal hDC As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) As Integer
  1172. Declare Function PtVisible Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  1173. Declare Function CombineRgn Lib "GDI" (ByVal hDestRgn As Integer, ByVal hSrcRgn1 As Integer, ByVal hSrcRgn2 As Integer, ByVal nCombineMode As Integer) As Integer
  1174. Declare Function EqualRgn Lib "GDI" (ByVal hSrcRgn1 As Integer, ByVal hSrcRgn2 As Integer) As Integer
  1175. Declare Function OffsetRgn Lib "GDI" (ByVal hRgn As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  1176. Declare Function GetRgnBox Lib "GDI" (ByVal hRgn As Integer, lpRect As RECT) As Integer
  1177.  
  1178. Declare Function SetTextJustification Lib "GDI" (ByVal hDC As Integer, ByVal nBreakExtra As Integer, ByVal nBreakCount As Integer) As Integer
  1179. Declare Function GetTextExtent Lib "GDI" (ByVal hDC As Integer, ByVal lpString As String, ByVal nCount As Integer) As Long
  1180. Declare Function GetTabbedTextExtent Lib "GDI" (ByVal hDC As Integer, ByVal lpString As String, ByVal nCount As Integer, ByVal nTabPositions As Integer, lpnTabStopPositions As Integer) As Long
  1181. Declare Function SetTextCharacterExtra Lib "GDI" (ByVal hDC As Integer, ByVal nCharExtra As Integer) As Integer
  1182. Declare Function GetTextCharacterExtra Lib "GDI" (ByVal hDC As Integer) As Integer
  1183.  
  1184. Declare Function GetMetaFile Lib "GDI" (ByVal lpFilename As String) As Integer
  1185. Declare Function DeleteMetaFile Lib "GDI" (ByVal hMF As Integer) As Integer
  1186. Declare Function CopyMetaFile Lib "GDI" (ByVal hMF As Integer, ByVal lpFilename As String) As Integer
  1187.  
  1188. Declare Function PlayMetaFile Lib "GDI" (ByVal hDC As Integer, ByVal hMF As Integer) As Integer
  1189. Declare Sub PlayMetaFileRecord Lib "GDI" (ByVal hDC As Integer, lpHandletable As Integer, lpMetaRecord As METARECORD, ByVal nHandles As Integer)
  1190.  
  1191. Declare Function Escape Lib "GDI" (ByVal hDC As Integer, ByVal nEscape As Integer, ByVal nCount As Integer, ByVal lplnData As Any, ByVal lpOutData As Any) As Integer
  1192. Declare Function GetTextFace Lib "GDI" (ByVal hDC As Integer, ByVal nCount As Integer, ByVal lpFacename As String) As Integer
  1193.  
  1194. Declare Function GetTextMetrics Lib "GDI" (ByVal hDC As Integer, lpMetrics As TEXTMETRIC) As Integer
  1195.  
  1196. Declare Function GetDeviceCaps Lib "GDI" (ByVal hDC As Integer, ByVal nIndex As Integer) As Integer
  1197.  
  1198. Declare Function SetEnvironment Lib "GDI" (ByVal lpPortName As String, ByVal lpEnviron As String, ByVal nCount As Integer) As Integer
  1199. Declare Function GetEnvironment Lib "GDI" (ByVal lpPortName As String, lpEnviron As Any, ByVal nMaxCount As Integer) As Integer
  1200.  
  1201. Declare Function DPtoLP Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  1202. Declare Function LPtoDP Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  1203.  
  1204. Declare Function CreateMetaFile Lib "GDI" (lpString As Any) As Integer
  1205. Declare Function CloseMetaFile Lib "GDI" (ByVal hMF As Integer) As Integer
  1206. Declare Function GetMetaFileBits Lib "GDI" (ByVal hMF As Integer) As Integer
  1207. Declare Function SetMetaFileBits Lib "GDI" (ByVal hMem As Integer) As Integer
  1208.  
  1209. Declare Function SetDIBits Lib "GDI" (ByVal aHDC As Integer, ByVal hBitmap As Integer, ByVal nStartScan As Integer, ByVal nNumScans As Integer, ByVal lpBits As String, lpBI As BITMAPINFO, ByVal wUsage As Integer) As Integer
  1210.  
  1211. Declare Function GetDIBits Lib "GDI" (ByVal aHDC As Integer, ByVal hBitmap As Integer, ByVal nStartScan As Integer, ByVal nNumScans As Integer, ByVal lpBits As String, lpBI As BITMAPINFO, ByVal wUsage As Integer) As Integer
  1212.  
  1213. Declare Function SetDIBitsToDevice% Lib "GDI" (ByVal hDC#, ByVal X#, ByVal Y#, ByVal dX#, ByVal dY#, ByVal SrcX#, ByVal SrcY#, ByVal Scan#, ByVal NumScans#, ByVal Bits As String, BitsInfo As BITMAPINFO, ByVal wUsage#) 
  1214.  
  1215. Declare Function CreateDIBitmap Lib "GDI" (ByVal hDC As Integer, lpInfoHeader As BITMAPINFOHEADER, ByVal dwUsage As Long, ByVal lpInitBits As String, lpInitInfo As BITMAPINFO, ByVal wUsage As Integer) As Integer
  1216.  
  1217. Declare Function CreateDIBPatternBrush Lib "GDI" (ByVal hPackedDIB As Integer, ByVal wUsage As Integer) As Integer
  1218.  
  1219. Declare Function StretchDIBits# Lib "GDI" (ByVal hDC#, ByVal X#, ByVal Y#, ByVal dX#, ByVal dY#, ByVal SrcX#, ByVal SrcY#, ByVal wSrcWidth#, ByVal wSrcHeight#, ByVal lpBits As String, lpBitsInfo As BITMAPINFO, ByVal wUsage#, ByVal dwRop&)
  1220.  
  1221.  
  1222. Declare Function CreatePalette Lib "GDI" (lpLogPalette As LOGPALETTE) As Integer
  1223. Declare Function SelectPalette Lib "User" (ByVal hDC As Integer, ByVal hPalette as Integer, ByVal bForceBackground as Integer) As Integer
  1224. Declare Function RealizePalette Lib "User" (ByVal hDC As Integer) As Integer
  1225. Declare Function UpdateColors Lib "GDI" (ByVal hDC As Integer) As Integer
  1226. Declare Sub AnimatePalette Lib "GDI" (ByVal hPalette As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteColors As PALETTEENTRY)
  1227. Declare Function SetPaletteEntries Lib "GDI" (ByVal hPalette As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteEntries As PALETTEENTRY) As Integer
  1228. Declare Function GetPaletteEntries Lib "GDI" (ByVal hPalette As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteEntries As PALETTEENTRY) As Integer
  1229. Declare Function GetNearestPaletteIndex Lib "GDI" (ByVal hPalette As Integer, ByVal crColor As Long) As Integer
  1230. Declare Function ResizePalette Lib "GDI" (ByVal hPalette As Integer, ByVal nNumEntries As Integer) As Integer
  1231.  
  1232. Declare Function GetSystemPaletteEntries Lib "GDI" (ByVal hDC As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteEntries As PALETTEENTRY) As Integer
  1233. Declare Function GetSystemPaletteUse Lib "GDI" (ByVal hDC As Integer) As Integer
  1234. Declare Function SetSystemPaletteUse Lib "GDI" (ByVal hDC As Integer, ByVal wUsage As Integer) As Integer
  1235.  
  1236.  
  1237. ' --------------
  1238. '  USER Section
  1239. ' --------------
  1240.  
  1241. Declare Function wvsprintf Lib "User" (ByVal lpOutput As String, ByVal lpFormat As String, lpArglist As Integer) As Integer
  1242.  
  1243. ' Scroll Bar Constants
  1244. Global Const SB_HORZ = 0
  1245. Global Const SB_VERT = 1
  1246. Global Const SB_CTL = 2
  1247. Global Const SB_BOTH = 3
  1248.  
  1249. ' Scroll Bar Commands
  1250. Global Const SB_LINEUP = 0
  1251. Global Const SB_LINEDOWN = 1
  1252. Global Const SB_PAGEUP = 2
  1253. Global Const SB_PAGEDOWN = 3
  1254. Global Const SB_THUMBPOSITION = 4
  1255. Global Const SB_THUMBTRACK = 5
  1256. Global Const SB_TOP = 6
  1257. Global Const SB_BOTTOM = 7
  1258. Global Const SB_ENDSCROLL = 8
  1259.  
  1260. ' ShowWindow() Commands
  1261. Global Const SW_HIDE = 0
  1262. Global Const SW_SHOWNORMAL = 1
  1263. Global Const SW_NORMAL = 1
  1264. Global Const SW_SHOWMINIMIZED = 2
  1265. Global Const SW_SHOWMAXIMIZED = 3
  1266. Global Const SW_MAXIMIZE = 3
  1267. Global Const SW_SHOWNOACTIVATE = 4
  1268. Global Const SW_SHOW = 5
  1269. Global Const SW_MINIMIZE = 6
  1270. Global Const SW_SHOWMINNOACTIVE = 7
  1271. Global Const SW_SHOWNA = 8
  1272. Global Const SW_RESTORE = 9
  1273.  
  1274. ' Old ShowWindow() Commands
  1275. Global Const HIDE_WINDOW = 0
  1276. Global Const SHOW_OPENWINDOW = 1
  1277. Global Const SHOW_ICONWINDOW = 2
  1278. Global Const SHOW_FULLSCREEN = 3
  1279. Global Const SHOW_OPENNOACTIVATE = 4
  1280.  
  1281. ' Identifiers for the WM_SHOWWINDOW message
  1282. Global Const SW_PARENTCLOSING = 1
  1283. Global Const SW_OTHERZOOM = 2
  1284. Global Const SW_PARENTOPENING = 3
  1285. Global Const SW_OTHERUNZOOM = 4
  1286.  
  1287. ' Region Flags
  1288. Global Const ERRORAPI = 0
  1289. Global Const NULLREGION = 1
  1290. Global Const SIMPLEREGION = 2
  1291. Global Const COMPLEXREGION = 3
  1292.  
  1293. ' CombineRgn() Styles
  1294. Global Const RGN_AND = 1
  1295. Global Const RGN_OR = 2
  1296. Global Const RGN_XOR = 3
  1297. Global Const RGN_DIFF = 4
  1298. Global Const RGN_COPY = 5
  1299.  
  1300. ' Virtual Keys, Standard Set
  1301. Global Const VK_LBUTTON = &H1
  1302. Global Const VK_RBUTTON = &H2
  1303. Global Const VK_CANCEL = &H3
  1304. Global Const VK_MBUTTON = &H4   '  NOT contiguous with L & RBUTTON
  1305. Global Const VK_BACK = &H8
  1306. Global Const VK_TAB = &H9
  1307. Global Const VK_CLEAR = &HC
  1308. Global Const VK_RETURN = &HD
  1309. Global Const VK_SHIFT = &H10
  1310. Global Const VK_CONTROL = &H11
  1311. Global Const VK_MENU = &H12
  1312. Global Const VK_PAUSE = &H13
  1313. Global Const VK_CAPITAL = &H14
  1314. Global Const VK_ESCAPE = &H1B
  1315. Global Const VK_SPACE = &H20
  1316. Global Const VK_PRIOR = &H21
  1317. Global Const VK_NEXT = &H22
  1318. Global Const VK_END = &H23
  1319. Global Const VK_HOME = &H24
  1320. Global Const VK_LEFT = &H25
  1321. Global Const VK_UP = &H26
  1322. Global Const VK_RIGHT = &H27
  1323. Global Const VK_DOWN = &H28
  1324. Global Const VK_SELECT = &H29
  1325. Global Const VK_PRINT = &H2A
  1326. Global Const VK_EXECUTE = &H2B
  1327. Global Const VK_SNAPSHOT = &H2C
  1328. 'Global Const VK_COPY = &H2C    not used by keyboards.
  1329. Global Const VK_INSERT = &H2D
  1330. Global Const VK_DELETE = &H2E
  1331. Global Const VK_HELP = &H2F
  1332.  
  1333. ' VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z'
  1334. ' VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '0'
  1335.  
  1336. Global Const VK_NUMPAD0 = &H60
  1337. Global Const VK_NUMPAD1 = &H61
  1338. Global Const VK_NUMPAD2 = &H62
  1339. Global Const VK_NUMPAD3 = &H63
  1340. Global Const VK_NUMPAD4 = &H64
  1341. Global Const VK_NUMPAD5 = &H65
  1342. Global Const VK_NUMPAD6 = &H66
  1343. Global Const VK_NUMPAD7 = &H67
  1344. Global Const VK_NUMPAD8 = &H68
  1345. Global Const VK_NUMPAD9 = &H69
  1346. Global Const VK_MULTIPLY = &H6A
  1347. Global Const VK_ADD = &H6B
  1348. Global Const VK_SEPARATOR = &H6C
  1349. Global Const VK_SUBTRACT = &H6D
  1350. Global Const VK_DECIMAL = &H6E
  1351. Global Const VK_DIVIDE = &H6F
  1352. Global Const VK_F1 = &H70
  1353. Global Const VK_F2 = &H71
  1354. Global Const VK_F3 = &H72
  1355. Global Const VK_F4 = &H73
  1356. Global Const VK_F5 = &H74
  1357. Global Const VK_F6 = &H75
  1358. Global Const VK_F7 = &H76
  1359. Global Const VK_F8 = &H77
  1360. Global Const VK_F9 = &H78
  1361. Global Const VK_F10 = &H79
  1362. Global Const VK_F11 = &H7A
  1363. Global Const VK_F12 = &H7B
  1364. Global Const VK_F13 = &H7C
  1365. Global Const VK_F14 = &H7D
  1366. Global Const VK_F15 = &H7E
  1367. Global Const VK_F16 = &H7F
  1368.  
  1369. Global Const VK_NUMLOCK = &H90
  1370.  
  1371. ' SetWindowsHook() codes
  1372. Global Const WH_MSGFILTER = (-1)
  1373. Global Const WH_JOURNALRECORD = 0
  1374. Global Const WH_JOURNALPLAYBACK = 1
  1375. Global Const WH_KEYBOARD = 2
  1376. Global Const WH_GETMESSAGE = 3
  1377. Global Const WH_CALLWNDPROC = 4
  1378. Global Const WH_CBT = 5
  1379. Global Const WH_SYSMSGFILTER = 6
  1380. Global Const WH_WINDOWMGR = 7
  1381.  
  1382. ' Hook Codes
  1383. Global Const HC_LPLPFNNEXT = (-2)
  1384. Global Const HC_LPFNNEXT = (-1)
  1385. Global Const HC_ACTION = 0
  1386. Global Const HC_GETNEXT = 1
  1387. Global Const HC_SKIP = 2
  1388. Global Const HC_NOREM = 3
  1389. Global Const HC_NOREMOVE = 3
  1390. Global Const HC_SYSMODALON = 4
  1391. Global Const HC_SYSMODALOFF = 5
  1392.  
  1393. ' CBT Hook Codes
  1394. Global Const HCBT_MOVESIZE = 0
  1395. Global Const HCBT_MINMAX = 1
  1396. Global Const HCBT_QS = 2
  1397.  
  1398. ' WH_MSGFILTER Filter Proc Codes
  1399. Global Const MSGF_DIALOGBOX = 0
  1400. Global Const MSGF_MESSAGEBOX = 1
  1401. Global Const MSGF_MENU = 2
  1402. Global Const MSGF_MOVE = 3
  1403. Global Const MSGF_SIZE = 4
  1404. Global Const MSGF_SCROLLBAR = 5
  1405. Global Const MSGF_NEXTWINDOW = 6
  1406.  
  1407. ' Window Manager Hook Codes
  1408. Global Const WC_INIT = 1
  1409. Global Const WC_SWP = 2
  1410. Global Const WC_DEFWINDOWPROC = 3
  1411. Global Const WC_MINMAX = 4
  1412. Global Const WC_MOVE = 5
  1413. Global Const WC_SIZE = 6
  1414. Global Const WC_DRAWCAPTION = 7
  1415.  
  1416. ' Message Structure used in Journaling
  1417. Type EVENTMSG
  1418.     message As Integer
  1419.     paramL As Integer
  1420.     paramH As Integer
  1421.     time As Long
  1422. End Type
  1423.  
  1424. ' Message structure
  1425. Type MSG
  1426.     hwnd As Integer
  1427.     message As Integer
  1428.     wParam As Integer
  1429.     lParam As Long
  1430.     time As Long
  1431.     pt As POINTAPI
  1432. End Type
  1433.  
  1434.  
  1435. ' Window field offsets for GetWindowLong() and GetWindowWord()
  1436. Global Const GWL_WNDPROC = (-4)
  1437. Global Const GWW_HINSTANCE = (-6)
  1438. Global Const GWW_HWNDPARENT = (-8)
  1439. Global Const GWW_ID = (-12)
  1440. Global Const GWL_STYLE = (-16)
  1441. Global Const GWL_EXSTYLE = (-20)
  1442.  
  1443. ' Class field offsets for GetClassLong() and GetClassWord()
  1444. Global Const GCL_MENUNAME = (-8)
  1445. Global Const GCW_HBRBACKGROUND = (-10)
  1446. Global Const GCW_HCURSOR = (-12)
  1447. Global Const GCW_HICON = (-14)
  1448. Global Const GCW_HMODULE = (-16)
  1449. Global Const GCW_CBWNDEXTRA = (-18)
  1450. Global Const GCW_CBCLSEXTRA = (-20)
  1451. Global Const GCL_WNDPROC = (-24)
  1452. Global Const GCW_STYLE = (-26)
  1453.  
  1454. ' Window Messages
  1455. Global Const WM_NULL = &H0
  1456. Global Const WM_CREATE = &H1
  1457. Global Const WM_DESTROY = &H2
  1458. Global Const WM_MOVE = &H3
  1459. Global Const WM_SIZE = &H5
  1460. Global Const WM_ACTIVATE = &H6
  1461. Global Const WM_SETFOCUS = &H7
  1462. Global Const WM_KILLFOCUS = &H8
  1463. Global Const WM_ENABLE = &HA
  1464. Global Const WM_SETREDRAW = &HB
  1465. Global Const WM_SETTEXT = &HC
  1466. Global Const WM_GETTEXT = &HD
  1467. Global Const WM_GETTEXTLENGTH = &HE
  1468. Global Const WM_PAINT = &HF
  1469. Global Const WM_CLOSE = &H10
  1470. Global Const WM_QUERYENDSESSION = &H11
  1471. Global Const WM_QUIT = &H12
  1472. Global Const WM_QUERYOPEN = &H13
  1473. Global Const WM_ERASEBKGND = &H14
  1474. Global Const WM_SYSCOLORCHANGE = &H15
  1475. Global Const WM_ENDSESSION = &H16
  1476. Global Const WM_SHOWWINDOW = &H18
  1477. Global Const WM_CTLCOLOR = &H19
  1478. Global Const WM_WININICHANGE = &H1A
  1479. Global Const WM_DEVMODECHANGE = &H1B
  1480. Global Const WM_ACTIVATEAPP = &H1C
  1481. Global Const WM_FONTCHANGE = &H1D
  1482. Global Const WM_TIMECHANGE = &H1E
  1483. Global Const WM_CANCELMODE = &H1F
  1484. Global Const WM_SETCURSOR = &H20
  1485. Global Const WM_MOUSEACTIVATE = &H21
  1486. Global Const WM_CHILDACTIVATE = &H22
  1487. Global Const WM_QUEUESYNC = &H23
  1488. Global Const WM_GETMINMAXINFO = &H24
  1489. Global Const WM_PAINTICON = &H26
  1490. Global Const WM_ICONERASEBKGND = &H27
  1491. Global Const WM_NEXTDLGCTL = &H28
  1492. Global Const WM_SPOOLERSTATUS = &H2A
  1493. Global Const WM_DRAWITEM = &H2B
  1494. Global Const WM_MEASUREITEM = &H2C
  1495. Global Const WM_DELETEITEM = &H2D
  1496. Global Const WM_VKEYTOITEM = &H2E
  1497. Global Const WM_CHARTOITEM = &H2F
  1498. Global Const WM_SETFONT = &H30
  1499. Global Const WM_GETFONT = &H31
  1500.  
  1501. Global Const WM_QUERYDRAGICON = &H37
  1502.  
  1503. Global Const WM_COMPAREITEM = &H39
  1504. Global Const WM_COMPACTING = &H41
  1505.  
  1506. Global Const WM_NCCREATE = &H81
  1507. Global Const WM_NCDESTROY = &H82
  1508. Global Const WM_NCCALCSIZE = &H83
  1509. Global Const WM_NCHITTEST = &H84
  1510. Global Const WM_NCPAINT = &H85
  1511. Global Const WM_NCACTIVATE = &H86
  1512. Global Const WM_GETDLGCODE = &H87
  1513. Global Const WM_NCMOUSEMOVE = &HA0
  1514. Global Const WM_NCLBUTTONDOWN = &HA1
  1515. Global Const WM_NCLBUTTONUP = &HA2
  1516. Global Const WM_NCLBUTTONDBLCLK = &HA3
  1517. Global Const WM_NCRBUTTONDOWN = &HA4
  1518. Global Const WM_NCRBUTTONUP = &HA5
  1519. Global Const WM_NCRBUTTONDBLCLK = &HA6
  1520. Global Const WM_NCMBUTTONDOWN = &HA7
  1521. Global Const WM_NCMBUTTONUP = &HA8
  1522. Global Const WM_NCMBUTTONDBLCLK = &HA9
  1523.  
  1524. Global Const WM_KEYFIRST = &H100
  1525. Global Const WM_KEYDOWN = &H100
  1526. Global Const WM_KEYUP = &H101
  1527. Global Const WM_CHAR = &H102
  1528. Global Const WM_DEADCHAR = &H103
  1529. Global Const WM_SYSKEYDOWN = &H104
  1530. Global Const WM_SYSKEYUP = &H105
  1531. Global Const WM_SYSCHAR = &H106
  1532. Global Const WM_SYSDEADCHAR = &H107
  1533. Global Const WM_KEYLAST = &H108
  1534.  
  1535. Global Const WM_INITDIALOG = &H110
  1536. Global Const WM_COMMAND = &H111
  1537. Global Const WM_SYSCOMMAND = &H112
  1538. Global Const WM_TIMER = &H113
  1539. Global Const WM_HSCROLL = &H114
  1540. Global Const WM_VSCROLL = &H115
  1541. Global Const WM_INITMENU = &H116
  1542. Global Const WM_INITMENUPOPUP = &H117
  1543. Global Const WM_MENUSELECT = &H11F
  1544. Global Const WM_MENUCHAR = &H120
  1545. Global Const WM_ENTERIDLE = &H121
  1546.  
  1547. Global Const WM_MOUSEFIRST = &H200
  1548. Global Const WM_MOUSEMOVE = &H200
  1549. Global Const WM_LBUTTONDOWN = &H201
  1550. Global Const WM_LBUTTONUP = &H202
  1551. Global Const WM_LBUTTONDBLCLK = &H203
  1552. Global Const WM_RBUTTONDOWN = &H204
  1553. Global Const WM_RBUTTONUP = &H205
  1554. Global Const WM_RBUTTONDBLCLK = &H206
  1555. Global Const WM_MBUTTONDOWN = &H207
  1556. Global Const WM_MBUTTONUP = &H208
  1557. Global Const WM_MBUTTONDBLCLK = &H209
  1558. Global Const WM_MOUSELAST = &H209
  1559.  
  1560. Global Const WM_PARENTNOTIFY = &H210
  1561. Global Const WM_MDICREATE = &H220
  1562. Global Const WM_MDIDESTROY = &H221
  1563. Global Const WM_MDIACTIVATE = &H222
  1564. Global Const WM_MDIRESTORE = &H223
  1565. Global Const WM_MDINEXT = &H224
  1566. Global Const WM_MDIMAXIMIZE = &H225
  1567. Global Const WM_MDITILE = &H226
  1568. Global Const WM_MDICASCADE = &H227
  1569. Global Const WM_MDIICONARRANGE = &H228
  1570. Global Const WM_MDIGETACTIVE = &H229
  1571. Global Const WM_MDISETMENU = &H230
  1572.  
  1573. Global Const WM_CUT = &H300
  1574. Global Const WM_COPY = &H301
  1575. Global Const WM_PASTE = &H302
  1576. Global Const WM_CLEAR = &H303
  1577. Global Const WM_UNDO = &H304
  1578. Global Const WM_RENDERFORMAT = &H305
  1579. Global Const WM_RENDERALLFORMATS = &H306
  1580. Global Const WM_DESTROYCLIPBOARD = &H307
  1581. Global Const WM_DRAWCLIPBOARD = &H308
  1582. Global Const WM_PAINTCLIPBOARD = &H309
  1583. Global Const WM_VSCROLLCLIPBOARD = &H30A
  1584. Global Const WM_SIZECLIPBOARD = &H30B
  1585. Global Const WM_ASKCBFORMATNAME = &H30C
  1586. Global Const WM_CHANGECBCHAIN = &H30D
  1587. Global Const WM_HSCROLLCLIPBOARD = &H30E
  1588. Global Const WM_QUERYNEWPALETTE = &H30F
  1589. Global Const WM_PALETTEISCHANGING = &H310
  1590. Global Const WM_PALETTECHANGED = &H311
  1591.  
  1592. ' NOTE: All Message Numbers below 0x0400 are RESERVED.
  1593.  
  1594. ' Private Window Messages Start Here:
  1595. Global Const WM_USER = &H400
  1596.  
  1597. ' WM_SYNCTASK Commands
  1598. Global Const ST_BEGINSWP = 0
  1599. Global Const ST_ENDSWP = 1
  1600.  
  1601. ' WinWhere() Area Codes
  1602. Global Const HTERROR = (-2)
  1603. Global Const HTTRANSPARENT = (-1)
  1604. Global Const HTNOWHERE = 0
  1605. Global Const HTCLIENT = 1
  1606. Global Const HTCAPTION = 2
  1607. Global Const HTSYSMENU = 3
  1608. Global Const HTGROWBOX = 4
  1609. Global Const HTSIZE = HTGROWBOX
  1610. Global Const HTMENU = 5
  1611. Global Const HTHSCROLL = 6
  1612. Global Const HTVSCROLL = 7
  1613. Global Const HTREDUCE = 8
  1614. Global Const HTZOOM = 9
  1615. Global Const HTLEFT = 10
  1616. Global Const HTRIGHT = 11
  1617. Global Const HTTOP = 12
  1618. Global Const HTTOPLEFT = 13
  1619. Global Const HTTOPRIGHT = 14
  1620. Global Const HTBOTTOM = 15
  1621. Global Const HTBOTTOMLEFT = 16
  1622. Global Const HTBOTTOMRIGHT = 17
  1623. Global Const HTSIZEFIRST = HTLEFT
  1624. Global Const HTSIZELAST = HTBOTTOMRIGHT
  1625.  
  1626. ' WM_MOUSEACTIVATE Return Codes
  1627. Global Const MA_ACTIVATE = 1
  1628. Global Const MA_ACTIVATEANDEAT = 2
  1629. Global Const MA_NOACTIVATE = 3
  1630.  
  1631. Declare Function RegisterWindowMessage Lib "User" (ByVal lpString As String) As Integer
  1632.  
  1633. ' Size Message Commands
  1634. Global Const SIZENORMAL = 0
  1635. Global Const SIZEICONIC = 1
  1636. Global Const SIZEFULLSCREEN = 2
  1637. Global Const SIZEZOOMSHOW = 3
  1638. Global Const SIZEZOOMHIDE = 4
  1639.  
  1640. ' Key State Masks for Mouse Messages
  1641. Global Const MK_LBUTTON = &H1
  1642. Global Const MK_RBUTTON = &H2
  1643. Global Const MK_SHIFT = &H4
  1644. Global Const MK_CONTROL = &H8
  1645. Global Const MK_MBUTTON = &H10
  1646.  
  1647. ' Window Styles
  1648. Global Const WS_OVERLAPPED = &H00000&
  1649. Global Const WS_POPUP = &H80000000&
  1650. Global Const WS_CHILD = &H40000000&
  1651. Global Const WS_MINIMIZE = &H20000000&
  1652. Global Const WS_VISIBLE = &H10000000&
  1653. Global Const WS_DISABLED = &H8000000&
  1654. Global Const WS_CLIPSIBLINGS = &H4000000&
  1655. Global Const WS_CLIPCHILDREN = &H2000000&
  1656. Global Const WS_MAXIMIZE = &H1000000&
  1657. Global Const WS_CAPTION = &HC00000&     '  WS_BORDER Or WS_DLGFRAME
  1658. Global Const WS_BORDER = &H800000&
  1659. Global Const WS_DLGFRAME = &H400000&
  1660. Global Const WS_VSCROLL = &H200000&
  1661. Global Const WS_HSCROLL = &H100000&
  1662. Global Const WS_SYSMENU = &H80000&
  1663. Global Const WS_THICKFRAME = &H40000&
  1664. Global Const WS_GROUP = &H20000&
  1665. Global Const WS_TABSTOP = &H10000&
  1666.  
  1667. Global Const WS_MINIMIZEBOX = &H20000&
  1668. Global Const WS_MAXIMIZEBOX = &H10000&
  1669.  
  1670. Global Const WS_TILED = WS_OVERLAPPED
  1671. Global Const WS_ICONIC = WS_MINIMIZE
  1672. Global Const WS_SIZEBOX = WS_THICKFRAME
  1673.  
  1674. ' Common Window Styles
  1675. Global Const WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX)
  1676. Global Const WS_POPUPWINDOW = (WS_POPUP Or WS_BORDER Or WS_SYSMENU)
  1677. Global Const WS_CHILDWINDOW = (WS_CHILD)
  1678. Global Const WS_TILEDWINDOW = (WS_OVERLAPPEDWINDOW)
  1679.  
  1680. ' Extended Window Styles
  1681. Global Const WS_EX_DLGMODALFRAME = &H00001&
  1682. Global Const WS_EX_NOPARENTNOTIFY = &H00004&
  1683.  
  1684. ' Class styles
  1685. Global Const CS_VREDRAW = &H1
  1686. Global Const CS_HREDRAW = &H2
  1687. Global Const CS_KEYCVTWINDOW = &H4
  1688. Global Const CS_DBLCLKS = &H8
  1689. Global Const CS_OWNDC = &H20
  1690. Global Const CS_CLASSDC = &H40
  1691. Global Const CS_PARENTDC = &H80
  1692. Global Const CS_NOKEYCVT = &H100
  1693. Global Const CS_NOCLOSE = &H200
  1694. Global Const CS_SAVEBITS = &H800
  1695. Global Const CS_BYTEALIGNCLIENT = &H1000
  1696. Global Const CS_BYTEALIGNWINDOW = &H2000
  1697. Global Const CS_GLOBALCLASS = &H4000    '  Global window class
  1698.  
  1699. ' Predefined Clipboard Formats
  1700. Global Const CF_TEXT = 1
  1701. Global Const CF_BITMAP = 2
  1702. Global Const CF_METAFILEPICT = 3
  1703. Global Const CF_SYLK = 4
  1704. Global Const CF_DIF = 5
  1705. Global Const CF_TIFF = 6
  1706. Global Const CF_OEMTEXT = 7
  1707. Global Const CF_DIB = 8
  1708. Global Const CF_PALETTE = 9
  1709.  
  1710. Global Const CF_OWNERDISPLAY = &H80
  1711. Global Const CF_DSPTEXT = &H81
  1712. Global Const CF_DSPBITMAP = &H82
  1713. Global Const CF_DSPMETAFILEPICT = &H83
  1714.  
  1715. ' "Private" formats don't get GlobalFree()'d
  1716. Global Const CF_PRIVATEFIRST = &H200
  1717. Global Const CF_PRIVATELAST = &H2FF
  1718.  
  1719. ' "GDIOBJ" formats do get DeleteObject()'d
  1720. Global Const CF_GDIOBJFIRST = &H300
  1721. Global Const CF_GDIOBJLAST = &H3FF
  1722.  
  1723. Type PAINTSTRUCT
  1724.     hdc As Integer
  1725.     fErase As Integer
  1726.     rcPaint As RECT
  1727.     fRestore As Integer
  1728.     fIncUpdate As Integer
  1729.     rgbReserved As String * 16
  1730. End Type
  1731.  
  1732. Type CREATESTRUCT
  1733.     lpCreateParams As Long
  1734.     hInstance As Integer
  1735.     hMenu As Integer
  1736.     hwndParent As Integer
  1737.     cy As Integer
  1738.     cx As Integer
  1739.     y As Integer
  1740.     x As Integer
  1741.     style As Long
  1742.     lpszName As Long
  1743.     lpszClass As Long
  1744.     ExStyle As Long
  1745. End Type
  1746.  
  1747. ' Owner draw control types
  1748. Global Const ODT_MENU = 1
  1749. Global Const ODT_LISTBOX = 2
  1750. Global Const ODT_COMBOBOX = 3
  1751. Global Const ODT_BUTTON = 4
  1752.  
  1753. ' Owner draw actions
  1754. Global Const ODA_DRAWENTIRE = &H1
  1755. Global Const ODA_SELECT = &H2
  1756. Global Const ODA_FOCUS = &H4
  1757.  
  1758. ' Owner draw state
  1759. Global Const ODS_SELECTED = &H1
  1760. Global Const ODS_GRAYED = &H2
  1761. Global Const ODS_DISABLED = &H4
  1762. Global Const ODS_CHECKED = &H8
  1763. Global Const ODS_FOCUS = &H10
  1764.  
  1765. ' MEASUREITEMSTRUCT for ownerdraw
  1766. Type MEASUREITEMSTRUCT
  1767.     CtlType As Integer
  1768.     CtlID As Integer
  1769.     itemID As Integer
  1770.     itemWidth As Integer
  1771.     itemHeight As Integer
  1772.     itemData As Long
  1773. End Type
  1774.  
  1775. ' DRAWITEMSTRUCT for ownerdraw
  1776. Type DRAWITEMSTRUCT
  1777.     CtlType As Integer
  1778.     CtlID As Integer
  1779.     itemID As Integer
  1780.     itemAction As Integer
  1781.     itemState As Integer
  1782.     hwndItem As Integer
  1783.     hDC As Integer
  1784.     rcItem As RECT
  1785.     itemData As Long
  1786. End Type
  1787.  
  1788. ' DELETEITEMSTRUCT for ownerdraw
  1789. Type DELETEITEMSTRUCT
  1790.     CtlType As Integer
  1791.     CtlID As Integer
  1792.     itemID As Integer
  1793.     hwndItem As Integer
  1794.     itemData As Long
  1795. End Type
  1796.  
  1797. ' COMPAREITEMSTRUCT for ownerdraw sorting
  1798. Type COMPAREITEMSTRUCT
  1799.     CtlType As Integer
  1800.     CtlID As Integer
  1801.     hwndItem As Integer
  1802.     itemID1 As Integer
  1803.     itemData1 As Long
  1804.     itemID2 As Integer
  1805.     itemData2 As Long
  1806. End Type
  1807.  
  1808. ' Message Function Templates
  1809. Declare Function GetMessage Lib "User" (lpMsg As MSG, ByVal hWnd As Integer, ByVal wMsgFilterMin As Integer, ByVal wMsgFilterMax As Integer) As Integer
  1810. Declare Function TranslateMessage Lib "User" (lpMsg As MSG) As Integer
  1811. Declare Function DispatchMessage Lib "User" (lpMsg As MSG) As Long
  1812. Declare Function PeekMessage Lib "User" (lpMsg As MSG, ByVal hWnd As Integer, ByVal wMsgFilterMin As Integer, ByVal wMsgFilterMax As Integer, ByVal wRemoveMsg As Integer) As Integer
  1813.  
  1814. ' PeekMessage() Options
  1815. Global Const PM_NOREMOVE = &H0
  1816. Global Const PM_REMOVE = &H1
  1817. Global Const PM_NOYIELD = &H2
  1818.  
  1819. Declare Function lstrcmp Lib "User" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Integer
  1820. Declare Function lstrcmpi Lib "User" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Integer
  1821. Declare Function lstrcpy Lib "Kernel" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Long
  1822. Declare Function lstrcat Lib "Kernel" (ByVal lpString1 As Any, ByVal lpString2 As Any) As Long
  1823. Declare Function lstrlen Lib "Kernel" (ByVal lpString As Any) As Integer
  1824.  
  1825. Declare Function lopen Lib "Kernel" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As Integer) As Integer
  1826. Declare Function lclose Lib "Kernel" Alias "_lclose" (ByVal hFile As Integer) As Integer
  1827. Declare Function lcreat Lib "Kernel" Alias "_lcreat" (ByVal lpPathName As String, ByVal iAttribute As Integer) As Integer
  1828. Declare Function llseek Lib "Kernel" Alias "_llseek" (ByVal hFile As Integer, ByVal lOffset As Long, ByVal iOrigin As Integer) As Long
  1829. Declare Function lread Lib "Kernel" Alias "_lread" (ByVal hFile As Integer, ByVal lpBuffer As String, ByVal wBytes As Integer) As Integer
  1830. Declare Function lwrite Lib "Kernel" Alias "_lwrite" (ByVal hFile As Integer, ByVal lpBuffer As String, ByVal wBytes As Integer) As Integer
  1831.  
  1832. Global Const READAPI = 0        '  Flags for _lopen
  1833. Global Const WRITEAPI = 1
  1834. Global Const READ_WRITE = 2
  1835.  
  1836. Declare Function ExitWindows Lib "User" (ByVal dwReturnCode As Long, ByVal wReserved As Integer) As Integer
  1837.  
  1838. Declare Function SwapMouseButton Lib "User" (ByVal bSwap As Integer) As Integer
  1839. Declare Function GetMessagePos Lib "User" () As Long
  1840. Declare Function GetMessageTime Lib "User" () As Long
  1841.  
  1842. Declare Function GetSysModalWindow Lib "User" () As Integer
  1843. Declare Function SetSysModalWindow Lib "User" (ByVal hWnd As Integer) As Integer
  1844.  
  1845. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  1846. Declare Function PostMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Integer
  1847. Declare Function PostAppMessage Lib "User" (ByVal hTask As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Integer
  1848. Declare Sub ReplyMessage Lib "User" (ByVal lReply As Long)
  1849. Declare Sub WaitMessage Lib "User" ()
  1850. Declare Function DefWindowProc Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  1851. Declare Sub PostQuitMessage Lib "User" (ByVal nExitCode As Integer)
  1852. Declare Function InSendMessage Lib "User" () As Integer
  1853.  
  1854. ' Special HWND value for use with PostMessage and SendMessage
  1855. Global Const HWND_BROADCAST = &Hffff
  1856.  
  1857. Declare Function GetDoubleClickTime Lib "User" () As Integer
  1858. Declare Sub SetDoubleClickTime Lib "User" (ByVal wCount As Integer)
  1859.  
  1860. Declare Function UnregisterClass Lib "User" (ByVal lpClassName As String, ByVal hInstance As Integer) As Integer
  1861.  
  1862. Declare Function SetMessageQueue Lib "User" (ByVal cMsg As Integer) As Integer
  1863.  
  1864. Global Const CW_USEDEFAULT = &H8000
  1865. Global Const HWND_DESKTOP = 0
  1866.  
  1867. Declare Function CreateWindow% Lib "User" (ByVal lpClassName$, ByVal lpWindowName$, ByVal dwStyle&, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hWndParent%, ByVal hMenu%, ByVal hInstance%, ByVal lpParam$)
  1868. Declare Function CreateWindowEx% Lib "User" (ByVal dwExStyle&, ByVal lpClassName$, ByVal lpWindowName$, ByVal dwStyle&, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hWndParent%, ByVal hMenu%, ByVal hInstance%, ByVal lpParam$)
  1869. Declare Function IsWindow Lib "User" (ByVal hWnd As Integer) As Integer
  1870. Declare Function IsChild Lib "User" (ByVal hWndParent As Integer, ByVal hWnd As Integer) As Integer
  1871. Declare Function DestroyWindow Lib "User" (ByVal hWnd As Integer) As Integer
  1872.  
  1873. Declare Function ShowWindow Lib "User" (ByVal hWnd As Integer, ByVal nCmdShow As Integer) As Integer
  1874. Declare Function FlashWindow Lib "User" (ByVal hWnd As Integer, ByVal bInvert As Integer) As Integer
  1875. Declare Sub ShowOwnedPopups Lib "User" (ByVal hWnd As Integer, ByVal fShow As Integer)
  1876.  
  1877. Declare Function OpenIcon Lib "User" (ByVal hWnd As Integer) As Integer
  1878. Declare Sub CloseWindow Lib "User" (ByVal hWnd As Integer)
  1879. Declare Sub MoveWindow Lib "User" (ByVal hWnd As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal bRepaint As Integer)
  1880. Declare Sub SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
  1881.  
  1882. Declare Function BeginDeferWindowPos Lib "User" (ByVal nNumWindows As Integer)
  1883. Declare Function DeferWindowPos Lib "User" (ByVal hWinPosInfo As Integer, ByVal hWnd as Integer, ByVal hWndInsertAfter as Integer, ByVal x, ByVal y, ByVal cx, ByVal cy, ByVal wFlags as Integer)
  1884. Declare Sub EndDeferWindowPos Lib "User" (ByVal hWinPosInfo As Integer)
  1885.  
  1886. Declare Function IsWindowVisible Lib "User" (ByVal hWnd As Integer) As Integer
  1887. Declare Function IsIconic Lib "User" (ByVal hWnd As Integer) As Integer
  1888. Declare Function AnyPopup Lib "User" () As Integer
  1889. Declare Sub BringWindowToTop Lib "User" (ByVal hWnd As Integer)
  1890. Declare Function IsZoomed Lib "User" (ByVal hWnd As Integer) As Integer
  1891.  
  1892. ' SetWindowPos Flags
  1893. Global Const SWP_NOSIZE = &H1
  1894. Global Const SWP_NOMOVE = &H2
  1895. Global Const SWP_NOZORDER = &H4
  1896. Global Const SWP_NOREDRAW = &H8
  1897. Global Const SWP_NOACTIVATE = &H10
  1898. Global Const SWP_DRAWFRAME = &H20
  1899. Global Const SWP_SHOWWINDOW = &H40
  1900. Global Const SWP_HIDEWINDOW = &H80
  1901. Global Const SWP_NOCOPYBITS = &H100
  1902. Global Const SWP_NOREPOSITION = &H200
  1903.  
  1904. ' SetWindowPos() hwndInsertAfter values
  1905. Global Const HWND_TOP = 0
  1906. Global Const HWND_BOTTOM = 1
  1907. Global Const HWND_TOPMOST = -1
  1908. Global Const HWND_NOTOPMOST = -2
  1909.  
  1910. Declare Sub EndDialog Lib "User" (ByVal hDlg As Integer, ByVal nResult As Integer)
  1911. Declare Function GetDlgItem Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer) As Integer
  1912. Declare Sub SetDlgItemInt Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, ByVal wValue As Integer, ByVal bSigned As Integer)
  1913. Declare Function GetDlgItemInt Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, lpTranslated As Integer, ByVal bSigned As Integer) As Integer
  1914. Declare Sub SetDlgItemText Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, ByVal lpString As String)
  1915. Declare Function GetDlgItemText Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, ByVal lpString As String, ByVal nMaxCount As Integer) As Integer
  1916. Declare Sub CheckDlgButton Lib "User" (ByVal hDlg As Integer, ByVal nIDButton As Integer, ByVal wCheck As Integer)
  1917. Declare Sub CheckRadioButton Lib "User" (ByVal hDlg As Integer, ByVal nIDFirstButton As Integer, ByVal nIDLastButton As Integer, ByVal nIDCheckButton As Integer)
  1918. Declare Function IsDlgButtonChecked Lib "User" (ByVal hDlg As Integer, ByVal nIDButton As Integer) As Integer
  1919. Declare Function SendDlgItemMessage Lib "User" (ByVal hDlg As Integer, ByVal nIDDlgItem As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  1920. Declare Function GetNextDlgGroupItem Lib "User" (ByVal hDlg As Integer, ByVal hCtl As Integer, ByVal bPrevious As Integer) As Integer
  1921. Declare Function GetNextDlgTabItem Lib "User" (ByVal hDlg As Integer, ByVal hCtl As Integer, ByVal bPrevious As Integer) As Integer
  1922. Declare Function GetDlgCtrlID Lib "User" (ByVal hWnd As Integer) As Integer
  1923. Declare Function GetDialogBaseUnits Lib "User" () As Long
  1924. Declare Function DefDlgProc Lib "User" (ByVal hDlg As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  1925.  
  1926. Global Const DLGWINDOWEXTRA = 30        '  Window extra bytes needed for private dialog classes
  1927.  
  1928. Declare Function CallMsgFilter Lib "User" (lpMsg As MSG, ByVal nCode As Integer) As Integer
  1929.  
  1930. ' Clipboard Manager Functions
  1931. Declare Function OpenClipboard Lib "User" (ByVal hWnd As Integer) As Integer
  1932. Declare Function CloseClipboard Lib "User" () As Integer
  1933. Declare Function GetClipboardOwner Lib "User" () As Integer
  1934. Declare Function SetClipboardViewer Lib "User" (ByVal hWnd As Integer) As Integer
  1935. Declare Function GetClipboardViewer Lib "User" () As Integer
  1936. Declare Function ChangeClipboardChain Lib "User" (ByVal hWnd As Integer, ByVal hWndNext As Integer) As Integer
  1937. Declare Function SetClipboardData Lib "User" (ByVal wFormat As Integer, ByVal hMem As Integer) As Integer
  1938. Declare Function GetClipboardData Lib "User" (ByVal wFormat As Integer) As Integer
  1939. Declare Function RegisterClipboardFormat Lib "User" (ByVal lpString As String) As Integer
  1940. Declare Function CountClipboardFormats Lib "User" () As Integer
  1941. Declare Function EnumClipboardFormats Lib "User" (ByVal wFormat As Integer) As Integer
  1942. Declare Function GetClipboardFormatName Lib "User" (ByVal wFormat As Integer, ByVal lpString As String, ByVal nMaxCount As Integer) As Integer
  1943. Declare Function EmptyClipboard Lib "User" () As Integer
  1944. Declare Function IsClipboardFormatAvailable Lib "User" (ByVal wFormat As Integer) As Integer
  1945. Declare Function GetPriorityClipboardFormat Lib "User" (lpPriorityList As Integer, ByVal nCount As Integer) As Integer
  1946.  
  1947. Declare Function SetFocusAPI Lib "User" Alias "SetFocus" (ByVal hWnd As Integer) As Integer
  1948. Declare Function GetFocus Lib "User" () As Integer
  1949. Declare Function GetActiveWindow Lib "User" () As Integer
  1950. Declare Function GetKeyState Lib "User" (ByVal nVirtKey As Integer) As Integer
  1951. Declare Function GetAsyncKeyState Lib "User" (ByVal vKey As Integer) As Integer
  1952. Declare Sub GetKeyboardState Lib "User" (LpKeyState As Any)
  1953. Declare Sub SetKeyboardState Lib "User" (lpKeyState As Any)
  1954. Declare Function EnableHardwareInput Lib "User" (ByVal bEnableInput As Integer) As Integer
  1955. Declare Function GetInputState Lib "User" () As Integer
  1956. Declare Function GetCapture Lib "User" () As Integer
  1957. Declare Function SetCapture Lib "User" (ByVal hWnd As Integer) As Integer
  1958. Declare Sub ReleaseCapture Lib "User" ()
  1959.  
  1960. ' Windows Functions
  1961. Declare Function KillTimer Lib "User" (ByVal hWnd As Integer, ByVal nIDEvent As Integer) As Integer
  1962.  
  1963. Declare Function EnableWindow Lib "User" (ByVal hWnd As Integer, ByVal aBOOL As Integer) As Integer
  1964. Declare Function IsWindowEnabled Lib "User" (ByVal hWnd As Integer) As Integer
  1965.  
  1966. Declare Function LoadAccelerators Lib "User" (ByVal hInstance As Integer, ByVal lpTableName As String) As Integer
  1967.  
  1968. Declare Function TranslateAccelerator Lib "User" (ByVal hWnd As Integer, ByVal hAccTable As Integer, lpMsg As MSG) As Integer
  1969.  
  1970.  
  1971. ' GetSystemMetrics() codes
  1972. Global Const SM_CXSCREEN = 0
  1973. Global Const SM_CYSCREEN = 1
  1974. Global Const SM_CXVSCROLL = 2
  1975. Global Const SM_CYHSCROLL = 3
  1976. Global Const SM_CYCAPTION = 4
  1977. Global Const SM_CXBORDER = 5
  1978. Global Const SM_CYBORDER = 6
  1979. Global Const SM_CXDLGFRAME = 7
  1980. Global Const SM_CYDLGFRAME = 8
  1981. Global Const SM_CYVTHUMB = 9
  1982. Global Const SM_CXHTHUMB = 10
  1983. Global Const SM_CXICON = 11
  1984. Global Const SM_CYICON = 12
  1985. Global Const SM_CXCURSOR = 13
  1986. Global Const SM_CYCURSOR = 14
  1987. Global Const SM_CYMENU = 15
  1988. Global Const SM_CXFULLSCREEN = 16
  1989. Global Const SM_CYFULLSCREEN = 17
  1990. Global Const SM_CYKANJIWINDOW = 18
  1991. Global Const SM_MOUSEPRESENT = 19
  1992. Global Const SM_CYVSCROLL = 20
  1993. Global Const SM_CXHSCROLL = 21
  1994. Global Const SM_DEBUG = 22
  1995. Global Const SM_SWAPBUTTON = 23
  1996. Global Const SM_RESERVED1 = 24
  1997. Global Const SM_RESERVED2 = 25
  1998. Global Const SM_RESERVED3 = 26
  1999. Global Const SM_RESERVED4 = 27
  2000. Global Const SM_CXMIN = 28
  2001. Global Const SM_CYMIN = 29
  2002. Global Const SM_CXSIZE = 30
  2003. Global Const SM_CYSIZE = 31
  2004. Global Const SM_CXFRAME = 32
  2005. Global Const SM_CYFRAME = 33
  2006. Global Const SM_CXMINTRACK = 34
  2007. Global Const SM_CYMINTRACK = 35
  2008. Global Const SM_CMETRICS = 36
  2009.  
  2010. Declare Function GetSystemMetrics Lib "User" (ByVal nIndex As Integer) As Integer
  2011.  
  2012. Declare Function LoadMenu Lib "User" (ByVal hInstance As Integer, ByVal lpString As String) As Integer
  2013. Declare Function LoadMenuIndirect Lib "User" (lpMenuTemplate As Any) As Integer
  2014. Declare Function GetMenu Lib "User" (ByVal hWnd As Integer) As Integer
  2015. Declare Function SetMenu Lib "User" (ByVal hWnd As Integer, ByVal hMenu As Integer) As Integer
  2016. Declare Function ChangeMenu Lib "User" (ByVal hMenu As Integer, ByVal wID As Integer, ByVal lpszNew As String, ByVal wIDNew As Integer, ByVal wChange As Integer) As Integer
  2017. Declare Function HiliteMenuItem Lib "User" (ByVal hWnd As Integer, ByVal hMenu As Integer, ByVal wIDHiliteItem As Integer, ByVal wHilite As Integer) As Integer
  2018. Declare Function GetMenuString Lib "User" (ByVal hMenu As Integer, ByVal wIDItem As Integer, ByVal lpString As String, ByVal nMaxCount As Integer, ByVal wFlag As Integer) As Integer
  2019. Declare Function GetMenuState Lib "User" (ByVal hMenu As Integer, ByVal wId As Integer, ByVal wFlags As Integer) As Integer
  2020. Declare Sub DrawMenuBar Lib "User" (ByVal hWnd As Integer)
  2021. Declare Function GetSystemMenu Lib "User" (ByVal hWnd As Integer, ByVal bRevert As Integer) As Integer
  2022. Declare Function CreateMenu Lib "User" () As Integer
  2023. Declare Function CreatePopupMenu Lib "User" () As Integer
  2024. Declare Function DestroyMenu Lib "User" (ByVal hMenu As Integer) As Integer
  2025. Declare Function CheckMenuItem Lib "User" (ByVal hMenu As Integer, ByVal wIDCheckItem As Integer, ByVal wCheck As Integer) As Integer
  2026. Declare Function EnableMenuItem Lib "User" (ByVal hMenu As Integer, ByVal wIDEnableItem As Integer, ByVal wEnable As Integer) As Integer
  2027. Declare Function GetSubMenu Lib "User" (ByVal hMenu As Integer, ByVal nPos As Integer) As Integer
  2028. Declare Function GetMenuItemID Lib "User" (ByVal hMenu As Integer, ByVal nPos As Integer) As Integer
  2029. Declare Function GetMenuItemCount Lib "User" (ByVal hMenu As Integer) As Integer
  2030.  
  2031. Declare Function InsertMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer, ByVal wIDNewItem As Integer, ByVal lpNewItem As Any) As Integer
  2032. Declare Function AppendMenu Lib "User" (ByVal hMenu As Integer, ByVal wFlags As Integer, ByVal wIDNewItem As Integer, ByVal lpNewItem As Any) As Integer
  2033. Declare Function ModifyMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer, ByVal wIDNewItem As Integer, ByVal lpString As Any) As Integer
  2034. Declare Function RemoveMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
  2035. Declare Function DeleteMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
  2036. Declare Function SetMenuItemBitmaps Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer, ByVal hBitmapUnchecked As Integer, ByVal hBitmapChecked As Integer) As Integer
  2037. Declare Function GetMenuCheckMarkDimensions Lib "User" () As Long
  2038. Declare Function TrackPopupMenu Lib "User" (ByVal hMenu As Integer, ByVal wFlags As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nReserved As Integer, ByVal hWnd As Integer, lpReserved As Any) As Integer
  2039.  
  2040. Declare Sub UpdateWindow Lib "User" (ByVal hWnd As Integer)
  2041. Declare Function SetActiveWindow Lib "User" (ByVal hWnd As Integer) As Integer
  2042.  
  2043. Declare Function BeginPaint Lib "User" (ByVal hWnd As Integer, lpPaint As PAINTSTRUCT) As Integer
  2044. Declare Sub EndPaint Lib "User" (ByVal hWnd As Integer, lpPaint As PAINTSTRUCT)
  2045. Declare Function GetUpdateRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT, ByVal bErase As Integer) As Integer
  2046. Declare Function GetUpdateRgn Lib "User" (ByVal hWnd As Integer, ByVal hRgn As Integer, ByVal fErase As Integer) As Integer
  2047.  
  2048. Declare Function ExcludeUpdateRgn Lib "User" (ByVal hDC As Integer, ByVal hWnd As Integer) As Integer
  2049.  
  2050. Declare Sub InvalidateRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT, ByVal bErase As Integer)
  2051. Declare Sub ValidateRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT)
  2052.  
  2053. Declare Sub InvalidateRgn Lib "User" (ByVal hWnd As Integer, ByVal hRgn As Integer, ByVal bErase As Integer)
  2054. Declare Sub ValidateRgn Lib "User" (ByVal hWnd As Integer, ByVal hRgn As Integer)
  2055.  
  2056. Declare Sub ScrollWindow Lib "User" (ByVal hWnd As Integer, ByVal XAmount As Integer, ByVal YAmount As Integer, lpRect As RECT, lpClipRect As RECT)
  2057. Declare Function ScrollDC Lib "User" (ByVal hDC As Integer, ByVal dx As Integer, ByVal dy As Integer, lprcScroll As RECT, lprcClip As RECT, ByVal hRgnUpdate As Integer, lprcUpdate As RECT) As Integer
  2058.  
  2059. Declare Function SetScrollPos Lib "User" (ByVal hWnd As Integer, ByVal nBar As Integer, ByVal nPos As Integer, ByVal bRedraw As Integer) As Integer
  2060. Declare Function GetScrollPos Lib "User" (ByVal hWnd As Integer, ByVal nBar As Integer) As Integer
  2061. Declare Sub SetScrollRange Lib "User" (ByVal hWnd As Integer, ByVal nBar As Integer, ByVal nMinPos As Integer, ByVal nMaxPos As Integer, ByVal bRedraw As Integer)
  2062. Declare Sub GetScrollRange Lib "User" (ByVal hWnd As Integer, ByVal nBar As Integer, lpMinPos As Integer, lpMaxPos As Integer)
  2063. Declare Sub ShowScrollBar Lib "User" (ByVal hWnd As Integer, ByVal wBar As Integer, ByVal bShow As Integer)
  2064.  
  2065. Declare Function SetProp Lib "User" (ByVal hWnd As Integer, ByVal lpString As String, ByVal hData As Integer) As Integer
  2066. Declare Function GetProp Lib "User" (ByVal hWnd As Integer, ByVal lpString As Any) As Integer
  2067. Declare Function RemoveProp Lib "User" (ByVal hWnd As Integer, ByVal lpString As String) As Integer
  2068. Declare Sub SetWindowText Lib "User" (ByVal hWnd As Integer, ByVal lpString As String)
  2069. Declare Function GetWindowText Lib "User" (ByVal hWnd As Integer, ByVal lpString As String, ByVal aint As Integer) As Integer
  2070. Declare Function GetWindowTextLength Lib "User" (ByVal hWnd As Integer) As Integer
  2071.  
  2072. Declare Sub GetClientRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT)
  2073. Declare Sub GetWindowRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT)
  2074. Declare Sub AdjustWindowRect Lib "User" (lpRect As RECT, ByVal dwStyle As Long, ByVal bMenu As Integer)
  2075. Declare Sub AdjustWindowRectEx Lib "User" (lpRect As RECT, ByVal dsStyle As Long, ByVal bMenu As Integer, ByVal dwEsStyle As Long)
  2076.  
  2077.  
  2078. ' MessageBox() Flags
  2079. Global Const MB_OK = &H0
  2080. Global Const MB_OKCANCEL = &H1
  2081. Global Const MB_ABORTRETRYIGNORE = &H2
  2082. Global Const MB_YESNOCANCEL = &H3
  2083. Global Const MB_YESNO = &H4
  2084. Global Const MB_RETRYCANCEL = &H5
  2085.  
  2086. Global Const MB_ICONHAND = &H10
  2087. Global Const MB_ICONQUESTION = &H20
  2088. Global Const MB_ICONEXCLAMATION = &H30
  2089. Global Const MB_ICONASTERISK = &H40
  2090.  
  2091. Global Const MB_ICONINFORMATION = MB_ICONASTERISK
  2092. Global Const MB_ICONSTOP = MB_ICONHAND
  2093.  
  2094. Global Const MB_DEFBUTTON1 = &H0
  2095. Global Const MB_DEFBUTTON2 = &H100
  2096. Global Const MB_DEFBUTTON3 = &H200
  2097.  
  2098. Global Const MB_APPLMODAL = &H0
  2099. Global Const MB_SYSTEMMODAL = &H1000
  2100. Global Const MB_TASKMODAL = &H2000
  2101.  
  2102. Global Const MB_NOFOCUS = &H8000
  2103.  
  2104. Global Const MB_TYPEMASK = &HF
  2105. Global Const MB_ICONMASK = &HF0
  2106. Global Const MB_DEFMASK = &HF00
  2107. Global Const MB_MODEMASK = &H3000
  2108. Global Const MB_MISCMASK = &HC000
  2109.  
  2110. Declare Function MessageBox Lib "User" (ByVal hWnd As Integer, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Integer) As Integer
  2111. Declare Sub MessageBeep Lib "User" (ByVal wType As Integer)
  2112.  
  2113. Declare Function ShowCursor Lib "User" (ByVal bShow As Integer) As Integer
  2114. Declare Sub SetCursorPos Lib "User" (ByVal X As Integer, ByVal Y As Integer)
  2115. Declare Function SetCursor Lib "User" (ByVal hCursor As Integer) As Integer
  2116. Declare Sub GetCursorPos Lib "User" (lpPoint As POINTAPI)
  2117. Declare Sub ClipCursor Lib "User" (lpRect As Any)
  2118.  
  2119. Declare Sub CreateCaret Lib "User" (ByVal hWnd As Integer, ByVal hBitmap As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer)
  2120. Declare Function GetCaretBlinkTime Lib "User" () As Integer
  2121. Declare Sub SetCaretBlinkTime Lib "User" (ByVal wMSeconds As Integer)
  2122. Declare Sub DestroyCaret Lib "User" ()
  2123. Declare Sub HideCaret Lib "User" (ByVal hWnd As Integer)
  2124. Declare Sub ShowCaret Lib "User" (ByVal hWnd As Integer)
  2125. Declare Sub SetCaretPos Lib "User" (ByVal X As Integer, ByVal Y As Integer)
  2126. Declare Sub GetCaretPos Lib "User" (lpPoint As POINTAPI)
  2127.  
  2128. Declare Sub ClientToScreen Lib "User" (ByVal hWnd As Integer, lpPoint As POINTAPI)
  2129. Declare Sub ScreenToClient Lib "User" (ByVal hWnd As Integer, lpPoint As POINTAPI)
  2130.  
  2131. Declare Function WindowFromPoint Lib "User" (ByVal ptScreen As Any) As Integer
  2132. Declare Function ChildWindowFromPoint Lib "User" (ByVal hWnd As Integer, ByVal ptScreen As Any) As Integer
  2133.  
  2134.  
  2135. ' Color Types
  2136. Global Const CTLCOLOR_MSGBOX = 0
  2137. Global Const CTLCOLOR_EDIT = 1
  2138. Global Const CTLCOLOR_LISTBOX = 2
  2139. Global Const CTLCOLOR_BTN = 3
  2140. Global Const CTLCOLOR_DLG = 4
  2141. Global Const CTLCOLOR_SCROLLBAR = 5
  2142. Global Const CTLCOLOR_STATIC = 6
  2143. Global Const CTLCOLOR_MAX = 8   '  three bits max
  2144.  
  2145. Global Const COLOR_SCROLLBAR = 0
  2146. Global Const COLOR_BACKGROUND = 1
  2147. Global Const COLOR_ACTIVECAPTION = 2
  2148. Global Const COLOR_INACTIVECAPTION = 3
  2149. Global Const COLOR_MENU = 4
  2150. Global Const COLOR_WINDOW = 5
  2151. Global Const COLOR_WINDOWFRAME = 6
  2152. Global Const COLOR_MENUTEXT = 7
  2153. Global Const COLOR_WINDOWTEXT = 8
  2154. Global Const COLOR_CAPTIONTEXT = 9
  2155. Global Const COLOR_ACTIVEBORDER = 10
  2156. Global Const COLOR_INACTIVEBORDER = 11
  2157. Global Const COLOR_APPWORKSPACE = 12
  2158. Global Const COLOR_HIGHLIGHT = 13
  2159. Global Const COLOR_HIGHLIGHTTEXT = 14
  2160. Global Const COLOR_BTNFACE = 15
  2161. Global Const COLOR_BTNSHADOW = 16
  2162. Global Const COLOR_GRAYTEXT = 17
  2163. Global Const COLOR_BTNTEXT = 18
  2164. Global Const COLOR_ENDCOLORS = COLOR_BTNTEXT
  2165.  
  2166. Declare Function GetSysColor Lib "User" (ByVal nIndex As Integer) As Long
  2167. Declare Sub SetSysColors Lib "User" (ByVal nChanges As Integer, lpSysColor As Integer, lpColorValues As Long)
  2168.  
  2169. Declare Function FillRgn Lib "GDI" (ByVal hDC As Integer, ByVal hRgn As Integer, ByVal hBrush As Integer) As Integer
  2170. Declare Function FrameRgn Lib "GDI" (ByVal hDC As Integer, ByVal hRgn As Integer, ByVal hBrush As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer
  2171. Declare Function InvertRgn Lib "GDI" (ByVal hDC As Integer, ByVal hRgn As Integer) As Integer
  2172. Declare Function PaintRgn Lib "GDI" (ByVal hDC As Integer, ByVal hRgn As Integer) As Integer
  2173. Declare Function PtInRegion Lib "GDI" (ByVal hRgn As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  2174.  
  2175. Declare Sub DrawFocusRect Lib "User" (ByVal hDC As Integer, lpRect As RECT)
  2176. Declare Function FillRect Lib "User" (ByVal hDC As Integer, lpRect As RECT, ByVal hBrush As Integer) As Integer
  2177. Declare Function FrameRect Lib "User" (ByVal hDC As Integer, lpRect As RECT, ByVal hBrush As Integer) As Integer
  2178. Declare Sub InvertRect Lib "User" (ByVal hDC As Integer, lpRect As RECT)
  2179. Declare Sub SetRect Lib "User" (lpRect As RECT, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer)
  2180. Declare Sub SetRectEmpty Lib "User" (lpRect As RECT)
  2181. Declare Function CopyRect Lib "User" (lpDestRect As RECT, lpSourceRect As RECT) As Integer
  2182. Declare Sub InflateRect Lib "User" (lpRect As RECT, ByVal X As Integer, ByVal Y As Integer)
  2183. Declare Function IntersectRect Lib "User" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Integer
  2184. Declare Function UnionRect Lib "User" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Integer
  2185. Declare Sub OffsetRect Lib "User" (lpRect As RECT, ByVal X As Integer, ByVal Y As Integer)
  2186. Declare Function IsRectEmpty Lib "User" (lpRect As RECT) As Integer
  2187. Declare Function EqualRect Lib "User" (lpRect1 As RECT, lpRect2 As RECT) As Integer
  2188. Declare Function PtInRect Lib "User" (lpRect As RECT, ptRect As Any) As Integer
  2189. Declare Function RectVisible Lib "User" (ByVal hDC As Integer, lpRect As RECT) As Integer
  2190. Declare Function RectInRegion Lib "User" (ByVal hRgn As Integer, lpRect As RECT) As Integer
  2191.  
  2192. Declare Function GetCurrentTime Lib "User" () As Long
  2193. Declare Function GetTickCount Lib "User" () As Long
  2194.  
  2195. Declare Function GetWindowWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Integer
  2196. Declare Function SetWindowWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal wNewWord As Integer) As Integer
  2197. Declare Function GetWindowLong Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Long
  2198. Declare Function SetWindowLong Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long
  2199. Declare Function GetClassWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Integer
  2200. Declare Function SetClassWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal wNewWord As Integer) As Integer
  2201. Declare Function GetClassLong Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Long
  2202. Declare Function SetClassLong Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long
  2203. Declare Function GetDesktopHwnd Lib "User" () As Integer
  2204. Declare Function GetDesktopWindow Lib "User" () As Integer
  2205.  
  2206.  
  2207. Declare Function GetParent Lib "User" (ByVal hWnd As Integer) As Integer
  2208. Declare Function SetParent Lib "User" (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer
  2209. Declare Function FindWindow Lib "User" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Integer
  2210. Declare Function GetClassName Lib "User" (ByVal hWnd As Integer, ByVal lpClassName As String, ByVal nMaxCount As Integer) As Integer
  2211. Declare Function GetTopWindow Lib "User" (ByVal hWnd As Integer) As Integer
  2212. Declare Function GetNextWindow Lib "User" (ByVal hWnd As Integer, ByVal wFlag As Integer) As Integer
  2213. Declare Function GetWindowTask Lib "User" (ByVal hWnd As Integer) As Integer
  2214. Declare Function GetLastActivePopup Lib "User" (ByVal hwndOwnder As Integer) As Integer
  2215.  
  2216. ' GetWindow() Constants
  2217. Global Const GW_HWNDFIRST = 0
  2218. Global Const GW_HWNDLAST = 1
  2219. Global Const GW_HWNDNEXT = 2
  2220. Global Const GW_HWNDPREV = 3
  2221. Global Const GW_OWNER = 4
  2222. Global Const GW_CHILD = 5
  2223.  
  2224. Declare Function GetWindow Lib "User" (ByVal hWnd As Integer, ByVal wCmd As Integer) As Integer
  2225.  
  2226. ' Menu flags for Add/Check/EnableMenuItem()
  2227. Global Const MF_INSERT = &H0
  2228. Global Const MF_CHANGE = &H80
  2229. Global Const MF_APPEND = &H100
  2230. Global Const MF_DELETE = &H200
  2231. Global Const MF_REMOVE = &H1000
  2232.  
  2233. Global Const MF_BYCOMMAND = &H0
  2234. Global Const MF_BYPOSITION = &H400
  2235.  
  2236. Global Const MF_SEPARATOR = &H800
  2237.  
  2238. Global Const MF_ENABLED = &H0
  2239. Global Const MF_GRAYED = &H1
  2240. Global Const MF_DISABLED = &H2
  2241.  
  2242. Global Const MF_UNCHECKED = &H0
  2243. Global Const MF_CHECKED = &H8
  2244. Global Const MF_USECHECKBITMAPS = &H200
  2245.  
  2246. Global Const MF_STRING = &H0
  2247. Global Const MF_BITMAP = &H4
  2248. Global Const MF_OWNERDRAW = &H100
  2249.  
  2250. Global Const MF_POPUP = &H10
  2251. Global Const MF_MENUBARBREAK = &H20
  2252. Global Const MF_MENUBREAK = &H40
  2253.  
  2254. Global Const MF_UNHILITE = &H0
  2255. Global Const MF_HILITE = &H80
  2256.  
  2257. Global Const MF_SYSMENU = &H2000
  2258. Global Const MF_HELP = &H4000
  2259. Global Const MF_MOUSESELECT = &H8000
  2260.  
  2261. ' Menu item resource format
  2262. Type MENUITEMTEMPLATEHEADER
  2263.     versionNumber As Integer
  2264.     offset As Integer
  2265. End Type
  2266.  
  2267. Type MENUITEMTEMPLATE
  2268.     mtOption As Integer
  2269.     mtID As Integer
  2270.     mtString As Long 
  2271. End Type
  2272.  
  2273. Global Const MF_END = &H80
  2274.  
  2275. ' System Menu Command Values
  2276. Global Const SC_SIZE = &HF000
  2277. Global Const SC_MOVE = &HF010
  2278. Global Const SC_MINIMIZE = &HF020
  2279. Global Const SC_MAXIMIZE = &HF030
  2280. Global Const SC_NEXTWINDOW = &HF040
  2281. Global Const SC_PREVWINDOW = &HF050
  2282. Global Const SC_CLOSE = &HF060
  2283. Global Const SC_VSCROLL = &HF070
  2284. Global Const SC_HSCROLL = &HF080
  2285. Global Const SC_MOUSEMENU = &HF090
  2286. Global Const SC_KEYMENU = &HF100
  2287. Global Const SC_ARRANGE = &HF110
  2288. Global Const SC_RESTORE = &HF120
  2289. Global Const SC_TASKLIST = &HF130
  2290.  
  2291. Global Const SC_ICON = SC_MINIMIZE
  2292. Global Const SC_ZOOM = SC_MAXIMIZE
  2293.  
  2294. ' Resource Loading Routines
  2295. Declare Function LoadBitmap Lib "User" (ByVal hInstance As Integer, ByVal lpBitmapName As Any) As Integer
  2296. Declare Function LoadCursor Lib "User" (ByVal hInstance As Integer, ByVal lpCursorName As Any) As Integer
  2297. Declare Function CreateCursor Lib "User" (ByVal hInstance%, ByVal nXhotspot%, ByVal nYhotspot%, ByVal nWidth%, ByVal nHeight%, ByVal lpANDbitPlane As Any, ByVal lpXORbitPlane As Any) As Integer
  2298. Declare Function DestroyCursor Lib "User" (ByVal hCursor As Integer) As Integer
  2299.  
  2300. ' Standard Cursor IDs
  2301. Global Const IDC_ARROW = 32512&
  2302. Global Const IDC_IBEAM = 32513&
  2303. Global Const IDC_WAIT = 32514&
  2304. Global Const IDC_CROSS = 32515&
  2305. Global Const IDC_UPARROW = 32516&
  2306. Global Const IDC_SIZE = 32640&
  2307. Global Const IDC_ICON = 32641&
  2308. Global Const IDC_SIZENWSE = 32642&
  2309. Global Const IDC_SIZENESW = 32643&
  2310. Global Const IDC_SIZEWE = 32644&
  2311. Global Const IDC_SIZENS = 32645&
  2312.  
  2313. Declare Function LoadIcon Lib "User" (ByVal hInstance As Integer, ByVal lpIconName As Any) As Integer
  2314. Declare Function CreateIcon Lib "User" (ByVal hInstance%, ByVal nWidth%, ByVal nHeight%, ByVal nPlanes%, ByVal nBitsPixel%, ByVal lpANDbits As Any, ByVal lpXORbits As Any) As Integer
  2315. Declare Function DestroyIcon Lib "User" (ByVal hIcon As Integer) As Integer
  2316.  
  2317.  
  2318. Global Const ORD_LANGDRIVER = 1 '  The ordinal number for the entry point of
  2319.                 '  language drivers.
  2320.  
  2321. ' Standard Icon IDs
  2322. Global Const IDI_APPLICATION = 32512&
  2323. Global Const IDI_HAND = 32513&
  2324. Global Const IDI_QUESTION = 32514&
  2325. Global Const IDI_EXCLAMATION = 32515&
  2326. Global Const IDI_ASTERISK = 32516&
  2327.  
  2328. Declare Function LoadString Lib "User" (ByVal hInstance As Integer, ByVal wID As Integer, ByVal lpBuffer As Any, ByVal nBufferMax As Integer) As Integer
  2329.  
  2330. Declare Function AddFontResource Lib "GDI" (ByVal lpFilename As Any) As Integer
  2331. Declare Function RemoveFontResource Lib "GDI" (ByVal lpFilename As Any) As Integer
  2332.  
  2333. ' Dialog Box Command IDs
  2334. Global Const IDOK = 1
  2335. Global Const IDCANCEL = 2
  2336. Global Const IDABORT = 3
  2337. Global Const IDRETRY = 4
  2338. Global Const IDIGNORE = 5
  2339. Global Const IDYES = 6
  2340. Global Const IDNO = 7
  2341.  
  2342.  
  2343. ' Control Manager Structures and Definitions
  2344.  
  2345. ' Edit Control Styles
  2346. Global Const ES_LEFT = &H0&
  2347. Global Const ES_CENTER = &H1&
  2348. Global Const ES_RIGHT = &H2&
  2349. Global Const ES_MULTILINE = &H4&
  2350. Global Const ES_UPPERCASE = &H8&
  2351. Global Const ES_LOWERCASE = &H10&
  2352. Global Const ES_PASSWORD = &H20&
  2353. Global Const ES_AUTOVSCROLL = &H40&
  2354. Global Const ES_AUTOHSCROLL = &H80&
  2355. Global Const ES_NOHIDESEL = &H100&
  2356. Global Const ES_OEMCONVERT = &H400&
  2357.  
  2358. ' Edit Control Notification Codes
  2359. Global Const EN_SETFOCUS = &H100
  2360. Global Const EN_KILLFOCUS = &H200
  2361. Global Const EN_CHANGE = &H300
  2362. Global Const EN_UPDATE = &H400
  2363. Global Const EN_ERRSPACE = &H500
  2364. Global Const EN_MAXTEXT = &H501
  2365. Global Const EN_HSCROLL = &H601
  2366. Global Const EN_VSCROLL = &H602
  2367.  
  2368. ' Edit Control Messages
  2369. Global Const EM_GETSEL = WM_USER+0
  2370. Global Const EM_SETSEL = WM_USER+1
  2371. Global Const EM_GETRECT = WM_USER+2
  2372. Global Const EM_SETRECT = WM_USER+3
  2373. Global Const EM_SETRECTNP = WM_USER+4
  2374. Global Const EM_SCROLL = WM_USER+5
  2375. Global Const EM_LINESCROLL = WM_USER+6
  2376. Global Const EM_GETMODIFY = WM_USER+8
  2377. Global Const EM_SETMODIFY = WM_USER+9
  2378. Global Const EM_GETLINECOUNT = WM_USER+10
  2379. Global Const EM_LINEINDEX = WM_USER+11
  2380. Global Const EM_SETHANDLE = WM_USER+12
  2381. Global Const EM_GETHANDLE = WM_USER+13
  2382. Global Const EM_GETTHUMB = WM_USER+14
  2383. Global Const EM_LINELENGTH = WM_USER+17
  2384. Global Const EM_REPLACESEL = WM_USER+18
  2385. Global Const EM_SETFONT = WM_USER+19
  2386. Global Const EM_GETLINE = WM_USER+20
  2387. Global Const EM_LIMITTEXT = WM_USER+21
  2388. Global Const EM_CANUNDO = WM_USER+22
  2389. Global Const EM_UNDO = WM_USER+23
  2390. Global Const EM_FMTLINES = WM_USER+24
  2391. Global Const EM_LINEFROMCHAR = WM_USER+25
  2392. Global Const EM_SETWORDBREAK = WM_USER+26
  2393. Global Const EM_SETTABSTOPS = WM_USER+27
  2394. Global Const EM_SETPASSWORDCHAR = WM_USER+28
  2395. Global Const EM_EMPTYUNDOBUFFER = WM_USER+29
  2396. Global Const EM_MSGMAX = WM_USER+30
  2397.  
  2398. ' Button Control Styles
  2399. Global Const BS_PUSHBUTTON = &H0&
  2400. Global Const BS_DEFPUSHBUTTON = &H1&
  2401. Global Const BS_CHECKBOX = &H2&
  2402. Global Const BS_AUTOCHECKBOX = &H3&
  2403. Global Const BS_RADIOBUTTON = &H4&
  2404. Global Const BS_3STATE = &H5&
  2405. Global Const BS_AUTO3STATE = &H6&
  2406. Global Const BS_GROUPBOX = &H7&
  2407. Global Const BS_USERBUTTON = &H8&
  2408. Global Const BS_AUTORADIOBUTTON = &H9&
  2409. Global Const BS_PUSHBOX = &HA&
  2410. Global Const BS_OWNERDRAW = &HB&
  2411. Global Const BS_LEFTTEXT = &H20&
  2412.  
  2413. ' User Button Notification Codes
  2414. Global Const BN_CLICKED = 0
  2415. Global Const BN_PAINT = 1
  2416. Global Const BN_HILITE = 2
  2417. Global Const BN_UNHILITE = 3
  2418. Global Const BN_DISABLE = 4
  2419. Global Const BN_DOUBLECLICKED = 5
  2420.  
  2421. ' Button Control Messages
  2422. Global Const BM_GETCHECK = WM_USER+0
  2423. Global Const BM_SETCHECK = WM_USER+1
  2424. Global Const BM_GETSTATE = WM_USER+2
  2425. Global Const BM_SETSTATE = WM_USER+3
  2426. Global Const BM_SETSTYLE = WM_USER+4
  2427.  
  2428. ' Static Control Constants
  2429. Global Const SS_LEFT = &H0&
  2430. Global Const SS_CENTER = &H1&
  2431. Global Const SS_RIGHT = &H2&
  2432. Global Const SS_ICON = &H3&
  2433. Global Const SS_BLACKRECT = &H4&
  2434. Global Const SS_GRAYRECT = &H5&
  2435. Global Const SS_WHITERECT = &H6&
  2436. Global Const SS_BLACKFRAME = &H7&
  2437. Global Const SS_GRAYFRAME = &H8&
  2438. Global Const SS_WHITEFRAME = &H9&
  2439. Global Const SS_USERITEM = &HA&
  2440. Global Const SS_SIMPLE = &HB&
  2441. Global Const SS_LEFTNOWORDWRAP = &HC&
  2442. Global Const SS_NOPREFIX = &H80&        '  Don't do "&" character translation
  2443.  
  2444. ' Dialog Manager Routines
  2445. Declare Function IsDialogMessage Lib "User" (ByVal hDlg As Integer, lpMsg As MSG) As Integer
  2446.  
  2447. Declare Sub MapDialogRect Lib "User" (ByVal hDlg As Integer, lpRect As RECT)
  2448.  
  2449. Declare Function DlgDirList Lib "User" (ByVal hDlg As Integer, ByVal lpPathSpec As String, ByVal nIDListBox As Integer, ByVal nIDStaticPath As Integer, ByVal wFiletype As Integer) As Integer
  2450. Declare Function DlgDirSelect Lib "User" (ByVal hDlg As Integer, ByVal lpString As String, ByVal nIDListBox As Integer) As Integer
  2451. Declare Function DlgDirListComboBox Lib "User" (ByVal hDlg As Integer, ByVal lpPathSpec As String, ByVal nIDComboBox As Integer, ByVal nIDStaticPath As Integer, ByVal wFileType As Integer) As Integer
  2452. Declare Function DlgDirSelectComboBox Lib "User" (ByVal hDlg As Integer, ByVal lpString As String, ByVal nIDComboBox As Integer) As Integer
  2453.  
  2454. ' Dialog Styles
  2455. Global Const DS_ABSALIGN = &H1&
  2456. Global Const DS_SYSMODAL = &H2&
  2457. Global Const DS_LOCALEDIT = &H20&       '  Edit items get Local storage.
  2458. Global Const DS_SETFONT = &H40& '  User specified font for Dlg controls
  2459. Global Const DS_MODALFRAME = &H80&      '  Can be combined with WS_CAPTION
  2460. Global Const DS_NOIDLEMSG = &H100&      '  WM_ENTERIDLE message will not be sent
  2461.  
  2462. Global Const DM_GETDEFID = WM_USER+0
  2463. Global Const DM_SETDEFID = WM_USER+1
  2464. Global Const DC_HASDEFID = &H534%     '0x534B
  2465.  
  2466. ' Dialog Codes
  2467. Global Const DLGC_WANTARROWS = &H1      '  Control wants arrow keys
  2468. Global Const DLGC_WANTTAB = &H2 '  Control wants tab keys
  2469. Global Const DLGC_WANTALLKEYS = &H4     '  Control wants all keys
  2470. Global Const DLGC_WANTMESSAGE = &H4     '  Pass message to control
  2471. Global Const DLGC_HASSETSEL = &H8       '  Understands EM_SETSEL message
  2472. Global Const DLGC_DEFPUSHBUTTON = &H10  '  Default pushbutton
  2473. Global Const DLGC_UNDEFPUSHBUTTON = &H20        '  Non-default pushbutton
  2474. Global Const DLGC_RADIOBUTTON = &H40    '  Radio button
  2475. Global Const DLGC_WANTCHARS = &H80      '  Want WM_CHAR messages
  2476. Global Const DLGC_STATIC = &H100        '  Static item: don't include
  2477. Global Const DLGC_BUTTON = &H2000       '  Button item: can be checked
  2478.  
  2479. Global Const LB_CTLCODE = 0&
  2480.  
  2481. ' Listbox Return Values
  2482. Global Const LB_OKAY = 0
  2483. Global Const LB_ERR = (-1)
  2484. Global Const LB_ERRSPACE = (-2)
  2485.  
  2486. '
  2487. ' The idStaticPath parameter to DlgDirList can have the following values
  2488. ' ORed if the list box should show other details of the files along with
  2489. ' the name of the files;
  2490.  
  2491. ' all other details also will be returned
  2492.  
  2493. ' Listbox Notification Codes
  2494. Global Const LBN_ERRSPACE = (-2)
  2495. Global Const LBN_SELCHANGE = 1
  2496. Global Const LBN_DBLCLK = 2
  2497. Global Const LBN_SELCANCEL = 3
  2498. Global Const LBN_SETFOCUS = 4
  2499. Global Const LBN_KILLFOCUS = 5
  2500.  
  2501. ' Listbox messages
  2502. Global Const LB_ADDSTRING = (WM_USER+1)
  2503. Global Const LB_INSERTSTRING = (WM_USER+2)
  2504. Global Const LB_DELETESTRING = (WM_USER+3)
  2505. Global Const LB_RESETCONTENT = (WM_USER+5)
  2506. Global Const LB_SETSEL = (WM_USER+6)
  2507. Global Const LB_SETCURSEL = (WM_USER+7)
  2508. Global Const LB_GETSEL = (WM_USER+8)
  2509. Global Const LB_GETCURSEL = (WM_USER+9)
  2510. Global Const LB_GETTEXT = (WM_USER+10)
  2511. Global Const LB_GETTEXTLEN = (WM_USER+11)
  2512. Global Const LB_GETCOUNT = (WM_USER+12)
  2513. Global Const LB_SELECTSTRING = (WM_USER+13)
  2514. Global Const LB_DIR = (WM_USER+14)
  2515. Global Const LB_GETTOPINDEX = (WM_USER+15)
  2516. Global Const LB_FINDSTRING = (WM_USER+16)
  2517. Global Const LB_GETSELCOUNT = (WM_USER+17)
  2518. Global Const LB_GETSELITEMS = (WM_USER+18)
  2519. Global Const LB_SETTABSTOPS = (WM_USER+19)
  2520. Global Const LB_GETHORIZONTALEXTENT = (WM_USER+20)
  2521. Global Const LB_SETHORIZONTALEXTENT = (WM_USER+21)
  2522. Global Const LB_SETCOLUMNWIDTH = (WM_USER+22)
  2523. Global Const LB_SETTOPINDEX = (WM_USER+24)
  2524. Global Const LB_GETITEMRECT = (WM_USER+25)
  2525. Global Const LB_GETITEMDATA = (WM_USER+26)
  2526. Global Const LB_SETITEMDATA = (WM_USER+27)
  2527. Global Const LB_SELITEMRANGE = (WM_USER+28)
  2528. Global Const LB_MSGMAX = (WM_USER+33)
  2529.  
  2530. ' Listbox Styles
  2531. Global Const LBS_NOTIFY = &H1&
  2532. Global Const LBS_SORT = &H2&
  2533. Global Const LBS_NOREDRAW = &H4&
  2534. Global Const LBS_MULTIPLESEL = &H8&
  2535. Global Const LBS_OWNERDRAWFIXED = &H10&
  2536. Global Const LBS_OWNERDRAWVARIABLE = &H20&
  2537. Global Const LBS_HASSTRINGS = &H40&
  2538. Global Const LBS_USETABSTOPS = &H80&
  2539. Global Const LBS_NOINTEGRALHEIGHT = &H100&
  2540. Global Const LBS_MULTICOLUMN = &H200&
  2541. Global Const LBS_WANTKEYBOARDINPUT = &H400&
  2542. Global Const LBS_EXTENDEDSEL = &H800&
  2543. Global Const LBS_STANDARD = (LBS_NOTIFY Or LBS_SORT Or WS_VSCROLL Or WS_BORDER)
  2544.  
  2545. ' Combo Box return Values
  2546. Global Const CB_OKAY = 0
  2547. Global Const CB_ERR = (-1)
  2548. Global Const CB_ERRSPACE = (-2)
  2549.  
  2550. ' Combo Box Notification Codes
  2551. Global Const CBN_ERRSPACE = (-1)
  2552. Global Const CBN_SELCHANGE = 1
  2553. Global Const CBN_DBLCLK = 2
  2554. Global Const CBN_SETFOCUS = 3
  2555. Global Const CBN_KILLFOCUS = 4
  2556. Global Const CBN_EDITCHANGE = 5
  2557. Global Const CBN_EDITUPDATE = 6
  2558. Global Const CBN_DROPDOWN = 7
  2559.  
  2560. ' Combo Box styles
  2561. Global Const CBS_SIMPLE = &H1&
  2562. Global Const CBS_DROPDOWN = &H2&
  2563. Global Const CBS_DROPDOWNLIST = &H3&
  2564. Global Const CBS_OWNERDRAWFIXED = &H10&
  2565. Global Const CBS_OWNERDRAWVARIABLE = &H20&
  2566. Global Const CBS_AUTOHSCROLL = &H40&
  2567. Global Const CBS_OEMCONVERT = &H80&
  2568. Global Const CBS_SORT = &H100&
  2569. Global Const CBS_HASSTRINGS = &H200&
  2570. Global Const CBS_NOINTEGRALHEIGHT = &H400&
  2571.  
  2572. ' Combo Box messages
  2573. Global Const CB_GETEDITSEL = (WM_USER+0)
  2574. Global Const CB_LIMITTEXT = (WM_USER+1)
  2575. Global Const CB_SETEDITSEL = (WM_USER+2)
  2576. Global Const CB_ADDSTRING = (WM_USER+3)
  2577. Global Const CB_DELETESTRING = (WM_USER+4)
  2578. Global Const CB_DIR = (WM_USER+5)
  2579. Global Const CB_GETCOUNT = (WM_USER+6)
  2580. Global Const CB_GETCURSEL = (WM_USER+7)
  2581. Global Const CB_GETLBTEXT = (WM_USER+8)
  2582. Global Const CB_GETLBTEXTLEN = (WM_USER+9)
  2583. Global Const CB_INSERTSTRING = (WM_USER+10)
  2584. Global Const CB_RESETCONTENT = (WM_USER+11)
  2585. Global Const CB_FINDSTRING = (WM_USER+12)
  2586. Global Const CB_SELECTSTRING = (WM_USER+13)
  2587. Global Const CB_SETCURSEL = (WM_USER+14)
  2588. Global Const CB_SHOWDROPDOWN = (WM_USER+15)
  2589. Global Const CB_GETITEMDATA = (WM_USER+16)
  2590. Global Const CB_SETITEMDATA = (WM_USER+17)
  2591. Global Const CB_GETDROPPEDCONTROLRECT = (WM_USER+18)
  2592. Global Const CB_MSGMAX = (WM_USER+19)
  2593.  
  2594. ' Scroll Bar Styles
  2595. Global Const SBS_HORZ = &H0&
  2596. Global Const SBS_VERT = &H1&
  2597. Global Const SBS_TOPALIGN = &H2&
  2598. Global Const SBS_LEFTALIGN = &H2&
  2599. Global Const SBS_BOTTOMALIGN = &H4&
  2600. Global Const SBS_RIGHTALIGN = &H4&
  2601. Global Const SBS_SIZEBOXTOPLEFTALIGN = &H2&
  2602. Global Const SBS_SIZEBOXBOTTOMRIGHTALIGN = &H4&
  2603. Global Const SBS_SIZEBOX = &H8&
  2604.  
  2605.  
  2606. ' Sound Functions
  2607. '
  2608. Declare Function OpenSound Lib "Sound" () As Integer
  2609. Declare Sub CloseSound Lib "Sound" ()
  2610. Declare Function SetVoiceQueueSize Lib "Sound" (ByVal nVoice As Integer, ByVal nBytes As Integer) As Integer
  2611. Declare Function SetVoiceNote Lib "Sound" (ByVal nVoice As Integer, ByVal nValue As Integer, ByVal nLength As Integer, ByVal nCdots As Integer) As Integer
  2612. Declare Function SetVoiceAccent Lib "Sound" (ByVal nVoice As Integer, ByVal nTempo As Integer, ByVal nVolume As Integer, ByVal nMode As Integer, ByVal nPitch As Integer) As Integer
  2613. Declare Function SetVoiceEnvelope Lib "Sound" (ByVal nVoice As Integer, ByVal nShape As Integer, ByVal nRepeat As Integer) As Integer
  2614. Declare Function SetSoundNoise Lib "Sound" (ByVal nSource As Integer, ByVal nDuration As Integer) As Integer
  2615. Declare Function SetVoiceSound Lib "Sound" (ByVal nVoice As Integer, ByVal lFrequency As Long, ByVal nDuration As Integer) As Integer
  2616. Declare Function StartSound Lib "Sound" () As Integer
  2617. Declare Function StopSound Lib "Sound" () As Integer
  2618. Declare Function WaitSoundState Lib "Sound" (ByVal nState As Integer) As Integer
  2619. Declare Function SyncAllVoices Lib "Sound" () As Integer
  2620. Declare Function CountVoiceNotes Lib "Sound" (ByVal nVoice As Integer) As Integer
  2621. Declare Function GetThresholdEvent Lib "Sound" () As Integer
  2622. Declare Function GetThresholdStatus Lib "Sound" () As Integer
  2623. Declare Function SetVoiceThreshold Lib "Sound" (ByVal nVoice As Integer, ByVal nNotes As Integer) As Integer
  2624.  
  2625. ' WaitSoundState() Constants
  2626. Global Const S_QUEUEEMPTY = 0
  2627. Global Const S_THRESHOLD = 1
  2628. Global Const S_ALLTHRESHOLD = 2
  2629.  
  2630. ' Accent Modes
  2631. Global Const S_NORMAL = 0
  2632. Global Const S_LEGATO = 1
  2633. Global Const S_STACCATO = 2
  2634.  
  2635. ' SetSoundNoise() Sources
  2636. Global Const S_PERIOD512 = 0    '  Freq = N/512 high pitch, less coarse hiss
  2637. Global Const S_PERIOD1024 = 1   '  Freq = N/1024
  2638. Global Const S_PERIOD2048 = 2   '  Freq = N/2048 low pitch, more coarse hiss
  2639. Global Const S_PERIODVOICE = 3  '  Source is frequency from voice channel (3)
  2640. Global Const S_WHITE512 = 4     '  Freq = N/512 high pitch, less coarse hiss
  2641. Global Const S_WHITE1024 = 5    '  Freq = N/1024
  2642. Global Const S_WHITE2048 = 6    '  Freq = N/2048 low pitch, more coarse hiss
  2643. Global Const S_WHITEVOICE = 7   '  Source is frequency from voice channel (3)
  2644.  
  2645. Global Const S_SERDVNA = (-1)   '  Device not available
  2646. Global Const S_SEROFM = (-2)    '  Out of memory
  2647. Global Const S_SERMACT = (-3)   '  Music active
  2648. Global Const S_SERQFUL = (-4)   '  Queue full
  2649. Global Const S_SERBDNT = (-5)   '  Invalid note
  2650. Global Const S_SERDLN = (-6)    '  Invalid note length
  2651. Global Const S_SERDCC = (-7)    '  Invalid note count
  2652. Global Const S_SERDTP = (-8)    '  Invalid tempo
  2653. Global Const S_SERDVL = (-9)    '  Invalid volume
  2654. Global Const S_SERDMD = (-10)   '  Invalid mode
  2655. Global Const S_SERDSH = (-11)   '  Invalid shape
  2656. Global Const S_SERDPT = (-12)   '  Invalid pitch
  2657. Global Const S_SERDFQ = (-13)   '  Invalid frequency
  2658. Global Const S_SERDDR = (-14)   '  Invalid duration
  2659. Global Const S_SERDSR = (-15)   '  Invalid source
  2660. Global Const S_SERDST = (-16)   '  Invalid state
  2661.  
  2662. ' COMM declarations
  2663. '
  2664. Global Const NOPARITY = 0
  2665. Global Const ODDPARITY = 1
  2666. Global Const EVENPARITY = 2
  2667. Global Const MARKPARITY = 3
  2668. Global Const SPACEPARITY = 4
  2669.  
  2670. Global Const ONESTOPBIT = 0
  2671. Global Const ONE5STOPBITS = 1
  2672. Global Const TWOSTOPBITS = 2
  2673.  
  2674. Global Const IGNORE = 0 '  Ignore signal
  2675. Global Const INFINITE = &HFFFF  '  Infinite timeout
  2676.  
  2677. ' Error Flags
  2678. Global Const CE_RXOVER = &H1    '  Receive Queue overflow
  2679. Global Const CE_OVERRUN = &H2   '  Receive Overrun Error
  2680. Global Const CE_RXPARITY = &H4  '  Receive Parity Error
  2681. Global Const CE_FRAME = &H8     '  Receive Framing error
  2682. Global Const CE_BREAK = &H10    '  Break Detected
  2683. Global Const CE_CTSTO = &H20    '  CTS Timeout
  2684. Global Const CE_DSRTO = &H40    '  DSR Timeout
  2685. Global Const CE_RLSDTO = &H80   '  RLSD Timeout
  2686. Global Const CE_TXFULL = &H100  '  TX Queue is full
  2687. Global Const CE_PTO = &H200     '  LPTx Timeout
  2688. Global Const CE_IOE = &H400     '  LPTx I/O Error
  2689. Global Const CE_DNS = &H800     '  LPTx Device not selected
  2690. Global Const CE_OOP = &H1000    '  LPTx Out-Of-Paper
  2691. Global Const CE_MODE = &H8000   '  Requested mode unsupported
  2692.  
  2693. Global Const IE_BADID = (-1)    '  Invalid or unsupported id
  2694. Global Const IE_OPEN = (-2)     '  Device Already Open
  2695. Global Const IE_NOPEN = (-3)    '  Device Not Open
  2696. Global Const IE_MEMORY = (-4)   '  Unable to allocate queues
  2697. Global Const IE_DEFAULT = (-5)  '  Error in default parameters
  2698. Global Const IE_HARDWARE = (-10)        '  Hardware Not Present
  2699. Global Const IE_BYTESIZE = (-11)        '  Illegal Byte Size
  2700. Global Const IE_BAUDRATE = (-12)        '  Unsupported BaudRate
  2701.  
  2702. ' Events
  2703. Global Const EV_RXCHAR = &H1    '  Any Character received
  2704. Global Const EV_RXFLAG = &H2    '  Received certain character
  2705. Global Const EV_TXEMPTY = &H4   '  Transmitt Queue Empty
  2706. Global Const EV_CTS = &H8       '  CTS changed state
  2707. Global Const EV_DSR = &H10      '  DSR changed state
  2708. Global Const EV_RLSD = &H20     '  RLSD changed state
  2709. Global Const EV_BREAK = &H40    '  BREAK received
  2710. Global Const EV_ERR = &H80      '  Line status error occurred
  2711. Global Const EV_RING = &H100    '  Ring signal detected
  2712. Global Const EV_PERR = &H200    '  Printer error occured
  2713.  
  2714. ' Escape Functions
  2715. Global Const SETXOFF = 1        '  Simulate XOFF received
  2716. Global Const SETXON = 2 '  Simulate XON received
  2717. Global Const SETRTS = 3 '  Set RTS high
  2718. Global Const CLRRTS = 4 '  Set RTS low
  2719. Global Const SETDTR = 5 '  Set DTR high
  2720. Global Const CLRDTR = 6 '  Set DTR low
  2721. Global Const RESETDEV = 7       '  Reset device if possible
  2722.  
  2723. Global Const LPTx = &H80        '  Set if ID is for LPT device
  2724.  
  2725. Type DCB
  2726.     Id As String * 1
  2727.     BaudRate As Integer
  2728.     ByteSize As String * 1
  2729.     Parity As String * 1
  2730.     StopBits As String * 1
  2731.     RlsTimeout As Integer
  2732.     CtsTimeout As Integer
  2733.     DsrTimeout As Integer
  2734.  
  2735.     Bits1 As String * 1 ' The fifteen actual DCB bit-sized data fields
  2736.     Bits2 As String * 1 ' within these two bytes can be manipulated by
  2737.               ' bitwise logical And/Or operations.  Refer to
  2738.               ' SDKWIN.HLP for location/meaning of specific bits
  2739.  
  2740.     XonChar As String * 1
  2741.     XoffChar As String * 1
  2742.     XonLim As Integer
  2743.     XoffLim As Integer
  2744.     PeChar As String * 1
  2745.     EofChar As String * 1
  2746.     EvtChar As String * 1
  2747.     TxDelay As Integer
  2748. End Type
  2749.  
  2750. Type COMSTAT
  2751.     Bits As String * 1 ' For specific bit flags and their 
  2752.              ' meanings, refer to SDKWIN.HLP.
  2753.     cbInQue As Integer
  2754.     cbOutQue As Integer
  2755. End Type
  2756.  
  2757. Declare Function OpenComm Lib "User" (ByVal lpComName As String, ByVal wInQueue As Integer, ByVal wOutQueue As Integer) As Integer
  2758. Declare Function SetCommState Lib "User" (lpDCB As DCB) As Integer
  2759. Declare Function GetCommState Lib "User" (ByVal nCid As Integer, lpDCB as DCB) As Integer
  2760. Declare Function ReadComm Lib "User" (ByVal nCid As Integer, ByVal lpBuf As String, ByVal nSize As Integer) As Integer
  2761. Declare Function UngetCommChar Lib "User" (ByVal nCid As Integer, ByVal cChar As Integer) As Integer
  2762. Declare Function WriteComm Lib "User" (ByVal nCid As Integer, ByVal lpBuf As String, ByVal nSize As Integer) As Integer
  2763. Declare Function CloseComm Lib "User" (ByVal nCid As Integer) As Integer
  2764. Declare Function BuildCommDCB Lib "User" (ByVal lpDef As String, lpDCB As DCB) As Integer
  2765. Declare Function TransmitCommChar Lib "User" (ByVal nCid As Integer, ByVal cChar As Integer) As Integer
  2766. Declare Function SetCommEventMask Lib "User" (ByVal nCid as Integer, nEvtMask as Integer) As Long
  2767. Declare Function GetCommEventMask Lib "User" (ByVal nCid As Integer, ByVal nEvtMask As Integer) As Integer
  2768. Declare Function SetCommBreak Lib "User" (ByVal nCid As Integer) As Integer
  2769. Declare Function ClearCommBreak Lib "User" (ByVal nCid As Integer) As Integer
  2770. Declare Function FlushComm Lib "User" (ByVal nCid As Integer, ByVal nQueue As Integer) As Integer
  2771. Declare Function EscapeCommFunction Lib "User" (ByVal nCid As Integer, ByVal nFunc As Integer) As Integer
  2772.  
  2773. Type MDICREATESTRUCT
  2774.     szClass As Long
  2775.     szTitle As Long
  2776.     hOwner As Integer
  2777.     x As Integer
  2778.     y As Integer
  2779.     cx As Integer
  2780.     cy As Integer
  2781.     style As Long
  2782.     lParam As Long
  2783. End Type
  2784.  
  2785. Type CLIENTCREATESTRUCT
  2786.     hWindowMenu As Integer
  2787.     idFirstChild As Integer
  2788. End Type
  2789.  
  2790. Declare Function DefFrameProc Lib "User" (ByVal hWnd As Integer, ByVal hWndMDIClient As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Long) As Long
  2791. Declare Function DefMDIChildProc Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Long) As Long
  2792.  
  2793. Declare Function TranslateMDISysAccel Lib "User" (ByVal hWndClient As Integer, lpMsg As MSG) As Integer
  2794.  
  2795. Declare Function ArrangeIconicWindows Lib "User" (ByVal hWnd As Integer) As Integer
  2796.  
  2797.  
  2798. '  Help engine section.
  2799.  
  2800. ' Commands to pass WinHelp()
  2801. Global Const HELP_CONTEXT = &H1 '  Display topic in ulTopic
  2802. Global Const HELP_QUIT = &H2    '  Terminate help
  2803. Global Const HELP_INDEX = &H3   '  Display index
  2804. Global Const HELP_HELPONHELP = &H4      '  Display help on using help
  2805. Global Const HELP_SETINDEX = &H5        '  Set the current Index for multi index help
  2806. Global Const HELP_KEY = &H101           '  Display topic for keyword in offabData
  2807. Global Const HELP_MULTIKEY = &H201
  2808.  
  2809. Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
  2810.  
  2811. Type MULTIKEYHELP
  2812.     mkSize As Integer
  2813.     mkKeylist As String * 1
  2814.     szKeyphrase As String * 253 ' Array length is arbitrary; may be changed
  2815.  
  2816. End Type
  2817.  
  2818. ' function declarations for profiler routines contained in Windows libraries
  2819. Declare Function ProfInsChk Lib "User" () As Integer
  2820. Declare Sub ProfSetup Lib "User" (ByVal nBufferSize As Integer, ByVal nSamples As Integer)
  2821. Declare Sub ProfSampRate Lib "User" (ByVal nRate286 As Integer, ByVal nRate386 As Integer)
  2822. Declare Sub ProfStart Lib "User" ()
  2823. Declare Sub ProfStop Lib "User" ()
  2824. Declare Sub ProfClear Lib "User" ()
  2825. Declare Sub ProfFlush Lib "User" ()
  2826. Declare Sub ProfFinish Lib "User" ()
  2827.