home *** CD-ROM | disk | FTP | other *** search
/ Wacky Windows Stuff... / WACKY.iso / rackcode / win30api.txt < prev    next >
Text File  |  1992-10-20  |  124KB  |  2,818 lines

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