HackerPro536

Get File Index

Jan 11th, 2016
739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 182.96 KB | None | 0 0
  1. Global Const $http_status_ok = 200
  2.  
  3. Func httppost($surl, $sdata = "")
  4.     Local $ohttp = ObjCreate("WinHttp.WinHttpRequest.5.1")
  5.     $ohttp.open("POST", $surl, False)
  6.     If (@error) Then Return SetError(1, 0, 0)
  7.     $ohttp.setrequestheader("Content-Type", "application/x-www-form-urlencoded")
  8.     $ohttp.send($sdata)
  9.     If (@error) Then Return SetError(2, 0, 0)
  10.     If ($ohttp.status <> $http_status_ok) Then Return SetError(3, 0, 0)
  11.     Return SetError(0, 0, $ohttp.responsetext)
  12. EndFunc
  13.  
  14. Func httpget($surl, $sdata = "")
  15.     Local $ohttp = ObjCreate("WinHttp.WinHttpRequest.5.1")
  16.     $ohttp.open("GET", $surl & "?" & $sdata, False)
  17.     If (@error) Then Return SetError(1, 0, 0)
  18.     $ohttp.send()
  19.     If (@error) Then Return SetError(2, 0, 0)
  20.     If ($ohttp.status <> $http_status_ok) Then Return SetError(3, 0, 0)
  21.     Return SetError(0, 0, $ohttp.responsetext)
  22. EndFunc
  23.  
  24. Global Const $ss_left = 0
  25. Global Const $ss_center = 1
  26. Global Const $ss_right = 2
  27. Global Const $ss_icon = 3
  28. Global Const $ss_blackrect = 4
  29. Global Const $ss_grayrect = 5
  30. Global Const $ss_whiterect = 6
  31. Global Const $ss_blackframe = 7
  32. Global Const $ss_grayframe = 8
  33. Global Const $ss_whiteframe = 9
  34. Global Const $ss_simple = 11
  35. Global Const $ss_leftnowordwrap = 12
  36. Global Const $ss_bitmap = 14
  37. Global Const $ss_enhmetafile = 15
  38. Global Const $ss_etchedhorz = 16
  39. Global Const $ss_etchedvert = 17
  40. Global Const $ss_etchedframe = 18
  41. Global Const $ss_realsizecontrol = 64
  42. Global Const $ss_noprefix = 128
  43. Global Const $ss_notify = 256
  44. Global Const $ss_centerimage = 512
  45. Global Const $ss_rightjust = 1024
  46. Global Const $ss_sunken = 4096
  47. Global Const $gui_ss_default_label = 0
  48. Global Const $gui_ss_default_graphic = 0
  49. Global Const $gui_ss_default_icon = $ss_notify
  50. Global Const $gui_ss_default_pic = $ss_notify
  51. Global Const $stm_seticon = 368
  52. Global Const $stm_geticon = 369
  53. Global Const $stm_setimage = 370
  54. Global Const $stm_getimage = 371
  55. Global Const $gui_event_single = 0
  56. Global Const $gui_event_array = 1
  57. Global Const $gui_event_none = 0
  58. Global Const $gui_event_close = -3
  59. Global Const $gui_event_minimize = -4
  60. Global Const $gui_event_restore = -5
  61. Global Const $gui_event_maximize = -6
  62. Global Const $gui_event_primarydown = -7
  63. Global Const $gui_event_primaryup = -8
  64. Global Const $gui_event_secondarydown = -9
  65. Global Const $gui_event_secondaryup = -10
  66. Global Const $gui_event_mousemove = -11
  67. Global Const $gui_event_resized = -12
  68. Global Const $gui_event_dropped = -13
  69. Global Const $gui_rundefmsg = "GUI_RUNDEFMSG"
  70. Global Const $gui_avistop = 0
  71. Global Const $gui_avistart = 1
  72. Global Const $gui_aviclose = 2
  73. Global Const $gui_checked = 1
  74. Global Const $gui_indeterminate = 2
  75. Global Const $gui_unchecked = 4
  76. Global Const $gui_dropaccepted = 8
  77. Global Const $gui_nodropaccepted = 4096
  78. Global Const $gui_acceptfiles = $gui_dropaccepted
  79. Global Const $gui_show = 16
  80. Global Const $gui_hide = 32
  81. Global Const $gui_enable = 64
  82. Global Const $gui_disable = 128
  83. Global Const $gui_focus = 256
  84. Global Const $gui_nofocus = 8192
  85. Global Const $gui_defbutton = 512
  86. Global Const $gui_expand = 1024
  87. Global Const $gui_ontop = 2048
  88. Global Const $gui_fontnormal = 0
  89. Global Const $gui_fontitalic = 2
  90. Global Const $gui_fontunder = 4
  91. Global Const $gui_fontstrike = 8
  92. Global Const $gui_dockauto = 1
  93. Global Const $gui_dockleft = 2
  94. Global Const $gui_dockright = 4
  95. Global Const $gui_dockhcenter = 8
  96. Global Const $gui_docktop = 32
  97. Global Const $gui_dockbottom = 64
  98. Global Const $gui_dockvcenter = 128
  99. Global Const $gui_dockwidth = 256
  100. Global Const $gui_dockheight = 512
  101. Global Const $gui_docksize = 768
  102. Global Const $gui_dockmenubar = 544
  103. Global Const $gui_dockstatebar = 576
  104. Global Const $gui_dockall = 802
  105. Global Const $gui_dockborders = 102
  106. Global Const $gui_gr_close = 1
  107. Global Const $gui_gr_line = 2
  108. Global Const $gui_gr_bezier = 4
  109. Global Const $gui_gr_move = 6
  110. Global Const $gui_gr_color = 8
  111. Global Const $gui_gr_rect = 10
  112. Global Const $gui_gr_ellipse = 12
  113. Global Const $gui_gr_pie = 14
  114. Global Const $gui_gr_dot = 16
  115. Global Const $gui_gr_pixel = 18
  116. Global Const $gui_gr_hint = 20
  117. Global Const $gui_gr_refresh = 22
  118. Global Const $gui_gr_pensize = 24
  119. Global Const $gui_gr_nobkcolor = -2
  120. Global Const $gui_bkcolor_default = -1
  121. Global Const $gui_bkcolor_transparent = -2
  122. Global Const $gui_bkcolor_lv_alternate = -33554432
  123. Global Const $gui_read_default = 0
  124. Global Const $gui_read_extended = 1
  125. Global Const $gui_cursor_nooverride = 0
  126. Global Const $gui_cursor_override = 1
  127. Global Const $gui_ws_ex_parentdrag = 1048576
  128. Global Const $wc_animate = "SysAnimate32"
  129. Global Const $wc_button = "Button"
  130. Global Const $wc_combobox = "ComboBox"
  131. Global Const $wc_comboboxex = "ComboBoxEx32"
  132. Global Const $wc_datetimepick = "SysDateTimePick32"
  133. Global Const $wc_edit = "Edit"
  134. Global Const $wc_header = "SysHeader32"
  135. Global Const $wc_hotkey = "msctls_hotkey32"
  136. Global Const $wc_ipaddress = "SysIPAddress32"
  137. Global Const $wc_link = "SysLink"
  138. Global Const $wc_listbox = "ListBox"
  139. Global Const $wc_listview = "SysListView32"
  140. Global Const $wc_monthcal = "SysMonthCal32"
  141. Global Const $wc_nativefontctl = "NativeFontCtl"
  142. Global Const $wc_pagescroller = "SysPager"
  143. Global Const $wc_progress = "msctls_progress32"
  144. Global Const $wc_rebar = "ReBarWindow32"
  145. Global Const $wc_scrollbar = "ScrollBar"
  146. Global Const $wc_static = "Static"
  147. Global Const $wc_statusbar = "msctls_statusbar32"
  148. Global Const $wc_tabcontrol = "SysTabControl32"
  149. Global Const $wc_toolbar = "ToolbarWindow32"
  150. Global Const $wc_tooltips = "tooltips_class32"
  151. Global Const $wc_trackbar = "msctls_trackbar32"
  152. Global Const $wc_treeview = "SysTreeView32"
  153. Global Const $wc_updown = "msctls_updown32"
  154. Global Const $ws_overlapped = 0
  155. Global Const $ws_tiled = $ws_overlapped
  156. Global Const $ws_maximizebox = 65536
  157. Global Const $ws_minimizebox = 131072
  158. Global Const $ws_tabstop = 65536
  159. Global Const $ws_group = 131072
  160. Global Const $ws_sizebox = 262144
  161. Global Const $ws_thickframe = $ws_sizebox
  162. Global Const $ws_sysmenu = 524288
  163. Global Const $ws_hscroll = 1048576
  164. Global Const $ws_vscroll = 2097152
  165. Global Const $ws_dlgframe = 4194304
  166. Global Const $ws_border = 8388608
  167. Global Const $ws_caption = 12582912
  168. Global Const $ws_overlappedwindow = BitOR($ws_caption, $ws_maximizebox, $ws_minimizebox, $ws_overlapped, $ws_sysmenu, $ws_thickframe)
  169. Global Const $ws_tiledwindow = $ws_overlappedwindow
  170. Global Const $ws_maximize = 16777216
  171. Global Const $ws_clipchildren = 33554432
  172. Global Const $ws_clipsiblings = 67108864
  173. Global Const $ws_disabled = 134217728
  174. Global Const $ws_visible = 268435456
  175. Global Const $ws_minimize = 536870912
  176. Global Const $ws_iconic = $ws_minimize
  177. Global Const $ws_child = 1073741824
  178. Global Const $ws_childwindow = $ws_child
  179. Global Const $ws_popup = -2147483648
  180. Global Const $ws_popupwindow = -2138570752
  181. Global Const $ds_3dlook = 4
  182. Global Const $ds_absalign = 1
  183. Global Const $ds_center = 2048
  184. Global Const $ds_centermouse = 4096
  185. Global Const $ds_contexthelp = 8192
  186. Global Const $ds_control = 1024
  187. Global Const $ds_fixedsys = 8
  188. Global Const $ds_localedit = 32
  189. Global Const $ds_modalframe = 128
  190. Global Const $ds_nofailcreate = 16
  191. Global Const $ds_noidlemsg = 256
  192. Global Const $ds_setfont = 64
  193. Global Const $ds_setforeground = 512
  194. Global Const $ds_shellfont = BitOR($ds_fixedsys, $ds_setfont)
  195. Global Const $ds_sysmodal = 2
  196. Global Const $ws_ex_acceptfiles = 16
  197. Global Const $ws_ex_appwindow = 262144
  198. Global Const $ws_ex_composited = 33554432
  199. Global Const $ws_ex_controlparent = 65536
  200. Global Const $ws_ex_clientedge = 512
  201. Global Const $ws_ex_contexthelp = 1024
  202. Global Const $ws_ex_dlgmodalframe = 1
  203. Global Const $ws_ex_layered = 524288
  204. Global Const $ws_ex_layoutrtl = 4194304
  205. Global Const $ws_ex_left = 0
  206. Global Const $ws_ex_leftscrollbar = 16384
  207. Global Const $ws_ex_ltrreading = 0
  208. Global Const $ws_ex_mdichild = 64
  209. Global Const $ws_ex_noactivate = 134217728
  210. Global Const $ws_ex_noinheritlayout = 1048576
  211. Global Const $ws_ex_noparentnotify = 4
  212. Global Const $ws_ex_right = 4096
  213. Global Const $ws_ex_rightscrollbar = 0
  214. Global Const $ws_ex_rtlreading = 8192
  215. Global Const $ws_ex_staticedge = 131072
  216. Global Const $ws_ex_toolwindow = 128
  217. Global Const $ws_ex_topmost = 8
  218. Global Const $ws_ex_transparent = 32
  219. Global Const $ws_ex_windowedge = 256
  220. Global Const $ws_ex_overlappedwindow = BitOR($ws_ex_clientedge, $ws_ex_windowedge)
  221. Global Const $ws_ex_palettewindow = BitOR($ws_ex_toolwindow, $ws_ex_topmost, $ws_ex_windowedge)
  222. Global Const $wm_null = 0
  223. Global Const $wm_create = 1
  224. Global Const $wm_destroy = 2
  225. Global Const $wm_move = 3
  226. Global Const $wm_sizewait = 4
  227. Global Const $wm_size = 5
  228. Global Const $wm_activate = 6
  229. Global Const $wm_setfocus = 7
  230. Global Const $wm_killfocus = 8
  231. Global Const $wm_setvisible = 9
  232. Global Const $wm_enable = 10
  233. Global Const $wm_setredraw = 11
  234. Global Const $wm_settext = 12
  235. Global Const $wm_gettext = 13
  236. Global Const $wm_gettextlength = 14
  237. Global Const $wm_paint = 15
  238. Global Const $wm_close = 16
  239. Global Const $wm_queryendsession = 17
  240. Global Const $wm_quit = 18
  241. Global Const $wm_erasebkgnd = 20
  242. Global Const $wm_queryopen = 19
  243. Global Const $wm_syscolorchange = 21
  244. Global Const $wm_endsession = 22
  245. Global Const $wm_systemerror = 23
  246. Global Const $wm_showwindow = 24
  247. Global Const $wm_ctlcolor = 25
  248. Global Const $wm_settingchange = 26
  249. Global Const $wm_wininichange = 26
  250. Global Const $wm_devmodechange = 27
  251. Global Const $wm_activateapp = 28
  252. Global Const $wm_fontchange = 29
  253. Global Const $wm_timechange = 30
  254. Global Const $wm_cancelmode = 31
  255. Global Const $wm_setcursor = 32
  256. Global Const $wm_mouseactivate = 33
  257. Global Const $wm_childactivate = 34
  258. Global Const $wm_queuesync = 35
  259. Global Const $wm_getminmaxinfo = 36
  260. Global Const $wm_logoff = 37
  261. Global Const $wm_painticon = 38
  262. Global Const $wm_iconerasebkgnd = 39
  263. Global Const $wm_nextdlgctl = 40
  264. Global Const $wm_alttabactive = 41
  265. Global Const $wm_spoolerstatus = 42
  266. Global Const $wm_drawitem = 43
  267. Global Const $wm_measureitem = 44
  268. Global Const $wm_deleteitem = 45
  269. Global Const $wm_vkeytoitem = 46
  270. Global Const $wm_chartoitem = 47
  271. Global Const $wm_setfont = 48
  272. Global Const $wm_getfont = 49
  273. Global Const $wm_sethotkey = 50
  274. Global Const $wm_gethotkey = 51
  275. Global Const $wm_filesyschange = 52
  276. Global Const $wm_isactiveicon = 53
  277. Global Const $wm_queryparkicon = 54
  278. Global Const $wm_querydragicon = 55
  279. Global Const $wm_winhelp = 56
  280. Global Const $wm_compareitem = 57
  281. Global Const $wm_fullscreen = 58
  282. Global Const $wm_clientshutdown = 59
  283. Global Const $wm_ddemlevent = 60
  284. Global Const $wm_getobject = 61
  285. Global Const $wm_calcscroll = 63
  286. Global Const $wm_testing = 64
  287. Global Const $wm_compacting = 65
  288. Global Const $wm_otherwindowcreated = 66
  289. Global Const $wm_otherwindowdestroyed = 67
  290. Global Const $wm_commnotify = 68
  291. Global Const $wm_mediastatuschange = 69
  292. Global Const $wm_windowposchanging = 70
  293. Global Const $wm_windowposchanged = 71
  294. Global Const $wm_power = 72
  295. Global Const $wm_copyglobaldata = 73
  296. Global Const $wm_copydata = 74
  297. Global Const $wm_canceljournal = 75
  298. Global Const $wm_logonnotify = 76
  299. Global Const $wm_keyf1 = 77
  300. Global Const $wm_notify = 78
  301. Global Const $wm_access_window = 79
  302. Global Const $wm_inputlangchangerequest = 80
  303. Global Const $wm_inputlangchange = 81
  304. Global Const $wm_tcard = 82
  305. Global Const $wm_help = 83
  306. Global Const $wm_userchanged = 84
  307. Global Const $wm_notifyformat = 85
  308. Global Const $wm_qm_activate = 96
  309. Global Const $wm_hook_do_callback = 97
  310. Global Const $wm_syscopydata = 98
  311. Global Const $wm_finaldestroy = 112
  312. Global Const $wm_measureitem_clientdata = 113
  313. Global Const $wm_contextmenu = 123
  314. Global Const $wm_stylechanging = 124
  315. Global Const $wm_stylechanged = 125
  316. Global Const $wm_displaychange = 126
  317. Global Const $wm_geticon = 127
  318. Global Const $wm_seticon = 128
  319. Global Const $wm_nccreate = 129
  320. Global Const $wm_ncdestroy = 130
  321. Global Const $wm_nccalcsize = 131
  322. Global Const $wm_nchittest = 132
  323. Global Const $wm_ncpaint = 133
  324. Global Const $wm_ncactivate = 134
  325. Global Const $wm_getdlgcode = 135
  326. Global Const $wm_syncpaint = 136
  327. Global Const $wm_synctask = 137
  328. Global Const $wm_kludgeminrect = 139
  329. Global Const $wm_lpkdrawswitchwnd = 140
  330. Global Const $wm_uahdestroywindow = 144
  331. Global Const $wm_uahdrawmenu = 145
  332. Global Const $wm_uahdrawmenuitem = 146
  333. Global Const $wm_uahinitmenu = 147
  334. Global Const $wm_uahmeasuremenuitem = 148
  335. Global Const $wm_uahncpaintmenupopup = 149
  336. Global Const $wm_ncmousemove = 160
  337. Global Const $wm_nclbuttondown = 161
  338. Global Const $wm_nclbuttonup = 162
  339. Global Const $wm_nclbuttondblclk = 163
  340. Global Const $wm_ncrbuttondown = 164
  341. Global Const $wm_ncrbuttonup = 165
  342. Global Const $wm_ncrbuttondblclk = 166
  343. Global Const $wm_ncmbuttondown = 167
  344. Global Const $wm_ncmbuttonup = 168
  345. Global Const $wm_ncmbuttondblclk = 169
  346. Global Const $wm_ncxbuttondown = 171
  347. Global Const $wm_ncxbuttonup = 172
  348. Global Const $wm_ncxbuttondblclk = 173
  349. Global Const $wm_ncuahdrawcaption = 174
  350. Global Const $wm_ncuahdrawframe = 175
  351. Global Const $wm_input_device_change = 254
  352. Global Const $wm_input = 255
  353. Global Const $wm_keydown = 256
  354. Global Const $wm_keyfirst = 256
  355. Global Const $wm_keyup = 257
  356. Global Const $wm_char = 258
  357. Global Const $wm_deadchar = 259
  358. Global Const $wm_syskeydown = 260
  359. Global Const $wm_syskeyup = 261
  360. Global Const $wm_syschar = 262
  361. Global Const $wm_sysdeadchar = 263
  362. Global Const $wm_yomichar = 264
  363. Global Const $wm_keylast = 265
  364. Global Const $wm_unichar = 265
  365. Global Const $wm_convertrequest = 266
  366. Global Const $wm_convertresult = 267
  367. Global Const $wm_im_info = 268
  368. Global Const $wm_ime_startcomposition = 269
  369. Global Const $wm_ime_endcomposition = 270
  370. Global Const $wm_ime_composition = 271
  371. Global Const $wm_ime_keylast = 271
  372. Global Const $wm_initdialog = 272
  373. Global Const $wm_command = 273
  374. Global Const $wm_syscommand = 274
  375. Global Const $wm_timer = 275
  376. Global Const $wm_hscroll = 276
  377. Global Const $wm_vscroll = 277
  378. Global Const $wm_initmenu = 278
  379. Global Const $wm_initmenupopup = 279
  380. Global Const $wm_systimer = 280
  381. Global Const $wm_gesture = 281
  382. Global Const $wm_gesturenotify = 282
  383. Global Const $wm_gestureinput = 283
  384. Global Const $wm_gesturenotified = 284
  385. Global Const $wm_menuselect = 287
  386. Global Const $wm_menuchar = 288
  387. Global Const $wm_enteridle = 289
  388. Global Const $wm_menurbuttonup = 290
  389. Global Const $wm_menudrag = 291
  390. Global Const $wm_menugetobject = 292
  391. Global Const $wm_uninitmenupopup = 293
  392. Global Const $wm_menucommand = 294
  393. Global Const $wm_changeuistate = 295
  394. Global Const $wm_updateuistate = 296
  395. Global Const $wm_queryuistate = 297
  396. Global Const $wm_lbtrackpoint = 305
  397. Global Const $wm_ctlcolormsgbox = 306
  398. Global Const $wm_ctlcoloredit = 307
  399. Global Const $wm_ctlcolorlistbox = 308
  400. Global Const $wm_ctlcolorbtn = 309
  401. Global Const $wm_ctlcolordlg = 310
  402. Global Const $wm_ctlcolorscrollbar = 311
  403. Global Const $wm_ctlcolorstatic = 312
  404. Global Const $mn_gethmenu = 481
  405. Global Const $wm_parentnotify = 528
  406. Global Const $wm_entermenuloop = 529
  407. Global Const $wm_exitmenuloop = 530
  408. Global Const $wm_nextmenu = 531
  409. Global Const $wm_sizing = 532
  410. Global Const $wm_capturechanged = 533
  411. Global Const $wm_moving = 534
  412. Global Const $wm_powerbroadcast = 536
  413. Global Const $wm_devicechange = 537
  414. Global Const $wm_mdicreate = 544
  415. Global Const $wm_mdidestroy = 545
  416. Global Const $wm_mdiactivate = 546
  417. Global Const $wm_mdirestore = 547
  418. Global Const $wm_mdinext = 548
  419. Global Const $wm_mdimaximize = 549
  420. Global Const $wm_mditile = 550
  421. Global Const $wm_mdicascade = 551
  422. Global Const $wm_mdiiconarrange = 552
  423. Global Const $wm_mdigetactive = 553
  424. Global Const $wm_dropobject = 554
  425. Global Const $wm_querydropobject = 555
  426. Global Const $wm_begindrag = 556
  427. Global Const $wm_dragloop = 557
  428. Global Const $wm_dragselect = 558
  429. Global Const $wm_dragmove = 559
  430. Global Const $wm_mdisetmenu = 560
  431. Global Const $wm_entersizemove = 561
  432. Global Const $wm_exitsizemove = 562
  433. Global Const $wm_dropfiles = 563
  434. Global Const $wm_mdirefreshmenu = 564
  435. Global Const $wm_touch = 576
  436. Global Const $wm_ime_setcontext = 641
  437. Global Const $wm_ime_notify = 642
  438. Global Const $wm_ime_control = 643
  439. Global Const $wm_ime_compositionfull = 644
  440. Global Const $wm_ime_select = 645
  441. Global Const $wm_ime_char = 646
  442. Global Const $wm_ime_system = 647
  443. Global Const $wm_ime_request = 648
  444. Global Const $wm_ime_keydown = 656
  445. Global Const $wm_ime_keyup = 657
  446. Global Const $wm_ncmousehover = 672
  447. Global Const $wm_mousehover = 673
  448. Global Const $wm_ncmouseleave = 674
  449. Global Const $wm_mouseleave = 675
  450. Global Const $wm_wtssession_change = 689
  451. Global Const $wm_tablet_first = 704
  452. Global Const $wm_tablet_last = 735
  453. Global Const $wm_cut = 768
  454. Global Const $wm_copy = 769
  455. Global Const $wm_paste = 770
  456. Global Const $wm_clear = 771
  457. Global Const $wm_undo = 772
  458. Global Const $wm_paletteischanging = 784
  459. Global Const $wm_hotkey = 786
  460. Global Const $wm_palettechanged = 785
  461. Global Const $wm_sysmenu = 787
  462. Global Const $wm_hookmsg = 788
  463. Global Const $wm_exitprocess = 789
  464. Global Const $wm_wakethread = 790
  465. Global Const $wm_print = 791
  466. Global Const $wm_printclient = 792
  467. Global Const $wm_appcommand = 793
  468. Global Const $wm_querynewpalette = 783
  469. Global Const $wm_themechanged = 794
  470. Global Const $wm_uahinit = 795
  471. Global Const $wm_desktopnotify = 796
  472. Global Const $wm_clipboardupdate = 797
  473. Global Const $wm_dwmcompositionchanged = 798
  474. Global Const $wm_dwmncrenderingchanged = 799
  475. Global Const $wm_dwmcolorizationcolorchanged = 800
  476. Global Const $wm_dwmwindowmaximizedchange = 801
  477. Global Const $wm_dwmexileframe = 802
  478. Global Const $wm_dwmsendiconicthumbnail = 803
  479. Global Const $wm_magnification_started = 804
  480. Global Const $wm_magnification_ended = 805
  481. Global Const $wm_dwmsendiconiclivepreviewbitmap = 806
  482. Global Const $wm_dwmthumbnailsizechanged = 807
  483. Global Const $wm_magnification_output = 808
  484. Global Const $wm_measurecontrol = 816
  485. Global Const $wm_getactiontext = 817
  486. Global Const $wm_forwardkeydown = 819
  487. Global Const $wm_forwardkeyup = 820
  488. Global Const $wm_gettitlebarinfoex = 831
  489. Global Const $wm_notifywow = 832
  490. Global Const $wm_handheldfirst = 856
  491. Global Const $wm_handheldlast = 863
  492. Global Const $wm_afxfirst = 864
  493. Global Const $wm_afxlast = 895
  494. Global Const $wm_penwinfirst = 896
  495. Global Const $wm_penwinlast = 911
  496. Global Const $wm_dde_initiate = 992
  497. Global Const $wm_dde_terminate = 993
  498. Global Const $wm_dde_advise = 994
  499. Global Const $wm_dde_unadvise = 995
  500. Global Const $wm_dde_ack = 996
  501. Global Const $wm_dde_data = 997
  502. Global Const $wm_dde_request = 998
  503. Global Const $wm_dde_poke = 999
  504. Global Const $wm_dde_execute = 1000
  505. Global Const $wm_dbnotification = 1021
  506. Global Const $wm_netconnect = 1022
  507. Global Const $wm_hibernate = 1023
  508. Global Const $wm_user = 1024
  509. Global Const $wm_app = 32768
  510. Global Const $nm_first = 0
  511. Global Const $nm_outofmemory = $nm_first - 1
  512. Global Const $nm_click = $nm_first - 2
  513. Global Const $nm_dblclk = $nm_first - 3
  514. Global Const $nm_return = $nm_first - 4
  515. Global Const $nm_rclick = $nm_first - 5
  516. Global Const $nm_rdblclk = $nm_first - 6
  517. Global Const $nm_setfocus = $nm_first - 7
  518. Global Const $nm_killfocus = $nm_first - 8
  519. Global Const $nm_customdraw = $nm_first - 12
  520. Global Const $nm_hover = $nm_first - 13
  521. Global Const $nm_nchittest = $nm_first - 14
  522. Global Const $nm_keydown = $nm_first - 15
  523. Global Const $nm_releasedcapture = $nm_first - 16
  524. Global Const $nm_setcursor = $nm_first - 17
  525. Global Const $nm_char = $nm_first - 18
  526. Global Const $nm_tooltipscreated = $nm_first - 19
  527. Global Const $nm_ldown = $nm_first - 20
  528. Global Const $nm_rdown = $nm_first - 21
  529. Global Const $nm_themechanged = $nm_first - 22
  530. Global Const $wm_mousefirst = 512
  531. Global Const $wm_mousemove = 512
  532. Global Const $wm_lbuttondown = 513
  533. Global Const $wm_lbuttonup = 514
  534. Global Const $wm_lbuttondblclk = 515
  535. Global Const $wm_rbuttondown = 516
  536. Global Const $wm_rbuttonup = 517
  537. Global Const $wm_rbuttondblclk = 518
  538. Global Const $wm_mbuttondown = 519
  539. Global Const $wm_mbuttonup = 520
  540. Global Const $wm_mbuttondblclk = 521
  541. Global Const $wm_mousewheel = 522
  542. Global Const $wm_xbuttondown = 523
  543. Global Const $wm_xbuttonup = 524
  544. Global Const $wm_xbuttondblclk = 525
  545. Global Const $wm_mousehwheel = 526
  546. Global Const $ps_solid = 0
  547. Global Const $ps_dash = 1
  548. Global Const $ps_dot = 2
  549. Global Const $ps_dashdot = 3
  550. Global Const $ps_dashdotdot = 4
  551. Global Const $ps_null = 5
  552. Global Const $ps_insideframe = 6
  553. Global Const $ps_userstyle = 7
  554. Global Const $ps_alternate = 8
  555. Global Const $ps_endcap_round = 0
  556. Global Const $ps_endcap_square = 256
  557. Global Const $ps_endcap_flat = 512
  558. Global Const $ps_join_bevel = 4096
  559. Global Const $ps_join_miter = 8192
  560. Global Const $ps_join_round = 0
  561. Global Const $ps_geometric = 65536
  562. Global Const $ps_cosmetic = 0
  563. Global Const $lwa_alpha = 2
  564. Global Const $lwa_colorkey = 1
  565. Global Const $rgn_and = 1
  566. Global Const $rgn_or = 2
  567. Global Const $rgn_xor = 3
  568. Global Const $rgn_diff = 4
  569. Global Const $rgn_copy = 5
  570. Global Const $errorregion = 0
  571. Global Const $nullregion = 1
  572. Global Const $simpleregion = 2
  573. Global Const $complexregion = 3
  574. Global Const $transparent = 1
  575. Global Const $opaque = 2
  576. Global Const $ccm_first = 8192
  577. Global Const $ccm_getunicodeformat = ($ccm_first + 6)
  578. Global Const $ccm_setunicodeformat = ($ccm_first + 5)
  579. Global Const $ccm_setbkcolor = $ccm_first + 1
  580. Global Const $ccm_setcolorscheme = $ccm_first + 2
  581. Global Const $ccm_getcolorscheme = $ccm_first + 3
  582. Global Const $ccm_getdroptarget = $ccm_first + 4
  583. Global Const $ccm_setwindowtheme = $ccm_first + 11
  584. Global Const $ga_parent = 1
  585. Global Const $ga_root = 2
  586. Global Const $ga_rootowner = 3
  587. Global Const $sm_cxscreen = 0
  588. Global Const $sm_cyscreen = 1
  589. Global Const $sm_cxvscroll = 2
  590. Global Const $sm_cyhscroll = 3
  591. Global Const $sm_cycaption = 4
  592. Global Const $sm_cxborder = 5
  593. Global Const $sm_cyborder = 6
  594. Global Const $sm_cxdlgframe = 7
  595. Global Const $sm_cydlgframe = 8
  596. Global Const $sm_cyvthumb = 9
  597. Global Const $sm_cxhthumb = 10
  598. Global Const $sm_cxicon = 11
  599. Global Const $sm_cyicon = 12
  600. Global Const $sm_cxcursor = 13
  601. Global Const $sm_cycursor = 14
  602. Global Const $sm_cymenu = 15
  603. Global Const $sm_cxfullscreen = 16
  604. Global Const $sm_cyfullscreen = 17
  605. Global Const $sm_cykanjiwindow = 18
  606. Global Const $sm_mousepresent = 19
  607. Global Const $sm_cyvscroll = 20
  608. Global Const $sm_cxhscroll = 21
  609. Global Const $sm_debug = 22
  610. Global Const $sm_swapbutton = 23
  611. Global Const $sm_reserved1 = 24
  612. Global Const $sm_reserved2 = 25
  613. Global Const $sm_reserved3 = 26
  614. Global Const $sm_reserved4 = 27
  615. Global Const $sm_cxmin = 28
  616. Global Const $sm_cymin = 29
  617. Global Const $sm_cxsize = 30
  618. Global Const $sm_cysize = 31
  619. Global Const $sm_cxframe = 32
  620. Global Const $sm_cyframe = 33
  621. Global Const $sm_cxmintrack = 34
  622. Global Const $sm_cymintrack = 35
  623. Global Const $sm_cxdoubleclk = 36
  624. Global Const $sm_cydoubleclk = 37
  625. Global Const $sm_cxiconspacing = 38
  626. Global Const $sm_cyiconspacing = 39
  627. Global Const $sm_menudropalignment = 40
  628. Global Const $sm_penwindows = 41
  629. Global Const $sm_dbcsenabled = 42
  630. Global Const $sm_cmousebuttons = 43
  631. Global Const $sm_secure = 44
  632. Global Const $sm_cxedge = 45
  633. Global Const $sm_cyedge = 46
  634. Global Const $sm_cxminspacing = 47
  635. Global Const $sm_cyminspacing = 48
  636. Global Const $sm_cxsmicon = 49
  637. Global Const $sm_cysmicon = 50
  638. Global Const $sm_cysmcaption = 51
  639. Global Const $sm_cxsmsize = 52
  640. Global Const $sm_cysmsize = 53
  641. Global Const $sm_cxmenusize = 54
  642. Global Const $sm_cymenusize = 55
  643. Global Const $sm_arrange = 56
  644. Global Const $sm_cxminimized = 57
  645. Global Const $sm_cyminimized = 58
  646. Global Const $sm_cxmaxtrack = 59
  647. Global Const $sm_cymaxtrack = 60
  648. Global Const $sm_cxmaximized = 61
  649. Global Const $sm_cymaximized = 62
  650. Global Const $sm_network = 63
  651. Global Const $sm_cleanboot = 67
  652. Global Const $sm_cxdrag = 68
  653. Global Const $sm_cydrag = 69
  654. Global Const $sm_showsounds = 70
  655. Global Const $sm_cxmenucheck = 71
  656. Global Const $sm_cymenucheck = 72
  657. Global Const $sm_slowmachine = 73
  658. Global Const $sm_mideastenabled = 74
  659. Global Const $sm_mousewheelpresent = 75
  660. Global Const $sm_xvirtualscreen = 76
  661. Global Const $sm_yvirtualscreen = 77
  662. Global Const $sm_cxvirtualscreen = 78
  663. Global Const $sm_cyvirtualscreen = 79
  664. Global Const $sm_cmonitors = 80
  665. Global Const $sm_samedisplayformat = 81
  666. Global Const $sm_immenabled = 82
  667. Global Const $sm_cxfocusborder = 83
  668. Global Const $sm_cyfocusborder = 84
  669. Global Const $sm_tabletpc = 86
  670. Global Const $sm_mediacenter = 87
  671. Global Const $sm_starter = 88
  672. Global Const $sm_serverr2 = 89
  673. Global Const $sm_cmetrics = 90
  674. Global Const $sm_remotesession = 4096
  675. Global Const $sm_shuttingdown = 8192
  676. Global Const $sm_remotecontrol = 8193
  677. Global Const $sm_caretblinkingenabled = 8194
  678. Global Const $blackness = 66
  679. Global Const $captureblt = 1073741824
  680. Global Const $dstinvert = 5570569
  681. Global Const $mergecopy = 12583114
  682. Global Const $mergepaint = 12255782
  683. Global Const $nomirrorbitmap = -2147483648
  684. Global Const $notsrccopy = 3342344
  685. Global Const $notsrcerase = 1114278
  686. Global Const $patcopy = 15728673
  687. Global Const $patinvert = 5898313
  688. Global Const $patpaint = 16452105
  689. Global Const $srcand = 8913094
  690. Global Const $srccopy = 13369376
  691. Global Const $srcerase = 4457256
  692. Global Const $srcinvert = 6684742
  693. Global Const $srcpaint = 15597702
  694. Global Const $whiteness = 16711778
  695. Global Const $dt_bottom = 8
  696. Global Const $dt_calcrect = 1024
  697. Global Const $dt_center = 1
  698. Global Const $dt_editcontrol = 8192
  699. Global Const $dt_end_ellipsis = 32768
  700. Global Const $dt_expandtabs = 64
  701. Global Const $dt_externalleading = 512
  702. Global Const $dt_hideprefix = 1048576
  703. Global Const $dt_internal = 4096
  704. Global Const $dt_left = 0
  705. Global Const $dt_modifystring = 65536
  706. Global Const $dt_noclip = 256
  707. Global Const $dt_nofullwidthcharbreak = 524288
  708. Global Const $dt_noprefix = 2048
  709. Global Const $dt_path_ellipsis = 16384
  710. Global Const $dt_prefixonly = 2097152
  711. Global Const $dt_right = 2
  712. Global Const $dt_rtlreading = 131072
  713. Global Const $dt_singleline = 32
  714. Global Const $dt_tabstop = 128
  715. Global Const $dt_top = 0
  716. Global Const $dt_vcenter = 4
  717. Global Const $dt_wordbreak = 16
  718. Global Const $dt_word_ellipsis = 262144
  719. Global Const $rdw_erase = 4
  720. Global Const $rdw_frame = 1024
  721. Global Const $rdw_internalpaint = 2
  722. Global Const $rdw_invalidate = 1
  723. Global Const $rdw_noerase = 32
  724. Global Const $rdw_noframe = 2048
  725. Global Const $rdw_nointernalpaint = 16
  726. Global Const $rdw_validate = 8
  727. Global Const $rdw_erasenow = 512
  728. Global Const $rdw_updatenow = 256
  729. Global Const $rdw_allchildren = 128
  730. Global Const $rdw_nochildren = 64
  731. Global Const $wm_renderformat = 773
  732. Global Const $wm_renderallformats = 774
  733. Global Const $wm_destroyclipboard = 775
  734. Global Const $wm_drawclipboard = 776
  735. Global Const $wm_paintclipboard = 777
  736. Global Const $wm_vscrollclipboard = 778
  737. Global Const $wm_sizeclipboard = 779
  738. Global Const $wm_askcbformatname = 780
  739. Global Const $wm_changecbchain = 781
  740. Global Const $wm_hscrollclipboard = 782
  741. Global Const $hterror = -2
  742. Global Const $httransparent = -1
  743. Global Const $htnowhere = 0
  744. Global Const $htclient = 1
  745. Global Const $htcaption = 2
  746. Global Const $htsysmenu = 3
  747. Global Const $htgrowbox = 4
  748. Global Const $htsize = $htgrowbox
  749. Global Const $htmenu = 5
  750. Global Const $hthscroll = 6
  751. Global Const $htvscroll = 7
  752. Global Const $htminbutton = 8
  753. Global Const $htmaxbutton = 9
  754. Global Const $htleft = 10
  755. Global Const $htright = 11
  756. Global Const $httop = 12
  757. Global Const $httopleft = 13
  758. Global Const $httopright = 14
  759. Global Const $htbottom = 15
  760. Global Const $htbottomleft = 16
  761. Global Const $htbottomright = 17
  762. Global Const $htborder = 18
  763. Global Const $htreduce = $htminbutton
  764. Global Const $htzoom = $htmaxbutton
  765. Global Const $htsizefirst = $htleft
  766. Global Const $htsizelast = $htbottomright
  767. Global Const $htobject = 19
  768. Global Const $htclose = 20
  769. Global Const $hthelp = 21
  770. Global Const $color_scrollbar = 0
  771. Global Const $color_background = 1
  772. Global Const $color_activecaption = 2
  773. Global Const $color_inactivecaption = 3
  774. Global Const $color_menu = 4
  775. Global Const $color_window = 5
  776. Global Const $color_windowframe = 6
  777. Global Const $color_menutext = 7
  778. Global Const $color_windowtext = 8
  779. Global Const $color_captiontext = 9
  780. Global Const $color_activeborder = 10
  781. Global Const $color_inactiveborder = 11
  782. Global Const $color_appworkspace = 12
  783. Global Const $color_highlight = 13
  784. Global Const $color_highlighttext = 14
  785. Global Const $color_btnface = 15
  786. Global Const $color_btnshadow = 16
  787. Global Const $color_graytext = 17
  788. Global Const $color_btntext = 18
  789. Global Const $color_inactivecaptiontext = 19
  790. Global Const $color_btnhighlight = 20
  791. Global Const $color_3ddkshadow = 21
  792. Global Const $color_3dlight = 22
  793. Global Const $color_infotext = 23
  794. Global Const $color_infobk = 24
  795. Global Const $color_hotlight = 26
  796. Global Const $color_gradientactivecaption = 27
  797. Global Const $color_gradientinactivecaption = 28
  798. Global Const $color_menuhilight = 29
  799. Global Const $color_menubar = 30
  800. Global Const $color_desktop = 1
  801. Global Const $color_3dface = 15
  802. Global Const $color_3dshadow = 16
  803. Global Const $color_3dhighlight = 20
  804. Global Const $color_3dhilight = 20
  805. Global Const $color_btnhilight = 20
  806. Global Const $hinst_commctrl = -1
  807. Global Const $idb_std_small_color = 0
  808. Global Const $idb_std_large_color = 1
  809. Global Const $idb_view_small_color = 4
  810. Global Const $idb_view_large_color = 5
  811. Global Const $idb_hist_small_color = 8
  812. Global Const $idb_hist_large_color = 9
  813. Global Const $startf_forceofffeedback = 128
  814. Global Const $startf_forceonfeedback = 64
  815. Global Const $startf_preventpinning = 8192
  816. Global Const $startf_runfullscreen = 32
  817. Global Const $startf_titleisappid = 4096
  818. Global Const $startf_titleislinkname = 2048
  819. Global Const $startf_usecountchars = 8
  820. Global Const $startf_usefillattribute = 16
  821. Global Const $startf_usehotkey = 512
  822. Global Const $startf_useposition = 4
  823. Global Const $startf_useshowwindow = 1
  824. Global Const $startf_usesize = 2
  825. Global Const $startf_usestdhandles = 256
  826. Global Const $cdds_prepaint = 1
  827. Global Const $cdds_postpaint = 2
  828. Global Const $cdds_preerase = 3
  829. Global Const $cdds_posterase = 4
  830. Global Const $cdds_item = 65536
  831. Global Const $cdds_itemprepaint = 65537
  832. Global Const $cdds_itempostpaint = 65538
  833. Global Const $cdds_itempreerase = 65539
  834. Global Const $cdds_itemposterase = 65540
  835. Global Const $cdds_subitem = 131072
  836. Global Const $cdis_selected = 1
  837. Global Const $cdis_grayed = 2
  838. Global Const $cdis_disabled = 4
  839. Global Const $cdis_checked = 8
  840. Global Const $cdis_focus = 16
  841. Global Const $cdis_default = 32
  842. Global Const $cdis_hot = 64
  843. Global Const $cdis_marked = 128
  844. Global Const $cdis_indeterminate = 256
  845. Global Const $cdis_showkeyboardcues = 512
  846. Global Const $cdis_nearhot = 1024
  847. Global Const $cdis_othersidehot = 2048
  848. Global Const $cdis_drophilited = 4096
  849. Global Const $cdrf_dodefault = 0
  850. Global Const $cdrf_newfont = 2
  851. Global Const $cdrf_skipdefault = 4
  852. Global Const $cdrf_notifypostpaint = 16
  853. Global Const $cdrf_notifyitemdraw = 32
  854. Global Const $cdrf_notifysubitemdraw = 32
  855. Global Const $cdrf_notifyposterase = 64
  856. Global Const $cdrf_doerase = 8
  857. Global Const $cdrf_skippostpaint = 256
  858. Global Const $gui_ss_default_gui = BitOR($ws_minimizebox, $ws_caption, $ws_popup, $ws_sysmenu)
  859. Global Const $bs_groupbox = 7
  860. Global Const $bs_bottom = 2048
  861. Global Const $bs_center = 768
  862. Global Const $bs_defpushbutton = 1
  863. Global Const $bs_left = 256
  864. Global Const $bs_multiline = 8192
  865. Global Const $bs_pushbox = 10
  866. Global Const $bs_pushlike = 4096
  867. Global Const $bs_right = 512
  868. Global Const $bs_rightbutton = 32
  869. Global Const $bs_top = 1024
  870. Global Const $bs_vcenter = 3072
  871. Global Const $bs_flat = 32768
  872. Global Const $bs_icon = 64
  873. Global Const $bs_bitmap = 128
  874. Global Const $bs_notify = 16384
  875. Global Const $bs_splitbutton = 12
  876. Global Const $bs_defsplitbutton = 13
  877. Global Const $bs_commandlink = 14
  878. Global Const $bs_defcommandlink = 15
  879. Global Const $bcsif_glyph = 1
  880. Global Const $bcsif_image = 2
  881. Global Const $bcsif_style = 4
  882. Global Const $bcsif_size = 8
  883. Global Const $bcss_nosplit = 1
  884. Global Const $bcss_stretch = 2
  885. Global Const $bcss_alignleft = 4
  886. Global Const $bcss_image = 8
  887. Global Const $button_imagelist_align_left = 0
  888. Global Const $button_imagelist_align_right = 1
  889. Global Const $button_imagelist_align_top = 2
  890. Global Const $button_imagelist_align_bottom = 3
  891. Global Const $button_imagelist_align_center = 4
  892. Global Const $bs_3state = 5
  893. Global Const $bs_auto3state = 6
  894. Global Const $bs_autocheckbox = 3
  895. Global Const $bs_checkbox = 2
  896. Global Const $bs_radiobutton = 4
  897. Global Const $bs_autoradiobutton = 9
  898. Global Const $bs_ownerdraw = 11
  899. Global Const $gui_ss_default_button = 0
  900. Global Const $gui_ss_default_checkbox = 0
  901. Global Const $gui_ss_default_group = 0
  902. Global Const $gui_ss_default_radio = 0
  903. Global Const $bcm_first = 5632
  904. Global Const $bcm_getidealsize = ($bcm_first + 1)
  905. Global Const $bcm_getimagelist = ($bcm_first + 3)
  906. Global Const $bcm_getnote = ($bcm_first + 10)
  907. Global Const $bcm_getnotelength = ($bcm_first + 11)
  908. Global Const $bcm_getsplitinfo = ($bcm_first + 8)
  909. Global Const $bcm_gettextmargin = ($bcm_first + 5)
  910. Global Const $bcm_setdropdownstate = ($bcm_first + 6)
  911. Global Const $bcm_setimagelist = ($bcm_first + 2)
  912. Global Const $bcm_setnote = ($bcm_first + 9)
  913. Global Const $bcm_setshield = ($bcm_first + 12)
  914. Global Const $bcm_setsplitinfo = ($bcm_first + 7)
  915. Global Const $bcm_settextmargin = ($bcm_first + 4)
  916. Global Const $bm_click = 245
  917. Global Const $bm_getcheck = 240
  918. Global Const $bm_getimage = 246
  919. Global Const $bm_getstate = 242
  920. Global Const $bm_setcheck = 241
  921. Global Const $bm_setdontclick = 248
  922. Global Const $bm_setimage = 247
  923. Global Const $bm_setstate = 243
  924. Global Const $bm_setstyle = 244
  925. Global Const $bcn_first = -1250
  926. Global Const $bcn_dropdown = ($bcn_first + 2)
  927. Global Const $bcn_hotitemchange = ($bcn_first + 1)
  928. Global Const $bn_clicked = 0
  929. Global Const $bn_paint = 1
  930. Global Const $bn_hilite = 2
  931. Global Const $bn_unhilite = 3
  932. Global Const $bn_disable = 4
  933. Global Const $bn_doubleclicked = 5
  934. Global Const $bn_setfocus = 6
  935. Global Const $bn_killfocus = 7
  936. Global Const $bn_pushed = $bn_hilite
  937. Global Const $bn_unpushed = $bn_unhilite
  938. Global Const $bn_dblclk = $bn_doubleclicked
  939. Global Const $bst_checked = 1
  940. Global Const $bst_indeterminate = 2
  941. Global Const $bst_unchecked = 0
  942. Global Const $bst_focus = 8
  943. Global Const $bst_pushed = 4
  944. Global Const $bst_dontclick = 128
  945.  
  946. Func _sendmessage($hwnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
  947.     Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageW", "hwnd", $hwnd, "uint", $imsg, $wparamtype, $wparam, $lparamtype, $lparam)
  948.     If @error Then Return SetError(@error, @extended, "")
  949.     If $ireturn >= 0 AND $ireturn <= 4 Then Return $aresult[$ireturn]
  950.     Return $aresult
  951. EndFunc
  952.  
  953. Func _sendmessagea($hwnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
  954.     Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageA", "hwnd", $hwnd, "uint", $imsg, $wparamtype, $wparam, $lparamtype, $lparam)
  955.     If @error Then Return SetError(@error, @extended, "")
  956.     If $ireturn >= 0 AND $ireturn <= 4 Then Return $aresult[$ireturn]
  957.     Return $aresult
  958. EndFunc
  959.  
  960. Global Const $opt_coordsrelative = 0
  961. Global Const $opt_coordsabsolute = 1
  962. Global Const $opt_coordsclient = 2
  963. Global Const $opt_errorsilent = 0
  964. Global Const $opt_errorfatal = 1
  965. Global Const $opt_capsnostore = 0
  966. Global Const $opt_capsstore = 1
  967. Global Const $opt_matchstart = 1
  968. Global Const $opt_matchany = 2
  969. Global Const $opt_matchexact = 3
  970. Global Const $opt_matchadvanced = 4
  971. Global Const $ccs_top = 1
  972. Global Const $ccs_nomovey = 2
  973. Global Const $ccs_bottom = 3
  974. Global Const $ccs_noresize = 4
  975. Global Const $ccs_noparentalign = 8
  976. Global Const $ccs_nohilite = 16
  977. Global Const $ccs_adjustable = 32
  978. Global Const $ccs_nodivider = 64
  979. Global Const $ccs_vert = 128
  980. Global Const $ccs_left = 129
  981. Global Const $ccs_nomovex = 130
  982. Global Const $ccs_right = 131
  983. Global Const $dt_drivetype = 1
  984. Global Const $dt_ssdstatus = 2
  985. Global Const $dt_bustype = 3
  986. Global Const $proxy_ie = 0
  987. Global Const $proxy_none = 1
  988. Global Const $proxy_specified = 2
  989. Global Const $objid_window = 0
  990. Global Const $objid_titlebar = -2
  991. Global Const $objid_sizegrip = -7
  992. Global Const $objid_caret = -8
  993. Global Const $objid_cursor = -9
  994. Global Const $objid_alert = -10
  995. Global Const $objid_sound = -11
  996. Global Const $dlg_centerontop = 0
  997. Global Const $dlg_notitle = 1
  998. Global Const $dlg_notontop = 2
  999. Global Const $dlg_textleft = 4
  1000. Global Const $dlg_textright = 8
  1001. Global Const $dlg_moveable = 16
  1002. Global Const $dlg_textvcenter = 32
  1003. Global Const $idc_unknown = 0
  1004. Global Const $idc_appstarting = 1
  1005. Global Const $idc_arrow = 2
  1006. Global Const $idc_cross = 3
  1007. Global Const $idc_hand = 32649
  1008. Global Const $idc_help = 4
  1009. Global Const $idc_ibeam = 5
  1010. Global Const $idc_icon = 6
  1011. Global Const $idc_no = 7
  1012. Global Const $idc_size = 8
  1013. Global Const $idc_sizeall = 9
  1014. Global Const $idc_sizenesw = 10
  1015. Global Const $idc_sizens = 11
  1016. Global Const $idc_sizenwse = 12
  1017. Global Const $idc_sizewe = 13
  1018. Global Const $idc_uparrow = 14
  1019. Global Const $idc_wait = 15
  1020. Global Const $idi_application = 32512
  1021. Global Const $idi_asterisk = 32516
  1022. Global Const $idi_exclamation = 32515
  1023. Global Const $idi_hand = 32513
  1024. Global Const $idi_question = 32514
  1025. Global Const $idi_winlogo = 32517
  1026. Global Const $idi_shield = 32518
  1027. Global Const $idi_error = $idi_hand
  1028. Global Const $idi_information = $idi_asterisk
  1029. Global Const $idi_warning = $idi_exclamation
  1030. Global Const $sd_logoff = 0
  1031. Global Const $sd_shutdown = 1
  1032. Global Const $sd_reboot = 2
  1033. Global Const $sd_force = 4
  1034. Global Const $sd_powerdown = 8
  1035. Global Const $sd_forcehung = 16
  1036. Global Const $sd_standby = 32
  1037. Global Const $sd_hibernate = 64
  1038. Global Const $stdin_child = 1
  1039. Global Const $stdout_child = 2
  1040. Global Const $stderr_child = 4
  1041. Global Const $stderr_merged = 8
  1042. Global Const $stdio_inherit_parent = 16
  1043. Global Const $run_create_new_console = 65536
  1044. Global Const $ubound_dimensions = 0
  1045. Global Const $ubound_rows = 1
  1046. Global Const $ubound_columns = 2
  1047. Global Const $mouseeventf_absolute = 32768
  1048. Global Const $mouseeventf_move = 1
  1049. Global Const $mouseeventf_leftdown = 2
  1050. Global Const $mouseeventf_leftup = 4
  1051. Global Const $mouseeventf_rightdown = 8
  1052. Global Const $mouseeventf_rightup = 16
  1053. Global Const $mouseeventf_middledown = 32
  1054. Global Const $mouseeventf_middleup = 64
  1055. Global Const $mouseeventf_wheel = 2048
  1056. Global Const $mouseeventf_xdown = 128
  1057. Global Const $mouseeventf_xup = 256
  1058. Global Const $reg_none = 0
  1059. Global Const $reg_sz = 1
  1060. Global Const $reg_expand_sz = 2
  1061. Global Const $reg_binary = 3
  1062. Global Const $reg_dword = 4
  1063. Global Const $reg_dword_little_endian = 4
  1064. Global Const $reg_dword_big_endian = 5
  1065. Global Const $reg_link = 6
  1066. Global Const $reg_multi_sz = 7
  1067. Global Const $reg_resource_list = 8
  1068. Global Const $reg_full_resource_descriptor = 9
  1069. Global Const $reg_resource_requirements_list = 10
  1070. Global Const $reg_qword = 11
  1071. Global Const $reg_qword_little_endian = 11
  1072. Global Const $hwnd_bottom = 1
  1073. Global Const $hwnd_notopmost = -2
  1074. Global Const $hwnd_top = 0
  1075. Global Const $hwnd_topmost = -1
  1076. Global Const $swp_nosize = 1
  1077. Global Const $swp_nomove = 2
  1078. Global Const $swp_nozorder = 4
  1079. Global Const $swp_noredraw = 8
  1080. Global Const $swp_noactivate = 16
  1081. Global Const $swp_framechanged = 32
  1082. Global Const $swp_drawframe = 32
  1083. Global Const $swp_showwindow = 64
  1084. Global Const $swp_hidewindow = 128
  1085. Global Const $swp_nocopybits = 256
  1086. Global Const $swp_noownerzorder = 512
  1087. Global Const $swp_noreposition = 512
  1088. Global Const $swp_nosendchanging = 1024
  1089. Global Const $swp_defererase = 8192
  1090. Global Const $swp_asyncwindowpos = 16384
  1091. Global Const $keyword_default = 1
  1092. Global Const $keyword_null = 2
  1093. Global Const $declared_local = -1
  1094. Global Const $declared_unknown = 0
  1095. Global Const $declared_global = 1
  1096. Global Const $assign_create = 0
  1097. Global Const $assign_forcelocal = 1
  1098. Global Const $assign_forceglobal = 2
  1099. Global Const $assign_existfail = 4
  1100. Global Const $bi_enable = 0
  1101. Global Const $bi_disable = 1
  1102. Global Const $break_enable = 1
  1103. Global Const $break_disable = 0
  1104. Global Const $cdtray_open = "open"
  1105. Global Const $cdtray_closed = "closed"
  1106. Global Const $send_default = 0
  1107. Global Const $send_raw = 1
  1108. Global Const $dir_default = 0
  1109. Global Const $dir_extended = 1
  1110. Global Const $dir_norecurse = 2
  1111. Global Const $dir_remove = 1
  1112. Global Const $dt_all = "ALL"
  1113. Global Const $dt_cdrom = "CDROM"
  1114. Global Const $dt_removable = "REMOVABLE"
  1115. Global Const $dt_fixed = "FIXED"
  1116. Global Const $dt_network = "NETWORK"
  1117. Global Const $dt_ramdisk = "RAMDISK"
  1118. Global Const $dt_unknown = "UNKNOWN"
  1119. Global Const $dt_undefined = 1
  1120. Global Const $dt_fat = "FAT"
  1121. Global Const $dt_fat32 = "FAT32"
  1122. Global Const $dt_exfat = "exFAT"
  1123. Global Const $dt_ntfs = "NTFS"
  1124. Global Const $dt_nwfs = "NWFS"
  1125. Global Const $dt_cdfs = "CDFS"
  1126. Global Const $dt_udf = "UDF"
  1127. Global Const $dma_default = 0
  1128. Global Const $dma_persistent = 1
  1129. Global Const $dma_authentication = 8
  1130. Global Const $ds_unknown = "UNKNOWN"
  1131. Global Const $ds_ready = "READY"
  1132. Global Const $ds_notready = "NOTREADY"
  1133. Global Const $ds_invalid = "INVALID"
  1134. Global Const $mouse_click_left = "left"
  1135. Global Const $mouse_click_right = "right"
  1136. Global Const $mouse_click_middle = "middle"
  1137. Global Const $mouse_click_main = "main"
  1138. Global Const $mouse_click_menu = "menu"
  1139. Global Const $mouse_click_primary = "primary"
  1140. Global Const $mouse_click_secondary = "secondary"
  1141. Global Const $mouse_wheel_up = "up"
  1142. Global Const $mouse_wheel_down = "down"
  1143. Global Const $number_auto = 0
  1144. Global Const $number_32bit = 1
  1145. Global Const $number_64bit = 2
  1146. Global Const $number_double = 3
  1147. Global Const $obj_name = 1
  1148. Global Const $obj_string = 2
  1149. Global Const $obj_progid = 3
  1150. Global Const $obj_file = 4
  1151. Global Const $obj_module = 5
  1152. Global Const $obj_clsid = 6
  1153. Global Const $obj_iid = 7
  1154. Global Const $exitclose_normal = 0
  1155. Global Const $exitclose_byexit = 1
  1156. Global Const $exitclose_byclick = 2
  1157. Global Const $exitclose_bylogoff = 3
  1158. Global Const $exitclose_bysutdown = 4
  1159. Global Const $process_stats_memory = 0
  1160. Global Const $process_stats_io = 1
  1161. Global Const $process_low = 0
  1162. Global Const $process_belownormal = 1
  1163. Global Const $process_normal = 2
  1164. Global Const $process_abovenormal = 3
  1165. Global Const $process_high = 4
  1166. Global Const $process_realtime = 5
  1167. Global Const $run_logon_noprofile = 0
  1168. Global Const $run_logon_profile = 1
  1169. Global Const $run_logon_network = 2
  1170. Global Const $run_logon_inherit = 4
  1171. Global Const $sound_nowait = 0
  1172. Global Const $sound_wait = 1
  1173. Global Const $shex_open = "open"
  1174. Global Const $shex_edit = "edit"
  1175. Global Const $shex_print = "print"
  1176. Global Const $shex_properties = "properties"
  1177. Global Const $tcp_data_default = 0
  1178. Global Const $tcp_data_binary = 1
  1179. Global Const $udp_open_default = 0
  1180. Global Const $udp_open_broadcast = 1
  1181. Global Const $udp_data_default = 0
  1182. Global Const $udp_data_binary = 1
  1183. Global Const $udp_data_array = 2
  1184. Global Const $tip_noicon = 0
  1185. Global Const $tip_infoicon = 1
  1186. Global Const $tip_warningicon = 2
  1187. Global Const $tip_erroricon = 3
  1188. Global Const $tip_balloon = 1
  1189. Global Const $tip_center = 2
  1190. Global Const $tip_forcevisible = 4
  1191. Global Const $windows_noontop = 0
  1192. Global Const $windows_ontop = 1
  1193. Global Const $fc_nooverwrite = 0
  1194. Global Const $fc_overwrite = 1
  1195. Global Const $fc_createpath = 8
  1196. Global Const $ft_modified = 0
  1197. Global Const $ft_created = 1
  1198. Global Const $ft_accessed = 2
  1199. Global Const $ft_array = 0
  1200. Global Const $ft_string = 1
  1201. Global Const $fsf_createbutton = 1
  1202. Global Const $fsf_newdialog = 2
  1203. Global Const $fsf_editcontrol = 4
  1204. Global Const $ft_nonrecursive = 0
  1205. Global Const $ft_recursive = 1
  1206. Global Const $fo_read = 0
  1207. Global Const $fo_append = 1
  1208. Global Const $fo_overwrite = 2
  1209. Global Const $fo_createpath = 8
  1210. Global Const $fo_binary = 16
  1211. Global Const $fo_unicode = 32
  1212. Global Const $fo_utf16_le = 32
  1213. Global Const $fo_utf16_be = 64
  1214. Global Const $fo_utf8 = 128
  1215. Global Const $fo_utf8_nobom = 256
  1216. Global Const $fo_ansi = 512
  1217. Global Const $fo_utf16_le_nobom = 1024
  1218. Global Const $fo_utf16_be_nobom = 2048
  1219. Global Const $fo_utf8_full = 16384
  1220. Global Const $fo_fullfile_detect = 16384
  1221. Global Const $eof = -1
  1222. Global Const $fd_filemustexist = 1
  1223. Global Const $fd_pathmustexist = 2
  1224. Global Const $fd_multiselect = 4
  1225. Global Const $fd_promptcreatenew = 8
  1226. Global Const $fd_promptoverwrite = 16
  1227. Global Const $create_new = 1
  1228. Global Const $create_always = 2
  1229. Global Const $open_existing = 3
  1230. Global Const $open_always = 4
  1231. Global Const $truncate_existing = 5
  1232. Global Const $invalid_set_file_pointer = -1
  1233. Global Const $file_begin = 0
  1234. Global Const $file_current = 1
  1235. Global Const $file_end = 2
  1236. Global Const $file_attribute_readonly = 1
  1237. Global Const $file_attribute_hidden = 2
  1238. Global Const $file_attribute_system = 4
  1239. Global Const $file_attribute_directory = 16
  1240. Global Const $file_attribute_archive = 32
  1241. Global Const $file_attribute_device = 64
  1242. Global Const $file_attribute_normal = 128
  1243. Global Const $file_attribute_temporary = 256
  1244. Global Const $file_attribute_sparse_file = 512
  1245. Global Const $file_attribute_reparse_point = 1024
  1246. Global Const $file_attribute_compressed = 2048
  1247. Global Const $file_attribute_offline = 4096
  1248. Global Const $file_attribute_not_content_indexed = 8192
  1249. Global Const $file_attribute_encrypted = 16384
  1250. Global Const $file_share_read = 1
  1251. Global Const $file_share_write = 2
  1252. Global Const $file_share_delete = 4
  1253. Global Const $file_share_readwrite = BitOR($file_share_read, $file_share_write)
  1254. Global Const $file_share_any = BitOR($file_share_read, $file_share_write, $file_share_delete)
  1255. Global Const $generic_all = 268435456
  1256. Global Const $generic_execute = 536870912
  1257. Global Const $generic_write = 1073741824
  1258. Global Const $generic_read = -2147483648
  1259. Global Const $generic_readwrite = BitOR($generic_read, $generic_write)
  1260. Global Const $file_encoding_utf16le = 32
  1261. Global Const $fe_entire_utf8 = 1
  1262. Global Const $fe_partialfirst_utf8 = 2
  1263. Global Const $fn_fullpath = 0
  1264. Global Const $fn_relativepath = 1
  1265. Global Const $fv_comments = "Comments"
  1266. Global Const $fv_companyname = "CompanyName"
  1267. Global Const $fv_filedescription = "FileDescription"
  1268. Global Const $fv_fileversion = "FileVersion"
  1269. Global Const $fv_internalname = "InternalName"
  1270. Global Const $fv_legalcopyright = "LegalCopyright"
  1271. Global Const $fv_legaltrademarks = "LegalTrademarks"
  1272. Global Const $fv_originalfilename = "OriginalFilename"
  1273. Global Const $fv_productname = "ProductName"
  1274. Global Const $fv_productversion = "ProductVersion"
  1275. Global Const $fv_privatebuild = "PrivateBuild"
  1276. Global Const $fv_specialbuild = "SpecialBuild"
  1277. Global Const $frta_nocount = 0
  1278. Global Const $frta_count = 1
  1279. Global Const $frta_intarrays = 2
  1280. Global Const $frta_entiresplit = 4
  1281. Global Const $flta_filesfolders = 0
  1282. Global Const $flta_files = 1
  1283. Global Const $flta_folders = 2
  1284. Global Const $fltar_filesfolders = 0
  1285. Global Const $fltar_files = 1
  1286. Global Const $fltar_folders = 2
  1287. Global Const $fltar_nohidden = 4
  1288. Global Const $fltar_nosystem = 8
  1289. Global Const $fltar_nolink = 16
  1290. Global Const $fltar_norecur = 0
  1291. Global Const $fltar_recur = 1
  1292. Global Const $fltar_nosort = 0
  1293. Global Const $fltar_sort = 1
  1294. Global Const $fltar_fastsort = 2
  1295. Global Const $fltar_nopath = 0
  1296. Global Const $fltar_relpath = 1
  1297. Global Const $fltar_fullpath = 2
  1298. Global Const $mb_ok = 0
  1299. Global Const $mb_okcancel = 1
  1300. Global Const $mb_abortretryignore = 2
  1301. Global Const $mb_yesnocancel = 3
  1302. Global Const $mb_yesno = 4
  1303. Global Const $mb_retrycancel = 5
  1304. Global Const $mb_canceltrycontinue = 6
  1305. Global Const $mb_help = 16384
  1306. Global Const $mb_iconstop = 16
  1307. Global Const $mb_iconerror = 16
  1308. Global Const $mb_iconhand = 16
  1309. Global Const $mb_iconquestion = 32
  1310. Global Const $mb_iconexclamation = 48
  1311. Global Const $mb_iconwarning = 48
  1312. Global Const $mb_iconinformation = 64
  1313. Global Const $mb_iconasterisk = 64
  1314. Global Const $mb_usericon = 128
  1315. Global Const $mb_defbutton1 = 0
  1316. Global Const $mb_defbutton2 = 256
  1317. Global Const $mb_defbutton3 = 512
  1318. Global Const $mb_defbutton4 = 768
  1319. Global Const $mb_applmodal = 0
  1320. Global Const $mb_systemmodal = 4096
  1321. Global Const $mb_taskmodal = 8192
  1322. Global Const $mb_default_desktop_only = 131072
  1323. Global Const $mb_right = 524288
  1324. Global Const $mb_rtlreading = 1048576
  1325. Global Const $mb_setforeground = 65536
  1326. Global Const $mb_topmost = 262144
  1327. Global Const $mb_service_notification = 2097152
  1328. Global Const $mb_rightjustified = $mb_right
  1329. Global Const $idtimeout = -1
  1330. Global Const $idok = 1
  1331. Global Const $idcancel = 2
  1332. Global Const $idabort = 3
  1333. Global Const $idretry = 4
  1334. Global Const $idignore = 5
  1335. Global Const $idyes = 6
  1336. Global Const $idno = 7
  1337. Global Const $idclose = 8
  1338. Global Const $idhelp = 9
  1339. Global Const $idtryagain = 10
  1340. Global Const $idcontinue = 11
  1341. Global Const $se_assignprimarytoken_name = "SeAssignPrimaryTokenPrivilege"
  1342. Global Const $se_audit_name = "SeAuditPrivilege"
  1343. Global Const $se_backup_name = "SeBackupPrivilege"
  1344. Global Const $se_change_notify_name = "SeChangeNotifyPrivilege"
  1345. Global Const $se_create_global_name = "SeCreateGlobalPrivilege"
  1346. Global Const $se_create_pagefile_name = "SeCreatePagefilePrivilege"
  1347. Global Const $se_create_permanent_name = "SeCreatePermanentPrivilege"
  1348. Global Const $se_create_symbolic_link_name = "SeCreateSymbolicLinkPrivilege"
  1349. Global Const $se_create_token_name = "SeCreateTokenPrivilege"
  1350. Global Const $se_debug_name = "SeDebugPrivilege"
  1351. Global Const $se_enable_delegation_name = "SeEnableDelegationPrivilege"
  1352. Global Const $se_impersonate_name = "SeImpersonatePrivilege"
  1353. Global Const $se_inc_base_priority_name = "SeIncreaseBasePriorityPrivilege"
  1354. Global Const $se_inc_working_set_name = "SeIncreaseWorkingSetPrivilege"
  1355. Global Const $se_increase_quota_name = "SeIncreaseQuotaPrivilege"
  1356. Global Const $se_load_driver_name = "SeLoadDriverPrivilege"
  1357. Global Const $se_lock_memory_name = "SeLockMemoryPrivilege"
  1358. Global Const $se_machine_account_name = "SeMachineAccountPrivilege"
  1359. Global Const $se_manage_volume_name = "SeManageVolumePrivilege"
  1360. Global Const $se_prof_single_process_name = "SeProfileSingleProcessPrivilege"
  1361. Global Const $se_relabel_name = "SeRelabelPrivilege"
  1362. Global Const $se_remote_shutdown_name = "SeRemoteShutdownPrivilege"
  1363. Global Const $se_restore_name = "SeRestorePrivilege"
  1364. Global Const $se_security_name = "SeSecurityPrivilege"
  1365. Global Const $se_shutdown_name = "SeShutdownPrivilege"
  1366. Global Const $se_sync_agent_name = "SeSyncAgentPrivilege"
  1367. Global Const $se_system_environment_name = "SeSystemEnvironmentPrivilege"
  1368. Global Const $se_system_profile_name = "SeSystemProfilePrivilege"
  1369. Global Const $se_systemtime_name = "SeSystemtimePrivilege"
  1370. Global Const $se_take_ownership_name = "SeTakeOwnershipPrivilege"
  1371. Global Const $se_tcb_name = "SeTcbPrivilege"
  1372. Global Const $se_time_zone_name = "SeTimeZonePrivilege"
  1373. Global Const $se_trusted_credman_access_name = "SeTrustedCredManAccessPrivilege"
  1374. Global Const $se_unsolicited_input_name = "SeUnsolicitedInputPrivilege"
  1375. Global Const $se_undock_name = "SeUndockPrivilege"
  1376. Global Const $se_privilege_enabled_by_default = 1
  1377. Global Const $se_privilege_enabled = 2
  1378. Global Const $se_privilege_removed = 4
  1379. Global Const $se_privilege_used_for_access = -2147483648
  1380. Global Const $se_group_mandatory = 1
  1381. Global Const $se_group_enabled_by_default = 2
  1382. Global Const $se_group_enabled = 4
  1383. Global Const $se_group_owner = 8
  1384. Global Const $se_group_use_for_deny_only = 16
  1385. Global Const $se_group_integrity = 32
  1386. Global Const $se_group_integrity_enabled = 64
  1387. Global Const $se_group_resource = 536870912
  1388. Global Const $se_group_logon_id = -1073741824
  1389. Global Enum $tokenprimary = 1, $tokenimpersonation
  1390. Global Enum $securityanonymous = 0, $securityidentification, $securityimpersonation, $securitydelegation
  1391. Global Enum $tokenuser = 1, $tokengroups, $tokenprivileges, $tokenowner, $tokenprimarygroup, $tokendefaultdacl, $tokensource, $tokentype, $tokenimpersonationlevel, $tokenstatistics, $tokenrestrictedsids, $tokensessionid, $tokengroupsandprivileges, $tokensessionreference, $tokensandboxinert, $tokenauditpolicy, $tokenorigin, $tokenelevationtype, $tokenlinkedtoken, $tokenelevation, $tokenhasrestrictions, $tokenaccessinformation, $tokenvirtualizationallowed, $tokenvirtualizationenabled, $tokenintegritylevel, $tokenuiaccess, $tokenmandatorypolicy, $tokenlogonsid
  1392. Global Const $token_assign_primary = 1
  1393. Global Const $token_duplicate = 2
  1394. Global Const $token_impersonate = 4
  1395. Global Const $token_query = 8
  1396. Global Const $token_query_source = 16
  1397. Global Const $token_adjust_privileges = 32
  1398. Global Const $token_adjust_groups = 64
  1399. Global Const $token_adjust_default = 128
  1400. Global Const $token_adjust_sessionid = 256
  1401. Global Const $token_all_access = 983551
  1402. Global Const $token_read = 131080
  1403. Global Const $token_write = 131296
  1404. Global Const $token_execute = 131072
  1405. Global Const $token_has_traverse_privilege = 1
  1406. Global Const $token_has_backup_privilege = 2
  1407. Global Const $token_has_restore_privilege = 4
  1408. Global Const $token_has_admin_group = 8
  1409. Global Const $token_is_restricted = 16
  1410. Global Const $token_session_not_referenced = 32
  1411. Global Const $token_sandbox_inert = 64
  1412. Global Const $token_has_impersonate_privilege = 128
  1413. Global Const $rights_delete = 65536
  1414. Global Const $read_control = 131072
  1415. Global Const $write_dac = 262144
  1416. Global Const $write_owner = 524288
  1417. Global Const $synchronize = 1048576
  1418. Global Const $access_system_security = 16777216
  1419. Global Const $standard_rights_required = 983040
  1420. Global Const $standard_rights_read = $read_control
  1421. Global Const $standard_rights_write = $read_control
  1422. Global Const $standard_rights_execute = $read_control
  1423. Global Const $standard_rights_all = 2031616
  1424. Global Const $specific_rights_all = 65535
  1425. Global Enum $not_used_access = 0, $grant_access, $set_access, $deny_access, $revoke_access, $set_audit_success, $set_audit_failure
  1426. Global Enum $trustee_is_unknown = 0, $trustee_is_user, $trustee_is_group, $trustee_is_domain, $trustee_is_alias, $trustee_is_well_known_group, $trustee_is_deleted, $trustee_is_invalid, $trustee_is_computer
  1427. Global Const $logon_with_profile = 1
  1428. Global Const $logon_netcredentials_only = 2
  1429. Global Enum $sidtypeuser = 1, $sidtypegroup, $sidtypedomain, $sidtypealias, $sidtypewellknowngroup, $sidtypedeletedaccount, $sidtypeinvalid, $sidtypeunknown, $sidtypecomputer, $sidtypelabel
  1430. Global Const $sid_administrators = "S-1-5-32-544"
  1431. Global Const $sid_users = "S-1-5-32-545"
  1432. Global Const $sid_guests = "S-1-5-32-546"
  1433. Global Const $sid_account_operators = "S-1-5-32-548"
  1434. Global Const $sid_server_operators = "S-1-5-32-549"
  1435. Global Const $sid_print_operators = "S-1-5-32-550"
  1436. Global Const $sid_backup_operators = "S-1-5-32-551"
  1437. Global Const $sid_replicator = "S-1-5-32-552"
  1438. Global Const $sid_owner = "S-1-3-0"
  1439. Global Const $sid_everyone = "S-1-1-0"
  1440. Global Const $sid_network = "S-1-5-2"
  1441. Global Const $sid_interactive = "S-1-5-4"
  1442. Global Const $sid_system = "S-1-5-18"
  1443. Global Const $sid_authenticated_users = "S-1-5-11"
  1444. Global Const $sid_schannel_authentication = "S-1-5-64-14"
  1445. Global Const $sid_digest_authentication = "S-1-5-64-21"
  1446. Global Const $sid_nt_service = "S-1-5-80"
  1447. Global Const $sid_untrusted_mandatory_level = "S-1-16-0"
  1448. Global Const $sid_low_mandatory_level = "S-1-16-4096"
  1449. Global Const $sid_medium_mandatory_level = "S-1-16-8192"
  1450. Global Const $sid_medium_plus_mandatory_level = "S-1-16-8448"
  1451. Global Const $sid_high_mandatory_level = "S-1-16-12288"
  1452. Global Const $sid_system_mandatory_level = "S-1-16-16384"
  1453. Global Const $sid_protected_process_mandatory_level = "S-1-16-20480"
  1454. Global Const $sid_secure_process_mandatory_level = "S-1-16-28672"
  1455. Global Const $sid_all_services = "S-1-5-80-0"
  1456.  
  1457. Func _winapi_getlasterror(Const $_icurrenterror = @error, Const $_icurrentextended = @extended)
  1458.     Local $aresult = DllCall("kernel32.dll", "dword", "GetLastError")
  1459.     Return SetError($_icurrenterror, $_icurrentextended, $aresult[0])
  1460. EndFunc
  1461.  
  1462. Func _winapi_setlasterror($ierrorcode, Const $_icurrenterror = @error, Const $_icurrentextended = @extended)
  1463.     DllCall("kernel32.dll", "none", "SetLastError", "dword", $ierrorcode)
  1464.     Return SetError($_icurrenterror, $_icurrentextended, NULL )
  1465. EndFunc
  1466.  
  1467. Func __comerrorformating($ocomerror, $sprefix = @TAB)
  1468.     Local Const $str_striptrailing = 2
  1469.     Local $serror = "COM Error encountered in " & @ScriptName & " (" & $ocomerror.scriptline & ") :" & @CRLF & $sprefix & "Number        " & @TAB & "= 0x" & Hex($ocomerror.number, 8) & " (" & $ocomerror.number & ")" & @CRLF & $sprefix & "WinDescription" & @TAB & "= " & StringStripWS($ocomerror.windescription, $str_striptrailing) & @CRLF & $sprefix & "Description   " & @TAB & "= " & StringStripWS($ocomerror.description, $str_striptrailing) & @CRLF & $sprefix & "Source        " & @TAB & "= " & $ocomerror.source & @CRLF & $sprefix & "HelpFile      " & @TAB & "= " & $ocomerror.helpfile & @CRLF & $sprefix & "HelpContext   " & @TAB & "= " & $ocomerror.helpcontext & @CRLF & $sprefix & "LastDllError  " & @TAB & "= " & $ocomerror.lastdllerror & @CRLF & $sprefix & "Retcode       " & @TAB & "= 0x" & Hex($ocomerror.retcode)
  1470.     Return $serror
  1471. EndFunc
  1472.  
  1473. Func _security__adjusttokenprivileges($htoken, $bdisableall, $tnewstate, $ibufferlen, $tprevstate = 0, $prequired = 0)
  1474.     Local $acall = DllCall("advapi32.dll", "bool", "AdjustTokenPrivileges", "handle", $htoken, "bool", $bdisableall, "struct*", $tnewstate, "dword", $ibufferlen, "struct*", $tprevstate, "struct*", $prequired)
  1475.     If @error Then Return SetError(@error, @extended, False)
  1476.     Return NOT ($acall[0] = 0)
  1477. EndFunc
  1478.  
  1479. Func _security__createprocesswithtoken($htoken, $ilogonflags, $scommandline, $icreationflags, $scurdir, $tstartupinfo, $tprocess_information)
  1480.     Local $acall = DllCall("advapi32.dll", "bool", "CreateProcessWithTokenW", "handle", $htoken, "dword", $ilogonflags, "ptr", 0, "wstr", $scommandline, "dword", $icreationflags, "struct*", 0, "wstr", $scurdir, "struct*", $tstartupinfo, "struct*", $tprocess_information)
  1481.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, False)
  1482.     Return True
  1483. EndFunc
  1484.  
  1485. Func _security__duplicatetokenex($hexistingtoken, $idesiredaccess, $iimpersonationlevel, $itokentype)
  1486.     Local $acall = DllCall("advapi32.dll", "bool", "DuplicateTokenEx", "handle", $hexistingtoken, "dword", $idesiredaccess, "struct*", 0, "int", $iimpersonationlevel, "int", $itokentype, "handle*", 0)
  1487.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
  1488.     Return $acall[6]
  1489. EndFunc
  1490.  
  1491. Func _security__getaccountsid($saccount, $ssystem = "")
  1492.     Local $aacct = _security__lookupaccountname($saccount, $ssystem)
  1493.     If @error Then Return SetError(@error, @extended, 0)
  1494.     If IsArray($aacct) Then Return _security__stringsidtosid($aacct[0])
  1495.     Return ""
  1496. EndFunc
  1497.  
  1498. Func _security__getlengthsid($psid)
  1499.     If NOT _security__isvalidsid($psid) Then Return SetError(@error + 10, @extended, 0)
  1500.     Local $acall = DllCall("advapi32.dll", "dword", "GetLengthSid", "struct*", $psid)
  1501.     If @error Then Return SetError(@error, @extended, 0)
  1502.     Return $acall[0]
  1503. EndFunc
  1504.  
  1505. Func _security__gettokeninformation($htoken, $iclass)
  1506.     Local $acall = DllCall("advapi32.dll", "bool", "GetTokenInformation", "handle", $htoken, "int", $iclass, "struct*", 0, "dword", 0, "dword*", 0)
  1507.     If @error OR NOT $acall[5] Then Return SetError(@error + 10, @extended, 0)
  1508.     Local $ilen = $acall[5]
  1509.     Local $tbuffer = DllStructCreate("byte[" & $ilen & "]")
  1510.     $acall = DllCall("advapi32.dll", "bool", "GetTokenInformation", "handle", $htoken, "int", $iclass, "struct*", $tbuffer, "dword", DllStructGetSize($tbuffer), "dword*", 0)
  1511.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
  1512.     Return $tbuffer
  1513. EndFunc
  1514.  
  1515. Func _security__impersonateself($ilevel = $securityimpersonation)
  1516.     Local $acall = DllCall("advapi32.dll", "bool", "ImpersonateSelf", "int", $ilevel)
  1517.     If @error Then Return SetError(@error, @extended, False)
  1518.     Return NOT ($acall[0] = 0)
  1519. EndFunc
  1520.  
  1521. Func _security__isvalidsid($psid)
  1522.     Local $acall = DllCall("advapi32.dll", "bool", "IsValidSid", "struct*", $psid)
  1523.     If @error Then Return SetError(@error, @extended, False)
  1524.     Return NOT ($acall[0] = 0)
  1525. EndFunc
  1526.  
  1527. Func _security__lookupaccountname($saccount, $ssystem = "")
  1528.     Local $tdata = DllStructCreate("byte SID[256]")
  1529.     Local $acall = DllCall("advapi32.dll", "bool", "LookupAccountNameW", "wstr", $ssystem, "wstr", $saccount, "struct*", $tdata, "dword*", DllStructGetSize($tdata), "wstr", "", "dword*", DllStructGetSize($tdata), "int*", 0)
  1530.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
  1531.     Local $aacct[3]
  1532.     $aacct[0] = _security__sidtostringsid(DllStructGetPtr($tdata, "SID"))
  1533.     $aacct[1] = $acall[5]
  1534.     $aacct[2] = $acall[7]
  1535.     Return $aacct
  1536. EndFunc
  1537.  
  1538. Func _security__lookupaccountsid($vsid, $ssystem = "")
  1539.     Local $psid, $aacct[3]
  1540.     If IsString($vsid) Then
  1541.         $psid = _security__stringsidtosid($vsid)
  1542.     Else
  1543.         $psid = $vsid
  1544.     EndIf
  1545.     If NOT _security__isvalidsid($psid) Then Return SetError(@error + 10, @extended, 0)
  1546.     Local $stypesystem = "ptr"
  1547.     If $ssystem Then $stypesystem = "wstr"
  1548.     Local $acall = DllCall("advapi32.dll", "bool", "LookupAccountSidW", $stypesystem, $ssystem, "struct*", $psid, "wstr", "", "dword*", 65536, "wstr", "", "dword*", 65536, "int*", 0)
  1549.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
  1550.     Local $aacct[3]
  1551.     $aacct[0] = $acall[3]
  1552.     $aacct[1] = $acall[5]
  1553.     $aacct[2] = $acall[7]
  1554.     Return $aacct
  1555. EndFunc
  1556.  
  1557. Func _security__lookupprivilegevalue($ssystem, $sname)
  1558.     Local $acall = DllCall("advapi32.dll", "bool", "LookupPrivilegeValueW", "wstr", $ssystem, "wstr", $sname, "int64*", 0)
  1559.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
  1560.     Return $acall[3]
  1561. EndFunc
  1562.  
  1563. Func _security__openprocesstoken($hprocess, $iaccess)
  1564.     Local $acall = DllCall("advapi32.dll", "bool", "OpenProcessToken", "handle", $hprocess, "dword", $iaccess, "handle*", 0)
  1565.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
  1566.     Return $acall[3]
  1567. EndFunc
  1568.  
  1569. Func _security__openthreadtoken($iaccess, $hthread = 0, $bopenasself = False)
  1570.     If $hthread = 0 Then
  1571.         Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentThread")
  1572.         If @error Then Return SetError(@error + 10, @extended, 0)
  1573.         $hthread = $aresult[0]
  1574.     EndIf
  1575.     Local $acall = DllCall("advapi32.dll", "bool", "OpenThreadToken", "handle", $hthread, "dword", $iaccess, "bool", $bopenasself, "handle*", 0)
  1576.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
  1577.     Return $acall[4]
  1578. EndFunc
  1579.  
  1580. Func _security__openthreadtokenex($iaccess, $hthread = 0, $bopenasself = False)
  1581.     Local $htoken = _security__openthreadtoken($iaccess, $hthread, $bopenasself)
  1582.     If $htoken = 0 Then
  1583.         Local Const $error_no_token = 1008
  1584.         If _winapi_getlasterror() <> $error_no_token Then Return SetError(20, _winapi_getlasterror(), 0)
  1585.         If NOT _security__impersonateself() Then Return SetError(@error + 10, _winapi_getlasterror(), 0)
  1586.         $htoken = _security__openthreadtoken($iaccess, $hthread, $bopenasself)
  1587.         If $htoken = 0 Then Return SetError(@error, _winapi_getlasterror(), 0)
  1588.     EndIf
  1589.     Return $htoken
  1590. EndFunc
  1591.  
  1592. Func _security__setprivilege($htoken, $sprivilege, $benable)
  1593.     Local $iluid = _security__lookupprivilegevalue("", $sprivilege)
  1594.     If $iluid = 0 Then Return SetError(@error + 10, @extended, False)
  1595.     Local Const $tagtoken_privileges = "dword Count;align 4;int64 LUID;dword Attributes"
  1596.     Local $tcurrstate = DllStructCreate($tagtoken_privileges)
  1597.     Local $icurrstate = DllStructGetSize($tcurrstate)
  1598.     Local $tprevstate = DllStructCreate($tagtoken_privileges)
  1599.     Local $iprevstate = DllStructGetSize($tprevstate)
  1600.     Local $trequired = DllStructCreate("int Data")
  1601.     DllStructSetData($tcurrstate, "Count", 1)
  1602.     DllStructSetData($tcurrstate, "LUID", $iluid)
  1603.     If NOT _security__adjusttokenprivileges($htoken, False, $tcurrstate, $icurrstate, $tprevstate, $trequired) Then Return SetError(2, @error, False)
  1604.     DllStructSetData($tprevstate, "Count", 1)
  1605.     DllStructSetData($tprevstate, "LUID", $iluid)
  1606.     Local $iattributes = DllStructGetData($tprevstate, "Attributes")
  1607.     If $benable Then
  1608.         $iattributes = BitOR($iattributes, $se_privilege_enabled)
  1609.     Else
  1610.         $iattributes = BitAND($iattributes, BitNOT($se_privilege_enabled))
  1611.     EndIf
  1612.     DllStructSetData($tprevstate, "Attributes", $iattributes)
  1613.     If NOT _security__adjusttokenprivileges($htoken, False, $tprevstate, $iprevstate, $tcurrstate, $trequired) Then Return SetError(3, @error, False)
  1614.     Return True
  1615. EndFunc
  1616.  
  1617. Func _security__settokeninformation($htoken, $itokeninformation, $vtokeninformation, $itokeninformationlength)
  1618.     Local $acall = DllCall("advapi32.dll", "bool", "SetTokenInformation", "handle", $htoken, "int", $itokeninformation, "struct*", $vtokeninformation, "dword", $itokeninformationlength)
  1619.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, False)
  1620.     Return True
  1621. EndFunc
  1622.  
  1623. Func _security__sidtostringsid($psid)
  1624.     If NOT _security__isvalidsid($psid) Then Return SetError(@error + 10, 0, "")
  1625.     Local $acall = DllCall("advapi32.dll", "bool", "ConvertSidToStringSidW", "struct*", $psid, "ptr*", 0)
  1626.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, "")
  1627.     Local $pstringsid = $acall[2]
  1628.     Local $alen = DllCall("kernel32.dll", "int", "lstrlenW", "struct*", $pstringsid)
  1629.     Local $ssid = DllStructGetData(DllStructCreate("wchar Text[" & $alen[0] + 1 & "]", $pstringsid), "Text")
  1630.     DllCall("kernel32.dll", "handle", "LocalFree", "handle", $pstringsid)
  1631.     Return $ssid
  1632. EndFunc
  1633.  
  1634. Func _security__sidtypestr($itype)
  1635.     Switch $itype
  1636.         Case $sidtypeuser
  1637.             Return "User"
  1638.         Case $sidtypegroup
  1639.             Return "Group"
  1640.         Case $sidtypedomain
  1641.             Return "Domain"
  1642.         Case $sidtypealias
  1643.             Return "Alias"
  1644.         Case $sidtypewellknowngroup
  1645.             Return "Well Known Group"
  1646.         Case $sidtypedeletedaccount
  1647.             Return "Deleted Account"
  1648.         Case $sidtypeinvalid
  1649.             Return "Invalid"
  1650.         Case $sidtypeunknown
  1651.             Return "Unknown Type"
  1652.         Case $sidtypecomputer
  1653.             Return "Computer"
  1654.         Case $sidtypelabel
  1655.             Return "A mandatory integrity label SID"
  1656.         Case Else
  1657.             Return "Unknown SID Type"
  1658.     EndSwitch
  1659. EndFunc
  1660.  
  1661. Func _security__stringsidtosid($ssid)
  1662.     Local $acall = DllCall("advapi32.dll", "bool", "ConvertStringSidToSidW", "wstr", $ssid, "ptr*", 0)
  1663.     If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
  1664.     Local $psid = $acall[2]
  1665.     Local $tbuffer = DllStructCreate("byte Data[" & _security__getlengthsid($psid) & "]", $psid)
  1666.     Local $tsid = DllStructCreate("byte Data[" & DllStructGetSize($tbuffer) & "]")
  1667.     DllStructSetData($tsid, "Data", DllStructGetData($tbuffer, "Data"))
  1668.     DllCall("kernel32.dll", "handle", "LocalFree", "handle", $psid)
  1669.     Return $tsid
  1670. EndFunc
  1671.  
  1672. Global Const $str_nocasesense = 0
  1673. Global Const $str_casesense = 1
  1674. Global Const $str_nocasesensebasic = 2
  1675. Global Const $str_stripleading = 1
  1676. Global Const $str_striptrailing = 2
  1677. Global Const $str_stripspaces = 4
  1678. Global Const $str_stripall = 8
  1679. Global Const $str_chrsplit = 0
  1680. Global Const $str_entiresplit = 1
  1681. Global Const $str_nocount = 2
  1682. Global Const $str_regexpmatch = 0
  1683. Global Const $str_regexparraymatch = 1
  1684. Global Const $str_regexparrayfullmatch = 2
  1685. Global Const $str_regexparrayglobalmatch = 3
  1686. Global Const $str_regexparrayglobalfullmatch = 4
  1687. Global Const $str_endisstart = 0
  1688. Global Const $str_endnotstart = 1
  1689. Global Const $sb_ansi = 1
  1690. Global Const $sb_utf16le = 2
  1691. Global Const $sb_utf16be = 3
  1692. Global Const $sb_utf8 = 4
  1693. Global Const $se_utf16 = 0
  1694. Global Const $se_ansi = 1
  1695. Global Const $se_utf8 = 2
  1696. Global Const $str_utf16 = 0
  1697. Global Const $str_ucs2 = 1
  1698. Global Const $tagpoint = "struct;long X;long Y;endstruct"
  1699. Global Const $tagrect = "struct;long Left;long Top;long Right;long Bottom;endstruct"
  1700. Global Const $tagsize = "struct;long X;long Y;endstruct"
  1701. Global Const $tagmargins = "int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight"
  1702. Global Const $tagfiletime = "struct;dword Lo;dword Hi;endstruct"
  1703. Global Const $tagsystemtime = "struct;word Year;word Month;word Dow;word Day;word Hour;word Minute;word Second;word MSeconds;endstruct"
  1704. Global Const $tagtime_zone_information = "struct;long Bias;wchar StdName[32];word StdDate[8];long StdBias;wchar DayName[32];word DayDate[8];long DayBias;endstruct"
  1705. Global Const $tagnmhdr = "struct;hwnd hWndFrom;uint_ptr IDFrom;INT Code;endstruct"
  1706. Global Const $tagcomboboxexitem = "uint Mask;int_ptr Item;ptr Text;int TextMax;int Image;int SelectedImage;int OverlayImage;" & "int Indent;lparam Param"
  1707. Global Const $tagnmcbedragbegin = $tagnmhdr & ";int ItemID;wchar szText[260]"
  1708. Global Const $tagnmcbeendedit = $tagnmhdr & ";bool fChanged;int NewSelection;wchar szText[260];int Why"
  1709. Global Const $tagnmcomboboxex = $tagnmhdr & ";uint Mask;int_ptr Item;ptr Text;int TextMax;int Image;" & "int SelectedImage;int OverlayImage;int Indent;lparam Param"
  1710. Global Const $tagdtprange = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;" & "word MinSecond;word MinMSecond;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;" & "word MaxMinute;word MaxSecond;word MaxMSecond;bool MinValid;bool MaxValid"
  1711. Global Const $tagnmdatetimechange = $tagnmhdr & ";dword Flag;" & $tagsystemtime
  1712. Global Const $tagnmdatetimeformat = $tagnmhdr & ";ptr Format;" & $tagsystemtime & ";ptr pDisplay;wchar Display[64]"
  1713. Global Const $tagnmdatetimeformatquery = $tagnmhdr & ";ptr Format;struct;long SizeX;long SizeY;endstruct"
  1714. Global Const $tagnmdatetimekeydown = $tagnmhdr & ";int VirtKey;ptr Format;" & $tagsystemtime
  1715. Global Const $tagnmdatetimestring = $tagnmhdr & ";ptr UserString;" & $tagsystemtime & ";dword Flags"
  1716. Global Const $tageventlogrecord = "dword Length;dword Reserved;dword RecordNumber;dword TimeGenerated;dword TimeWritten;dword EventID;" & "word EventType;word NumStrings;word EventCategory;word ReservedFlags;dword ClosingRecordNumber;dword StringOffset;" & "dword UserSidLength;dword UserSidOffset;dword DataLength;dword DataOffset"
  1717. Global Const $taggdip_effectparams_blur = "float Radius; bool ExpandEdge"
  1718. Global Const $taggdip_effectparams_brightnesscontrast = "int BrightnessLevel; int ContrastLevel"
  1719. Global Const $taggdip_effectparams_colorbalance = "int CyanRed; int MagentaGreen; int YellowBlue"
  1720. Global Const $taggdip_effectparams_colorcurve = "int Adjustment; int Channel; int AdjustValue"
  1721. Global Const $taggdip_effectparams_colorlut = "byte LutB[256]; byte LutG[256]; byte LutR[256]; byte LutA[256]"
  1722. Global Const $taggdip_effectparams_huesaturationlightness = "int HueLevel; int SaturationLevel; int LightnessLevel"
  1723. Global Const $taggdip_effectparams_levels = "int Highlight; int Midtone; int Shadow"
  1724. Global Const $taggdip_effectparams_redeyecorrection = "uint NumberOfAreas; ptr Areas"
  1725. Global Const $taggdip_effectparams_sharpen = "float Radius; float Amount"
  1726. Global Const $taggdip_effectparams_tint = "int Hue; int Amount"
  1727. Global Const $taggdipbitmapdata = "uint Width;uint Height;int Stride;int Format;ptr Scan0;uint_ptr Reserved"
  1728. Global Const $taggdipcolormatrix = "float m[25]"
  1729. Global Const $taggdipencoderparam = "struct;byte GUID[16];ulong NumberOfValues;ulong Type;ptr Values;endstruct"
  1730. Global Const $taggdipencoderparams = "uint Count;" & $taggdipencoderparam
  1731. Global Const $taggdiprectf = "struct;float X;float Y;float Width;float Height;endstruct"
  1732. Global Const $taggdipstartupinput = "uint Version;ptr Callback;bool NoThread;bool NoCodecs"
  1733. Global Const $taggdipstartupoutput = "ptr HookProc;ptr UnhookProc"
  1734. Global Const $taggdipimagecodecinfo = "byte CLSID[16];byte FormatID[16];ptr CodecName;ptr DllName;ptr FormatDesc;ptr FileExt;" & "ptr MimeType;dword Flags;dword Version;dword SigCount;dword SigSize;ptr SigPattern;ptr SigMask"
  1735. Global Const $taggdippencoderparams = "uint Count;byte Params[1]"
  1736. Global Const $taghditem = "uint Mask;int XY;ptr Text;handle hBMP;int TextMax;int Fmt;lparam Param;int Image;int Order;uint Type;ptr pFilter;uint State"
  1737. Global Const $tagnmhddispinfo = $tagnmhdr & ";int Item;uint Mask;ptr Text;int TextMax;int Image;lparam lParam"
  1738. Global Const $tagnmhdfilterbtnclick = $tagnmhdr & ";int Item;" & $tagrect
  1739. Global Const $tagnmheader = $tagnmhdr & ";int Item;int Button;ptr pItem"
  1740. Global Const $taggetipaddress = "byte Field4;byte Field3;byte Field2;byte Field1"
  1741. Global Const $tagnmipaddress = $tagnmhdr & ";int Field;int Value"
  1742. Global Const $taglvfindinfo = "struct;uint Flags;ptr Text;lparam Param;" & $tagpoint & ";uint Direction;endstruct"
  1743. Global Const $taglvhittestinfo = $tagpoint & ";uint Flags;int Item;int SubItem;int iGroup"
  1744. Global Const $taglvitem = "struct;uint Mask;int Item;int SubItem;uint State;uint StateMask;ptr Text;int TextMax;int Image;lparam Param;" & "int Indent;int GroupID;uint Columns;ptr pColumns;ptr piColFmt;int iGroup;endstruct"
  1745. Global Const $tagnmlistview = $tagnmhdr & ";int Item;int SubItem;uint NewState;uint OldState;uint Changed;" & "struct;long ActionX;long ActionY;endstruct;lparam Param"
  1746. Global Const $tagnmlvcustomdraw = "struct;" & $tagnmhdr & ";dword dwDrawStage;handle hdc;" & $tagrect & ";dword_ptr dwItemSpec;uint uItemState;lparam lItemlParam;endstruct" & ";dword clrText;dword clrTextBk;int iSubItem;dword dwItemType;dword clrFace;int iIconEffect;" & "int iIconPhase;int iPartID;int iStateID;struct;long TextLeft;long TextTop;long TextRight;long TextBottom;endstruct;uint uAlign"
  1747. Global Const $tagnmlvdispinfo = $tagnmhdr & ";" & $taglvitem
  1748. Global Const $tagnmlvfinditem = $tagnmhdr & ";int Start;" & $taglvfindinfo
  1749. Global Const $tagnmlvgetinfotip = $tagnmhdr & ";dword Flags;ptr Text;int TextMax;int Item;int SubItem;lparam lParam"
  1750. Global Const $tagnmitemactivate = $tagnmhdr & ";int Index;int SubItem;uint NewState;uint OldState;uint Changed;" & $tagpoint & ";lparam lParam;uint KeyFlags"
  1751. Global Const $tagnmlvkeydown = "align 1;" & $tagnmhdr & ";word VKey;uint Flags"
  1752. Global Const $tagnmlvscroll = $tagnmhdr & ";int DX;int DY"
  1753. Global Const $tagmchittestinfo = "uint Size;" & $tagpoint & ";uint Hit;" & $tagsystemtime & ";" & $tagrect & ";int iOffset;int iRow;int iCol"
  1754. Global Const $tagmcmonthrange = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;" & "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;" & "word MaxMSeconds;short Span"
  1755. Global Const $tagmcrange = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;" & "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;" & "word MaxMSeconds;short MinSet;short MaxSet"
  1756. Global Const $tagmcselrange = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;" & "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;" & "word MaxMSeconds"
  1757. Global Const $tagnmdaystate = $tagnmhdr & ";" & $tagsystemtime & ";int DayState;ptr pDayState"
  1758. Global Const $tagnmselchange = $tagnmhdr & ";struct;word BegYear;word BegMonth;word BegDOW;word BegDay;word BegHour;word BegMinute;word BegSecond;word BegMSeconds;endstruct;" & "struct;word EndYear;word EndMonth;word EndDOW;word EndDay;word EndHour;word EndMinute;word EndSecond;word EndMSeconds;endstruct"
  1759. Global Const $tagnmobjectnotify = $tagnmhdr & ";int Item;ptr piid;ptr pObject;long Result;dword dwFlags"
  1760. Global Const $tagnmtckeydown = "align 1;" & $tagnmhdr & ";word VKey;uint Flags"
  1761. Global Const $tagtvitem = "struct;uint Mask;handle hItem;uint State;uint StateMask;ptr Text;int TextMax;int Image;int SelectedImage;" & "int Children;lparam Param;endstruct"
  1762. Global Const $tagtvitemex = "struct;" & $tagtvitem & ";int Integral;uint uStateEx;hwnd hwnd;int iExpandedImage;int iReserved;endstruct"
  1763. Global Const $tagnmtreeview = $tagnmhdr & ";uint Action;" & "struct;uint OldMask;handle OldhItem;uint OldState;uint OldStateMask;" & "ptr OldText;int OldTextMax;int OldImage;int OldSelectedImage;int OldChildren;lparam OldParam;endstruct;" & "struct;uint NewMask;handle NewhItem;uint NewState;uint NewStateMask;" & "ptr NewText;int NewTextMax;int NewImage;int NewSelectedImage;int NewChildren;lparam NewParam;endstruct;" & "struct;long PointX;long PointY;endstruct"
  1764. Global Const $tagnmtvcustomdraw = "struct;" & $tagnmhdr & ";dword DrawStage;handle HDC;" & $tagrect & ";dword_ptr ItemSpec;uint ItemState;lparam ItemParam;endstruct" & ";dword ClrText;dword ClrTextBk;int Level"
  1765. Global Const $tagnmtvdispinfo = $tagnmhdr & ";" & $tagtvitem
  1766. Global Const $tagnmtvgetinfotip = $tagnmhdr & ";ptr Text;int TextMax;handle hItem;lparam lParam"
  1767. Global Const $tagnmtvitemchange = $tagnmhdr & ";uint Changed;handle hItem;uint StateNew;uint StateOld;lparam lParam;"
  1768. Global Const $tagtvhittestinfo = $tagpoint & ";uint Flags;handle Item"
  1769. Global Const $tagnmtvkeydown = "align 1;" & $tagnmhdr & ";word VKey;uint Flags"
  1770. Global Const $tagnmmouse = $tagnmhdr & ";dword_ptr ItemSpec;dword_ptr ItemData;" & $tagpoint & ";lparam HitInfo"
  1771. Global Const $tagtoken_privileges = "dword Count;align 4;int64 LUID;dword Attributes"
  1772. Global Const $tagimageinfo = "handle hBitmap;handle hMask;int Unused1;int Unused2;" & $tagrect
  1773. Global Const $tagmenuinfo = "dword Size;INT Mask;dword Style;uint YMax;handle hBack;dword ContextHelpID;ulong_ptr MenuData"
  1774. Global Const $tagmenuiteminfo = "uint Size;uint Mask;uint Type;uint State;uint ID;handle SubMenu;handle BmpChecked;handle BmpUnchecked;" & "ulong_ptr ItemData;ptr TypeData;uint CCH;handle BmpItem"
  1775. Global Const $tagrebarbandinfo = "uint cbSize;uint fMask;uint fStyle;dword clrFore;dword clrBack;ptr lpText;uint cch;" & "int iImage;hwnd hwndChild;uint cxMinChild;uint cyMinChild;uint cx;handle hbmBack;uint wID;uint cyChild;uint cyMaxChild;" & "uint cyIntegral;uint cxIdeal;lparam lParam;uint cxHeader" & ((@OSVersion = "WIN_XP") ? "" : ";" & $tagrect & ";uint uChevronState")
  1776. Global Const $tagnmrebarautobreak = $tagnmhdr & ";uint uBand;uint wID;lparam lParam;uint uMsg;uint fStyleCurrent;bool fAutoBreak"
  1777. Global Const $tagnmrbautosize = $tagnmhdr & ";bool fChanged;" & "struct;long TargetLeft;long TargetTop;long TargetRight;long TargetBottom;endstruct;" & "struct;long ActualLeft;long ActualTop;long ActualRight;long ActualBottom;endstruct"
  1778. Global Const $tagnmrebar = $tagnmhdr & ";dword dwMask;uint uBand;uint fStyle;uint wID;lparam lParam"
  1779. Global Const $tagnmrebarchevron = $tagnmhdr & ";uint uBand;uint wID;lparam lParam;" & $tagrect & ";lparam lParamNM"
  1780. Global Const $tagnmrebarchildsize = $tagnmhdr & ";uint uBand;uint wID;" & "struct;long CLeft;long CTop;long CRight;long CBottom;endstruct;" & "struct;long BLeft;long BTop;long BRight;long BBottom;endstruct"
  1781. Global Const $tagcolorscheme = "dword Size;dword BtnHighlight;dword BtnShadow"
  1782. Global Const $tagnmtoolbar = $tagnmhdr & ";int iItem;" & "struct;int iBitmap;int idCommand;byte fsState;byte fsStyle;dword_ptr dwData;int_ptr iString;endstruct" & ";int cchText;ptr pszText;" & $tagrect
  1783. Global Const $tagnmtbhotitem = $tagnmhdr & ";int idOld;int idNew;dword dwFlags"
  1784. Global Const $tagtbbutton = "int Bitmap;int Command;byte State;byte Style;dword_ptr Param;int_ptr String"
  1785. Global Const $tagtbbuttoninfo = "uint Size;dword Mask;int Command;int Image;byte State;byte Style;word CX;dword_ptr Param;ptr Text;int TextMax"
  1786. Global Const $tagnetresource = "dword Scope;dword Type;dword DisplayType;dword Usage;ptr LocalName;ptr RemoteName;ptr Comment;ptr Provider"
  1787. Global Const $tagoverlapped = "ulong_ptr Internal;ulong_ptr InternalHigh;struct;dword Offset;dword OffsetHigh;endstruct;handle hEvent"
  1788. Global Const $tagopenfilename = "dword StructSize;hwnd hwndOwner;handle hInstance;ptr lpstrFilter;ptr lpstrCustomFilter;" & "dword nMaxCustFilter;dword nFilterIndex;ptr lpstrFile;dword nMaxFile;ptr lpstrFileTitle;dword nMaxFileTitle;" & "ptr lpstrInitialDir;ptr lpstrTitle;dword Flags;word nFileOffset;word nFileExtension;ptr lpstrDefExt;lparam lCustData;" & "ptr lpfnHook;ptr lpTemplateName;ptr pvReserved;dword dwReserved;dword FlagsEx"
  1789. Global Const $tagbitmapinfoheader = "struct;dword biSize;long biWidth;long biHeight;word biPlanes;word biBitCount;" & "dword biCompression;dword biSizeImage;long biXPelsPerMeter;long biYPelsPerMeter;dword biClrUsed;dword biClrImportant;endstruct"
  1790. Global Const $tagbitmapinfo = $tagbitmapinfoheader & ";dword biRGBQuad[1]"
  1791. Global Const $tagblendfunction = "byte Op;byte Flags;byte Alpha;byte Format"
  1792. Global Const $tagguid = "struct;ulong Data1;ushort Data2;ushort Data3;byte Data4[8];endstruct"
  1793. Global Const $tagwindowplacement = "uint length;uint flags;uint showCmd;long ptMinPosition[2];long ptMaxPosition[2];long rcNormalPosition[4]"
  1794. Global Const $tagwindowpos = "hwnd hWnd;hwnd InsertAfter;int X;int Y;int CX;int CY;uint Flags"
  1795. Global Const $tagscrollinfo = "uint cbSize;uint fMask;int nMin;int nMax;uint nPage;int nPos;int nTrackPos"
  1796. Global Const $tagscrollbarinfo = "dword cbSize;" & $tagrect & ";int dxyLineButton;int xyThumbTop;" & "int xyThumbBottom;int reserved;dword rgstate[6]"
  1797. Global Const $taglogfont = "struct;long Height;long Width;long Escapement;long Orientation;long Weight;byte Italic;byte Underline;" & "byte Strikeout;byte CharSet;byte OutPrecision;byte ClipPrecision;byte Quality;byte PitchAndFamily;wchar FaceName[32];endstruct"
  1798. Global Const $tagkbdllhookstruct = "dword vkCode;dword scanCode;dword flags;dword time;ulong_ptr dwExtraInfo"
  1799. Global Const $tagprocess_information = "handle hProcess;handle hThread;dword ProcessID;dword ThreadID"
  1800. Global Const $tagstartupinfo = "dword Size;ptr Reserved1;ptr Desktop;ptr Title;dword X;dword Y;dword XSize;dword YSize;dword XCountChars;" & "dword YCountChars;dword FillAttribute;dword Flags;word ShowWindow;word Reserved2;ptr Reserved3;handle StdInput;" & "handle StdOutput;handle StdError"
  1801. Global Const $tagsecurity_attributes = "dword Length;ptr Descriptor;bool InheritHandle"
  1802. Global Const $tagwin32_find_data = "dword dwFileAttributes;dword ftCreationTime[2];dword ftLastAccessTime[2];dword ftLastWriteTime[2];dword nFileSizeHigh;dword nFileSizeLow;dword dwReserved0;dword dwReserved1;wchar cFileName[260];wchar cAlternateFileName[14]"
  1803. Global Const $tagtextmetric = "long tmHeight;long tmAscent;long tmDescent;long tmInternalLeading;long tmExternalLeading;" & "long tmAveCharWidth;long tmMaxCharWidth;long tmWeight;long tmOverhang;long tmDigitizedAspectX;long tmDigitizedAspectY;" & "wchar tmFirstChar;wchar tmLastChar;wchar tmDefaultChar;wchar tmBreakChar;byte tmItalic;byte tmUnderlined;byte tmStruckOut;" & "byte tmPitchAndFamily;byte tmCharSet"
  1804. Global Const $hgdi_error = Ptr(-1)
  1805. Global Const $invalid_handle_value = Ptr(-1)
  1806. Global Const $clr_invalid = -1
  1807. Global Const $null_brush = 5
  1808. Global Const $null_pen = 8
  1809. Global Const $black_brush = 4
  1810. Global Const $dkgray_brush = 3
  1811. Global Const $dc_brush = 18
  1812. Global Const $gray_brush = 2
  1813. Global Const $hollow_brush = $null_brush
  1814. Global Const $ltgray_brush = 1
  1815. Global Const $white_brush = 0
  1816. Global Const $black_pen = 7
  1817. Global Const $dc_pen = 19
  1818. Global Const $white_pen = 6
  1819. Global Const $ansi_fixed_font = 11
  1820. Global Const $ansi_var_font = 12
  1821. Global Const $device_default_font = 14
  1822. Global Const $default_gui_font = 17
  1823. Global Const $oem_fixed_font = 10
  1824. Global Const $system_font = 13
  1825. Global Const $system_fixed_font = 16
  1826. Global Const $default_palette = 15
  1827. Global Const $mb_precomposed = 1
  1828. Global Const $mb_composite = 2
  1829. Global Const $mb_useglyphchars = 4
  1830. Global Const $ulw_alpha = 2
  1831. Global Const $ulw_colorkey = 1
  1832. Global Const $ulw_opaque = 4
  1833. Global Const $ulw_ex_noresize = 8
  1834. Global Const $wh_callwndproc = 4
  1835. Global Const $wh_callwndprocret = 12
  1836. Global Const $wh_cbt = 5
  1837. Global Const $wh_debug = 9
  1838. Global Const $wh_foregroundidle = 11
  1839. Global Const $wh_getmessage = 3
  1840. Global Const $wh_journalplayback = 1
  1841. Global Const $wh_journalrecord = 0
  1842. Global Const $wh_keyboard = 2
  1843. Global Const $wh_keyboard_ll = 13
  1844. Global Const $wh_mouse = 7
  1845. Global Const $wh_mouse_ll = 14
  1846. Global Const $wh_msgfilter = -1
  1847. Global Const $wh_shell = 10
  1848. Global Const $wh_sysmsgfilter = 6
  1849. Global Const $wpf_asyncwindowplacement = 4
  1850. Global Const $wpf_restoretomaximized = 2
  1851. Global Const $wpf_setminposition = 1
  1852. Global Const $kf_extended = 256
  1853. Global Const $kf_altdown = 8192
  1854. Global Const $kf_up = 32768
  1855. Global Const $llkhf_extended = BitShift($kf_extended, 8)
  1856. Global Const $llkhf_injected = 16
  1857. Global Const $llkhf_altdown = BitShift($kf_altdown, 8)
  1858. Global Const $llkhf_up = BitShift($kf_up, 8)
  1859. Global Const $ofn_allowmultiselect = 512
  1860. Global Const $ofn_createprompt = 8192
  1861. Global Const $ofn_dontaddtorecent = 33554432
  1862. Global Const $ofn_enablehook = 32
  1863. Global Const $ofn_enableincludenotify = 4194304
  1864. Global Const $ofn_enablesizing = 8388608
  1865. Global Const $ofn_enabletemplate = 64
  1866. Global Const $ofn_enabletemplatehandle = 128
  1867. Global Const $ofn_explorer = 524288
  1868. Global Const $ofn_extensiondifferent = 1024
  1869. Global Const $ofn_filemustexist = 4096
  1870. Global Const $ofn_forceshowhidden = 268435456
  1871. Global Const $ofn_hidereadonly = 4
  1872. Global Const $ofn_longnames = 2097152
  1873. Global Const $ofn_nochangedir = 8
  1874. Global Const $ofn_nodereferencelinks = 1048576
  1875. Global Const $ofn_nolongnames = 262144
  1876. Global Const $ofn_nonetworkbutton = 131072
  1877. Global Const $ofn_noreadonlyreturn = 32768
  1878. Global Const $ofn_notestfilecreate = 65536
  1879. Global Const $ofn_novalidate = 256
  1880. Global Const $ofn_overwriteprompt = 2
  1881. Global Const $ofn_pathmustexist = 2048
  1882. Global Const $ofn_readonly = 1
  1883. Global Const $ofn_shareaware = 16384
  1884. Global Const $ofn_showhelp = 16
  1885. Global Const $ofn_ex_noplacesbar = 1
  1886. Global Const $tmpf_fixed_pitch = 1
  1887. Global Const $tmpf_vector = 2
  1888. Global Const $tmpf_truetype = 4
  1889. Global Const $tmpf_device = 8
  1890. Global Const $duplicate_close_source = 1
  1891. Global Const $duplicate_same_access = 2
  1892. Global Const $di_mask = 1
  1893. Global Const $di_image = 2
  1894. Global Const $di_normal = 3
  1895. Global Const $di_compat = 4
  1896. Global Const $di_defaultsize = 8
  1897. Global Const $di_nomirror = 16
  1898. Global Const $display_device_attached_to_desktop = 1
  1899. Global Const $display_device_multi_driver = 2
  1900. Global Const $display_device_primary_device = 4
  1901. Global Const $display_device_mirroring_driver = 8
  1902. Global Const $display_device_vga_compatible = 16
  1903. Global Const $display_device_removable = 32
  1904. Global Const $display_device_disconnect = 33554432
  1905. Global Const $display_device_remote = 67108864
  1906. Global Const $display_device_modespruned = 134217728
  1907. Global Const $flashw_caption = 1
  1908. Global Const $flashw_tray = 2
  1909. Global Const $flashw_timer = 4
  1910. Global Const $flashw_timernofg = 12
  1911. Global Const $format_message_allocate_buffer = 256
  1912. Global Const $format_message_ignore_inserts = 512
  1913. Global Const $format_message_from_string = 1024
  1914. Global Const $format_message_from_hmodule = 2048
  1915. Global Const $format_message_from_system = 4096
  1916. Global Const $format_message_argument_array = 8192
  1917. Global Const $gw_hwndfirst = 0
  1918. Global Const $gw_hwndlast = 1
  1919. Global Const $gw_hwndnext = 2
  1920. Global Const $gw_hwndprev = 3
  1921. Global Const $gw_owner = 4
  1922. Global Const $gw_child = 5
  1923. Global Const $gw_enabledpopup = 6
  1924. Global Const $gwl_wndproc = -4
  1925. Global Const $gwl_hinstance = -6
  1926. Global Const $gwl_hwndparent = -8
  1927. Global Const $gwl_id = -12
  1928. Global Const $gwl_style = -16
  1929. Global Const $gwl_exstyle = -20
  1930. Global Const $gwl_userdata = -21
  1931. Global Const $std_cut = 0
  1932. Global Const $std_copy = 1
  1933. Global Const $std_paste = 2
  1934. Global Const $std_undo = 3
  1935. Global Const $std_redow = 4
  1936. Global Const $std_delete = 5
  1937. Global Const $std_filenew = 6
  1938. Global Const $std_fileopen = 7
  1939. Global Const $std_filesave = 8
  1940. Global Const $std_printpre = 9
  1941. Global Const $std_properties = 10
  1942. Global Const $std_help = 11
  1943. Global Const $std_find = 12
  1944. Global Const $std_replace = 13
  1945. Global Const $std_print = 14
  1946. Global Const $image_bitmap = 0
  1947. Global Const $image_icon = 1
  1948. Global Const $image_cursor = 2
  1949. Global Const $image_enhmetafile = 3
  1950. Global Const $kb_sendspecial = 0
  1951. Global Const $kb_sendraw = 1
  1952. Global Const $kb_capsoff = 0
  1953. Global Const $kb_capson = 1
  1954. Global Const $dont_resolve_dll_references = 1
  1955. Global Const $load_library_as_datafile = 2
  1956. Global Const $load_with_altered_search_path = 8
  1957. Global Const $load_ignore_code_authz_level = 16
  1958. Global Const $load_library_as_datafile_exclusive = 64
  1959. Global Const $load_library_as_image_resource = 32
  1960. Global Const $load_library_search_application_dir = 512
  1961. Global Const $load_library_search_default_dirs = 4096
  1962. Global Const $load_library_search_dll_load_dir = 256
  1963. Global Const $load_library_search_system32 = 2048
  1964. Global Const $load_library_search_user_dirs = 1024
  1965. Global Const $s_ok = 0
  1966. Global Const $e_abort = -2147467260
  1967. Global Const $e_accessdenied = -2147024891
  1968. Global Const $e_fail = -2147467259
  1969. Global Const $e_handle = -2147024890
  1970. Global Const $e_invalidarg = -2147024809
  1971. Global Const $e_nointerface = -2147467262
  1972. Global Const $e_notimpl = -2147467263
  1973. Global Const $e_outofmemory = -2147024882
  1974. Global Const $e_pointer = -2147467261
  1975. Global Const $e_unexpected = -2147418113
  1976. Global Const $lr_defaultcolor = 0
  1977. Global Const $lr_monochrome = 1
  1978. Global Const $lr_color = 2
  1979. Global Const $lr_copyreturnorg = 4
  1980. Global Const $lr_copydeleteorg = 8
  1981. Global Const $lr_loadfromfile = 16
  1982. Global Const $lr_loadtransparent = 32
  1983. Global Const $lr_defaultsize = 64
  1984. Global Const $lr_vgacolor = 128
  1985. Global Const $lr_loadmap3dcolors = 4096
  1986. Global Const $lr_createdibsection = 8192
  1987. Global Const $lr_copyfromresource = 16384
  1988. Global Const $lr_shared = 32768
  1989. Global Const $obm_trtype = 32732
  1990. Global Const $obm_lfarrowi = 32734
  1991. Global Const $obm_rgarrowi = 32735
  1992. Global Const $obm_dnarrowi = 32736
  1993. Global Const $obm_uparrowi = 32737
  1994. Global Const $obm_combo = 32738
  1995. Global Const $obm_mnarrow = 32739
  1996. Global Const $obm_lfarrowd = 32740
  1997. Global Const $obm_rgarrowd = 32741
  1998. Global Const $obm_dnarrowd = 32742
  1999. Global Const $obm_uparrowd = 32743
  2000. Global Const $obm_restored = 32744
  2001. Global Const $obm_zoomd = 32745
  2002. Global Const $obm_reduced = 32746
  2003. Global Const $obm_restore = 32747
  2004. Global Const $obm_zoom = 32748
  2005. Global Const $obm_reduce = 32749
  2006. Global Const $obm_lfarrow = 32750
  2007. Global Const $obm_rgarrow = 32751
  2008. Global Const $obm_dnarrow = 32752
  2009. Global Const $obm_uparrow = 32753
  2010. Global Const $obm_close = 32754
  2011. Global Const $obm_old_restore = 32755
  2012. Global Const $obm_old_zoom = 32756
  2013. Global Const $obm_old_reduce = 32757
  2014. Global Const $obm_btncorners = 32758
  2015. Global Const $obm_checkboxes = 32759
  2016. Global Const $obm_check = 32760
  2017. Global Const $obm_btsize = 32761
  2018. Global Const $obm_old_lfarrow = 32762
  2019. Global Const $obm_old_rgarrow = 32763
  2020. Global Const $obm_old_dnarrow = 32764
  2021. Global Const $obm_old_uparrow = 32765
  2022. Global Const $obm_size = 32766
  2023. Global Const $obm_old_close = 32767
  2024. Global Const $oic_sample = 32512
  2025. Global Const $oic_hand = 32513
  2026. Global Const $oic_ques = 32514
  2027. Global Const $oic_bang = 32515
  2028. Global Const $oic_note = 32516
  2029. Global Const $oic_winlogo = 32517
  2030. Global Const $oic_warning = $oic_bang
  2031. Global Const $oic_error = $oic_hand
  2032. Global Const $oic_information = $oic_note
  2033. Global $__g_ainprocess_winapi[64][2] = [[0, 0]]
  2034. Global $__g_awinlist_winapi[64][2] = [[0, 0]]
  2035. Global Const $__winapiconstant_wm_setfont = 48
  2036. Global Const $__winapiconstant_fw_normal = 400
  2037. Global Const $__winapiconstant_default_charset = 1
  2038. Global Const $__winapiconstant_out_default_precis = 0
  2039. Global Const $__winapiconstant_clip_default_precis = 0
  2040. Global Const $__winapiconstant_default_quality = 0
  2041. Global Const $__winapiconstant_logpixelsx = 88
  2042. Global Const $__winapiconstant_logpixelsy = 90
  2043. Global Const $tagcursorinfo = "dword Size;dword Flags;handle hCursor;" & $tagpoint
  2044. Global Const $tagdisplay_device = "dword Size;wchar Name[32];wchar String[128];dword Flags;wchar ID[128];wchar Key[128]"
  2045. Global Const $tagflashwinfo = "uint Size;hwnd hWnd;dword Flags;uint Count;dword TimeOut"
  2046. Global Const $tagiconinfo = "bool Icon;dword XHotSpot;dword YHotSpot;handle hMask;handle hColor"
  2047. Global Const $tagmemorystatusex = "dword Length;dword MemoryLoad;" & "uint64 TotalPhys;uint64 AvailPhys;uint64 TotalPageFile;uint64 AvailPageFile;" & "uint64 TotalVirtual;uint64 AvailVirtual;uint64 AvailExtendedVirtual"
  2048.  
  2049. Func _winapi_attachconsole($ipid = -1)
  2050.     Local $aresult = DllCall("kernel32.dll", "bool", "AttachConsole", "dword", $ipid)
  2051.     If @error Then Return SetError(@error, @extended, False)
  2052.     Return $aresult[0]
  2053. EndFunc
  2054.  
  2055. Func _winapi_attachthreadinput($iattach, $iattachto, $battach)
  2056.     Local $aresult = DllCall("user32.dll", "bool", "AttachThreadInput", "dword", $iattach, "dword", $iattachto, "bool", $battach)
  2057.     If @error Then Return SetError(@error, @extended, False)
  2058.     Return $aresult[0]
  2059. EndFunc
  2060.  
  2061. Func _winapi_beep($ifreq = 500, $iduration = 1000)
  2062.     Local $aresult = DllCall("kernel32.dll", "bool", "Beep", "dword", $ifreq, "dword", $iduration)
  2063.     If @error Then Return SetError(@error, @extended, False)
  2064.     Return $aresult[0]
  2065. EndFunc
  2066.  
  2067. Func _winapi_bitblt($hdestdc, $ixdest, $iydest, $iwidth, $iheight, $hsrcdc, $ixsrc, $iysrc, $irop)
  2068.     Local $aresult = DllCall("gdi32.dll", "bool", "BitBlt", "handle", $hdestdc, "int", $ixdest, "int", $iydest, "int", $iwidth, "int", $iheight, "handle", $hsrcdc, "int", $ixsrc, "int", $iysrc, "dword", $irop)
  2069.     If @error Then Return SetError(@error, @extended, False)
  2070.     Return $aresult[0]
  2071. EndFunc
  2072.  
  2073. Func _winapi_callnexthookex($hhook, $icode, $wparam, $lparam)
  2074.     Local $aresult = DllCall("user32.dll", "lresult", "CallNextHookEx", "handle", $hhook, "int", $icode, "wparam", $wparam, "lparam", $lparam)
  2075.     If @error Then Return SetError(@error, @extended, -1)
  2076.     Return $aresult[0]
  2077. EndFunc
  2078.  
  2079. Func _winapi_callwindowproc($pprevwndfunc, $hwnd, $imsg, $wparam, $lparam)
  2080.     Local $aresult = DllCall("user32.dll", "lresult", "CallWindowProc", "ptr", $pprevwndfunc, "hwnd", $hwnd, "uint", $imsg, "wparam", $wparam, "lparam", $lparam)
  2081.     If @error Then Return SetError(@error, @extended, -1)
  2082.     Return $aresult[0]
  2083. EndFunc
  2084.  
  2085. Func _winapi_clienttoscreen($hwnd, ByRef $tpoint)
  2086.     Local $aret = DllCall("user32.dll", "bool", "ClientToScreen", "hwnd", $hwnd, "struct*", $tpoint)
  2087.     If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
  2088.     Return $tpoint
  2089. EndFunc
  2090.  
  2091. Func _winapi_closehandle($hobject)
  2092.     Local $aresult = DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hobject)
  2093.     If @error Then Return SetError(@error, @extended, False)
  2094.     Return $aresult[0]
  2095. EndFunc
  2096.  
  2097. Func _winapi_combinergn($hrgndest, $hrgnsrc1, $hrgnsrc2, $icombinemode)
  2098.     Local $aresult = DllCall("gdi32.dll", "int", "CombineRgn", "handle", $hrgndest, "handle", $hrgnsrc1, "handle", $hrgnsrc2, "int", $icombinemode)
  2099.     If @error Then Return SetError(@error, @extended, 0)
  2100.     Return $aresult[0]
  2101. EndFunc
  2102.  
  2103. Func _winapi_commdlgextendederror()
  2104.     Local Const $cderr_dialogfailure = 65535
  2105.     Local Const $cderr_findresfailure = 6
  2106.     Local Const $cderr_initialization = 2
  2107.     Local Const $cderr_loadresfailure = 7
  2108.     Local Const $cderr_loadstrfailure = 5
  2109.     Local Const $cderr_lockresfailure = 8
  2110.     Local Const $cderr_memallocfailure = 9
  2111.     Local Const $cderr_memlockfailure = 10
  2112.     Local Const $cderr_nohinstance = 4
  2113.     Local Const $cderr_nohook = 11
  2114.     Local Const $cderr_notemplate = 3
  2115.     Local Const $cderr_registermsgfail = 12
  2116.     Local Const $cderr_structsize = 1
  2117.     Local Const $fnerr_buffertoosmall = 12291
  2118.     Local Const $fnerr_invalidfilename = 12290
  2119.     Local Const $fnerr_subclassfailure = 12289
  2120.     Local $aresult = DllCall("comdlg32.dll", "dword", "CommDlgExtendedError")
  2121.     If NOT @error Then
  2122.         Switch $aresult[0]
  2123.             Case $cderr_dialogfailure
  2124.                 Return SetError($aresult[0], 0, "The dialog box could not be created." & @LF & "The common dialog box function's call to the DialogBox function failed." & @LF & "For example, this error occurs if the common dialog box call specifies an invalid window handle.")
  2125.             Case $cderr_findresfailure
  2126.                 Return SetError($aresult[0], 0, "The common dialog box function failed to find a specified resource.")
  2127.             Case $cderr_initialization
  2128.                 Return SetError($aresult[0], 0, "The common dialog box function failed during initialization." & @LF & "This error often occurs when sufficient memory is not available.")
  2129.             Case $cderr_loadresfailure
  2130.                 Return SetError($aresult[0], 0, "The common dialog box function failed to load a specified resource.")
  2131.             Case $cderr_loadstrfailure
  2132.                 Return SetError($aresult[0], 0, "The common dialog box function failed to load a specified string.")
  2133.             Case $cderr_lockresfailure
  2134.                 Return SetError($aresult[0], 0, "The common dialog box function failed to lock a specified resource.")
  2135.             Case $cderr_memallocfailure
  2136.                 Return SetError($aresult[0], 0, "The common dialog box function was unable to allocate memory for internal structures.")
  2137.             Case $cderr_memlockfailure
  2138.                 Return SetError($aresult[0], 0, "The common dialog box function was unable to lock the memory associated with a handle.")
  2139.             Case $cderr_nohinstance
  2140.                 Return SetError($aresult[0], 0, "The ENABLETEMPLATE flag was set in the Flags member of the initialization structure for the corresponding common dialog box," & @LF & "but you failed to provide a corresponding instance handle.")
  2141.             Case $cderr_nohook
  2142.                 Return SetError($aresult[0], 0, "The ENABLEHOOK flag was set in the Flags member of the initialization structure for the corresponding common dialog box," & @LF & "but you failed to provide a pointer to a corresponding hook procedure.")
  2143.             Case $cderr_notemplate
  2144.                 Return SetError($aresult[0], 0, "The ENABLETEMPLATE flag was set in the Flags member of the initialization structure for the corresponding common dialog box," & @LF & "but you failed to provide a corresponding template.")
  2145.             Case $cderr_registermsgfail
  2146.                 Return SetError($aresult[0], 0, "The RegisterWindowMessage function returned an error code when it was called by the common dialog box function.")
  2147.             Case $cderr_structsize
  2148.                 Return SetError($aresult[0], 0, "The lStructSize member of the initialization structure for the corresponding common dialog box is invalid")
  2149.             Case $fnerr_buffertoosmall
  2150.                 Return SetError($aresult[0], 0, "The buffer pointed to by the lpstrFile member of the OPENFILENAME structure is too small for the file name specified by the user." & @LF & "The first two bytes of the lpstrFile buffer contain an integer value specifying the size, in TCHARs, required to receive the full name.")
  2151.             Case $fnerr_invalidfilename
  2152.                 Return SetError($aresult[0], 0, "A file name is invalid.")
  2153.             Case $fnerr_subclassfailure
  2154.                 Return SetError($aresult[0], 0, "An attempt to subclass a list box failed because sufficient memory was not available.")
  2155.         EndSwitch
  2156.     EndIf
  2157.     Return SetError(@error, @extended, "0x" & Hex($aresult[0]))
  2158. EndFunc
  2159.  
  2160. Func _winapi_copyicon($hicon)
  2161.     Local $aresult = DllCall("user32.dll", "handle", "CopyIcon", "handle", $hicon)
  2162.     If @error Then Return SetError(@error, @extended, 0)
  2163.     Return $aresult[0]
  2164. EndFunc
  2165.  
  2166. Func _winapi_createbitmap($iwidth, $iheight, $iplanes = 1, $ibitsperpel = 1, $pbits = 0)
  2167.     Local $aresult = DllCall("gdi32.dll", "handle", "CreateBitmap", "int", $iwidth, "int", $iheight, "uint", $iplanes, "uint", $ibitsperpel, "struct*", $pbits)
  2168.     If @error Then Return SetError(@error, @extended, 0)
  2169.     Return $aresult[0]
  2170. EndFunc
  2171.  
  2172. Func _winapi_createcompatiblebitmap($hdc, $iwidth, $iheight)
  2173.     Local $aresult = DllCall("gdi32.dll", "handle", "CreateCompatibleBitmap", "handle", $hdc, "int", $iwidth, "int", $iheight)
  2174.     If @error Then Return SetError(@error, @extended, 0)
  2175.     Return $aresult[0]
  2176. EndFunc
  2177.  
  2178. Func _winapi_createcompatibledc($hdc)
  2179.     Local $aresult = DllCall("gdi32.dll", "handle", "CreateCompatibleDC", "handle", $hdc)
  2180.     If @error Then Return SetError(@error, @extended, 0)
  2181.     Return $aresult[0]
  2182. EndFunc
  2183.  
  2184. Func _winapi_createevent($tattributes = 0, $bmanualreset = True, $binitialstate = True, $sname = "")
  2185.     Local $snametype = "wstr"
  2186.     If $sname = "" Then
  2187.         $sname = 0
  2188.         $snametype = "ptr"
  2189.     EndIf
  2190.     Local $aresult = DllCall("kernel32.dll", "handle", "CreateEventW", "struct*", $tattributes, "bool", $bmanualreset, "bool", $binitialstate, $snametype, $sname)
  2191.     If @error Then Return SetError(@error, @extended, 0)
  2192.     Return $aresult[0]
  2193. EndFunc
  2194.  
  2195. Func _winapi_createfile($sfilename, $icreation, $iaccess = 4, $ishare = 0, $iattributes = 0, $tsecurity = 0)
  2196.     Local $ida = 0, $ism = 0, $icd = 0, $ifa = 0
  2197.     If BitAND($iaccess, 1) <> 0 Then $ida = BitOR($ida, $generic_execute)
  2198.     If BitAND($iaccess, 2) <> 0 Then $ida = BitOR($ida, $generic_read)
  2199.     If BitAND($iaccess, 4) <> 0 Then $ida = BitOR($ida, $generic_write)
  2200.     If BitAND($ishare, 1) <> 0 Then $ism = BitOR($ism, $file_share_delete)
  2201.     If BitAND($ishare, 2) <> 0 Then $ism = BitOR($ism, $file_share_read)
  2202.     If BitAND($ishare, 4) <> 0 Then $ism = BitOR($ism, $file_share_write)
  2203.     Switch $icreation
  2204.         Case 0
  2205.             $icd = $create_new
  2206.         Case 1
  2207.             $icd = $create_always
  2208.         Case 2
  2209.             $icd = $open_existing
  2210.         Case 3
  2211.             $icd = $open_always
  2212.         Case 4
  2213.             $icd = $truncate_existing
  2214.     EndSwitch
  2215.     If BitAND($iattributes, 1) <> 0 Then $ifa = BitOR($ifa, $file_attribute_archive)
  2216.     If BitAND($iattributes, 2) <> 0 Then $ifa = BitOR($ifa, $file_attribute_hidden)
  2217.     If BitAND($iattributes, 4) <> 0 Then $ifa = BitOR($ifa, $file_attribute_readonly)
  2218.     If BitAND($iattributes, 8) <> 0 Then $ifa = BitOR($ifa, $file_attribute_system)
  2219.     Local $aresult = DllCall("kernel32.dll", "handle", "CreateFileW", "wstr", $sfilename, "dword", $ida, "dword", $ism, "struct*", $tsecurity, "dword", $icd, "dword", $ifa, "ptr", 0)
  2220.     If @error OR ($aresult[0] = $invalid_handle_value) Then Return SetError(@error, @extended, 0)
  2221.     Return $aresult[0]
  2222. EndFunc
  2223.  
  2224. Func _winapi_createfont($iheight, $iwidth, $iescape = 0, $iorientn = 0, $iweight = $__winapiconstant_fw_normal, $bitalic = False, $bunderline = False, $bstrikeout = False, $icharset = $__winapiconstant_default_charset, $ioutputprec = $__winapiconstant_out_default_precis, $iclipprec = $__winapiconstant_clip_default_precis, $iquality = $__winapiconstant_default_quality, $ipitch = 0, $sface = "Arial")
  2225.     Local $aresult = DllCall("gdi32.dll", "handle", "CreateFontW", "int", $iheight, "int", $iwidth, "int", $iescape, "int", $iorientn, "int", $iweight, "dword", $bitalic, "dword", $bunderline, "dword", $bstrikeout, "dword", $icharset, "dword", $ioutputprec, "dword", $iclipprec, "dword", $iquality, "dword", $ipitch, "wstr", $sface)
  2226.     If @error Then Return SetError(@error, @extended, 0)
  2227.     Return $aresult[0]
  2228. EndFunc
  2229.  
  2230. Func _winapi_createfontindirect($tlogfont)
  2231.     Local $aresult = DllCall("gdi32.dll", "handle", "CreateFontIndirectW", "struct*", $tlogfont)
  2232.     If @error Then Return SetError(@error, @extended, 0)
  2233.     Return $aresult[0]
  2234. EndFunc
  2235.  
  2236. Func _winapi_createpen($ipenstyle, $iwidth, $icolor)
  2237.     Local $aresult = DllCall("gdi32.dll", "handle", "CreatePen", "int", $ipenstyle, "int", $iwidth, "INT", $icolor)
  2238.     If @error Then Return SetError(@error, @extended, 0)
  2239.     Return $aresult[0]
  2240. EndFunc
  2241.  
  2242. Func _winapi_createprocess($sappname, $scommand, $tsecurity, $tthread, $binherit, $iflags, $penviron, $sdir, $tstartupinfo, $tprocess)
  2243.     Local $tcommand = 0
  2244.     Local $sappnametype = "wstr", $sdirtype = "wstr"
  2245.     If $sappname = "" Then
  2246.         $sappnametype = "ptr"
  2247.         $sappname = 0
  2248.     EndIf
  2249.     If $scommand <> "" Then
  2250.         $tcommand = DllStructCreate("wchar Text[" & 260 + 1 & "]")
  2251.         DllStructSetData($tcommand, "Text", $scommand)
  2252.     EndIf
  2253.     If $sdir = "" Then
  2254.         $sdirtype = "ptr"
  2255.         $sdir = 0
  2256.     EndIf
  2257.     Local $aresult = DllCall("kernel32.dll", "bool", "CreateProcessW", $sappnametype, $sappname, "struct*", $tcommand, "struct*", $tsecurity, "struct*", $tthread, "bool", $binherit, "dword", $iflags, "struct*", $penviron, $sdirtype, $sdir, "struct*", $tstartupinfo, "struct*", $tprocess)
  2258.     If @error Then Return SetError(@error, @extended, False)
  2259.     Return $aresult[0]
  2260. EndFunc
  2261.  
  2262. Func _winapi_createrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect)
  2263.     Local $aresult = DllCall("gdi32.dll", "handle", "CreateRectRgn", "int", $ileftrect, "int", $itoprect, "int", $irightrect, "int", $ibottomrect)
  2264.     If @error Then Return SetError(@error, @extended, 0)
  2265.     Return $aresult[0]
  2266. EndFunc
  2267.  
  2268. Func _winapi_createroundrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect, $iwidthellipse, $iheightellipse)
  2269.     Local $aresult = DllCall("gdi32.dll", "handle", "CreateRoundRectRgn", "int", $ileftrect, "int", $itoprect, "int", $irightrect, "int", $ibottomrect, "int", $iwidthellipse, "int", $iheightellipse)
  2270.     If @error Then Return SetError(@error, @extended, 0)
  2271.     Return $aresult[0]
  2272. EndFunc
  2273.  
  2274. Func _winapi_createsolidbitmap($hwnd, $icolor, $iwidth, $iheight, $brgb = 1)
  2275.     Local $hdc = _winapi_getdc($hwnd)
  2276.     Local $hdestdc = _winapi_createcompatibledc($hdc)
  2277.     Local $hbitmap = _winapi_createcompatiblebitmap($hdc, $iwidth, $iheight)
  2278.     Local $hold = _winapi_selectobject($hdestdc, $hbitmap)
  2279.     Local $trect = DllStructCreate($tagrect)
  2280.     DllStructSetData($trect, 1, 0)
  2281.     DllStructSetData($trect, 2, 0)
  2282.     DllStructSetData($trect, 3, $iwidth)
  2283.     DllStructSetData($trect, 4, $iheight)
  2284.     If $brgb Then
  2285.         $icolor = BitOR(BitAND($icolor, 65280), BitShift(BitAND($icolor, 255), -16), BitShift(BitAND($icolor, 16711680), 16))
  2286.     EndIf
  2287.     Local $hbrush = _winapi_createsolidbrush($icolor)
  2288.     If NOT _winapi_fillrect($hdestdc, $trect, $hbrush) Then
  2289.         _winapi_deleteobject($hbitmap)
  2290.         $hbitmap = 0
  2291.     EndIf
  2292.     _winapi_deleteobject($hbrush)
  2293.     _winapi_releasedc($hwnd, $hdc)
  2294.     _winapi_selectobject($hdestdc, $hold)
  2295.     _winapi_deletedc($hdestdc)
  2296.     If NOT $hbitmap Then Return SetError(1, 0, 0)
  2297.     Return $hbitmap
  2298. EndFunc
  2299.  
  2300. Func _winapi_createsolidbrush($icolor)
  2301.     Local $aresult = DllCall("gdi32.dll", "handle", "CreateSolidBrush", "INT", $icolor)
  2302.     If @error Then Return SetError(@error, @extended, 0)
  2303.     Return $aresult[0]
  2304. EndFunc
  2305.  
  2306. Func _winapi_createwindowex($iexstyle, $sclass, $sname, $istyle, $ix, $iy, $iwidth, $iheight, $hparent, $hmenu = 0, $hinstance = 0, $pparam = 0)
  2307.     If $hinstance = 0 Then $hinstance = _winapi_getmodulehandle("")
  2308.     Local $aresult = DllCall("user32.dll", "hwnd", "CreateWindowExW", "dword", $iexstyle, "wstr", $sclass, "wstr", $sname, "dword", $istyle, "int", $ix, "int", $iy, "int", $iwidth, "int", $iheight, "hwnd", $hparent, "handle", $hmenu, "handle", $hinstance, "struct*", $pparam)
  2309.     If @error Then Return SetError(@error, @extended, 0)
  2310.     Return $aresult[0]
  2311. EndFunc
  2312.  
  2313. Func _winapi_defwindowproc($hwnd, $imsg, $wparam, $lparam)
  2314.     Local $aresult = DllCall("user32.dll", "lresult", "DefWindowProc", "hwnd", $hwnd, "uint", $imsg, "wparam", $wparam, "lparam", $lparam)
  2315.     If @error Then Return SetError(@error, @extended, 0)
  2316.     Return $aresult[0]
  2317. EndFunc
  2318.  
  2319. Func _winapi_deletedc($hdc)
  2320.     Local $aresult = DllCall("gdi32.dll", "bool", "DeleteDC", "handle", $hdc)
  2321.     If @error Then Return SetError(@error, @extended, False)
  2322.     Return $aresult[0]
  2323. EndFunc
  2324.  
  2325. Func _winapi_deleteobject($hobject)
  2326.     Local $aresult = DllCall("gdi32.dll", "bool", "DeleteObject", "handle", $hobject)
  2327.     If @error Then Return SetError(@error, @extended, False)
  2328.     Return $aresult[0]
  2329. EndFunc
  2330.  
  2331. Func _winapi_destroyicon($hicon)
  2332.     Local $aresult = DllCall("user32.dll", "bool", "DestroyIcon", "handle", $hicon)
  2333.     If @error Then Return SetError(@error, @extended, False)
  2334.     Return $aresult[0]
  2335. EndFunc
  2336.  
  2337. Func _winapi_destroywindow($hwnd)
  2338.     Local $aresult = DllCall("user32.dll", "bool", "DestroyWindow", "hwnd", $hwnd)
  2339.     If @error Then Return SetError(@error, @extended, False)
  2340.     Return $aresult[0]
  2341. EndFunc
  2342.  
  2343. Func _winapi_drawedge($hdc, $trect, $iedgetype, $iflags)
  2344.     Local $aresult = DllCall("user32.dll", "bool", "DrawEdge", "handle", $hdc, "struct*", $trect, "uint", $iedgetype, "uint", $iflags)
  2345.     If @error Then Return SetError(@error, @extended, False)
  2346.     Return $aresult[0]
  2347. EndFunc
  2348.  
  2349. Func _winapi_drawframecontrol($hdc, $trect, $itype, $istate)
  2350.     Local $aresult = DllCall("user32.dll", "bool", "DrawFrameControl", "handle", $hdc, "struct*", $trect, "uint", $itype, "uint", $istate)
  2351.     If @error Then Return SetError(@error, @extended, False)
  2352.     Return $aresult[0]
  2353. EndFunc
  2354.  
  2355. Func _winapi_drawicon($hdc, $ix, $iy, $hicon)
  2356.     Local $aresult = DllCall("user32.dll", "bool", "DrawIcon", "handle", $hdc, "int", $ix, "int", $iy, "handle", $hicon)
  2357.     If @error Then Return SetError(@error, @extended, False)
  2358.     Return $aresult[0]
  2359. EndFunc
  2360.  
  2361. Func _winapi_drawiconex($hdc, $ix, $iy, $hicon, $iwidth = 0, $iheight = 0, $istep = 0, $hbrush = 0, $iflags = 3)
  2362.     Local $ioptions
  2363.     Switch $iflags
  2364.         Case 1
  2365.             $ioptions = $di_mask
  2366.         Case 2
  2367.             $ioptions = $di_image
  2368.         Case 3
  2369.             $ioptions = $di_normal
  2370.         Case 4
  2371.             $ioptions = $di_compat
  2372.         Case 5
  2373.             $ioptions = $di_defaultsize
  2374.         Case Else
  2375.             $ioptions = $di_nomirror
  2376.     EndSwitch
  2377.     Local $aresult = DllCall("user32.dll", "bool", "DrawIconEx", "handle", $hdc, "int", $ix, "int", $iy, "handle", $hicon, "int", $iwidth, "int", $iheight, "uint", $istep, "handle", $hbrush, "uint", $ioptions)
  2378.     If @error Then Return SetError(@error, @extended, False)
  2379.     Return $aresult[0]
  2380. EndFunc
  2381.  
  2382. Func _winapi_drawline($hdc, $ix1, $iy1, $ix2, $iy2)
  2383.     _winapi_moveto($hdc, $ix1, $iy1)
  2384.     If @error Then Return SetError(@error, @extended, False)
  2385.     _winapi_lineto($hdc, $ix2, $iy2)
  2386.     If @error Then Return SetError(@error + 10, @extended, False)
  2387.     Return True
  2388. EndFunc
  2389.  
  2390. Func _winapi_drawtext($hdc, $stext, ByRef $trect, $iflags)
  2391.     Local $aresult = DllCall("user32.dll", "int", "DrawTextW", "handle", $hdc, "wstr", $stext, "int", -1, "struct*", $trect, "uint", $iflags)
  2392.     If @error Then Return SetError(@error, @extended, 0)
  2393.     Return $aresult[0]
  2394. EndFunc
  2395.  
  2396. Func _winapi_duplicatehandle($hsourceprocesshandle, $hsourcehandle, $htargetprocesshandle, $idesiredaccess, $iinherithandle, $ioptions)
  2397.     Local $aresult = DllCall("kernel32.dll", "bool", "DuplicateHandle", "handle", $hsourceprocesshandle, "handle", $hsourcehandle, "handle", $htargetprocesshandle, "handle*", 0, "dword", $idesiredaccess, "bool", $iinherithandle, "dword", $ioptions)
  2398.     If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, 0)
  2399.     Return $aresult[4]
  2400. EndFunc
  2401.  
  2402. Func _winapi_enablewindow($hwnd, $benable = True)
  2403.     Local $aresult = DllCall("user32.dll", "bool", "EnableWindow", "hwnd", $hwnd, "bool", $benable)
  2404.     If @error Then Return SetError(@error, @extended, False)
  2405.     Return $aresult[0]
  2406. EndFunc
  2407.  
  2408. Func _winapi_enumdisplaydevices($sdevice, $idevnum)
  2409.     Local $tname = 0, $iflags = 0, $adevice[5]
  2410.     If $sdevice <> "" Then
  2411.         $tname = DllStructCreate("wchar Text[" & StringLen($sdevice) + 1 & "]")
  2412.         DllStructSetData($tname, "Text", $sdevice)
  2413.     EndIf
  2414.     Local $tdevice = DllStructCreate($tagdisplay_device)
  2415.     Local $idevice = DllStructGetSize($tdevice)
  2416.     DllStructSetData($tdevice, "Size", $idevice)
  2417.     Local $aret = DllCall("user32.dll", "bool", "EnumDisplayDevicesW", "struct*", $tname, "dword", $idevnum, "struct*", $tdevice, "dword", 1)
  2418.     If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
  2419.     Local $in = DllStructGetData($tdevice, "Flags")
  2420.     If BitAND($in, $display_device_attached_to_desktop) <> 0 Then $iflags = BitOR($iflags, 1)
  2421.     If BitAND($in, $display_device_primary_device) <> 0 Then $iflags = BitOR($iflags, 2)
  2422.     If BitAND($in, $display_device_mirroring_driver) <> 0 Then $iflags = BitOR($iflags, 4)
  2423.     If BitAND($in, $display_device_vga_compatible) <> 0 Then $iflags = BitOR($iflags, 8)
  2424.     If BitAND($in, $display_device_removable) <> 0 Then $iflags = BitOR($iflags, 16)
  2425.     If BitAND($in, $display_device_modespruned) <> 0 Then $iflags = BitOR($iflags, 32)
  2426.     $adevice[0] = True
  2427.     $adevice[1] = DllStructGetData($tdevice, "Name")
  2428.     $adevice[2] = DllStructGetData($tdevice, "String")
  2429.     $adevice[3] = $iflags
  2430.     $adevice[4] = DllStructGetData($tdevice, "ID")
  2431.     Return $adevice
  2432. EndFunc
  2433.  
  2434. Func _winapi_enumwindows($bvisible = True, $hwnd = Default)
  2435.     __winapi_enumwindowsinit()
  2436.     If $hwnd = Default Then $hwnd = _winapi_getdesktopwindow()
  2437.     __winapi_enumwindowschild($hwnd, $bvisible)
  2438.     Return $__g_awinlist_winapi
  2439. EndFunc
  2440.  
  2441. Func __winapi_enumwindowsadd($hwnd, $sclass = "")
  2442.     If $sclass = "" Then $sclass = _winapi_getclassname($hwnd)
  2443.     $__g_awinlist_winapi[0][0] += 1
  2444.     Local $icount = $__g_awinlist_winapi[0][0]
  2445.     If $icount >= $__g_awinlist_winapi[0][1] Then
  2446.         ReDim $__g_awinlist_winapi[$icount + 64][2]
  2447.         $__g_awinlist_winapi[0][1] += 64
  2448.     EndIf
  2449.     $__g_awinlist_winapi[$icount][0] = $hwnd
  2450.     $__g_awinlist_winapi[$icount][1] = $sclass
  2451. EndFunc
  2452.  
  2453. Func __winapi_enumwindowschild($hwnd, $bvisible = True)
  2454.     $hwnd = _winapi_getwindow($hwnd, $gw_child)
  2455.     While $hwnd <> 0
  2456.         If (NOT $bvisible) OR _winapi_iswindowvisible($hwnd) Then
  2457.             __winapi_enumwindowsadd($hwnd)
  2458.             __winapi_enumwindowschild($hwnd, $bvisible)
  2459.         EndIf
  2460.         $hwnd = _winapi_getwindow($hwnd, $gw_hwndnext)
  2461.     WEnd
  2462. EndFunc
  2463.  
  2464. Func __winapi_enumwindowsinit()
  2465.     ReDim $__g_awinlist_winapi[64][2]
  2466.     $__g_awinlist_winapi[0][0] = 0
  2467.     $__g_awinlist_winapi[0][1] = 64
  2468. EndFunc
  2469.  
  2470. Func _winapi_enumwindowspopup()
  2471.     __winapi_enumwindowsinit()
  2472.     Local $hwnd = _winapi_getwindow(_winapi_getdesktopwindow(), $gw_child)
  2473.     Local $sclass
  2474.     While $hwnd <> 0
  2475.         If _winapi_iswindowvisible($hwnd) Then
  2476.             $sclass = _winapi_getclassname($hwnd)
  2477.             If $sclass = "#32768" Then
  2478.                 __winapi_enumwindowsadd($hwnd)
  2479.             ElseIf $sclass = "ToolbarWindow32" Then
  2480.                 __winapi_enumwindowsadd($hwnd)
  2481.             ElseIf $sclass = "ToolTips_Class32" Then
  2482.                 __winapi_enumwindowsadd($hwnd)
  2483.             ElseIf $sclass = "BaseBar" Then
  2484.                 __winapi_enumwindowschild($hwnd)
  2485.             EndIf
  2486.         EndIf
  2487.         $hwnd = _winapi_getwindow($hwnd, $gw_hwndnext)
  2488.     WEnd
  2489.     Return $__g_awinlist_winapi
  2490. EndFunc
  2491.  
  2492. Func _winapi_enumwindowstop()
  2493.     __winapi_enumwindowsinit()
  2494.     Local $hwnd = _winapi_getwindow(_winapi_getdesktopwindow(), $gw_child)
  2495.     While $hwnd <> 0
  2496.         If _winapi_iswindowvisible($hwnd) Then __winapi_enumwindowsadd($hwnd)
  2497.         $hwnd = _winapi_getwindow($hwnd, $gw_hwndnext)
  2498.     WEnd
  2499.     Return $__g_awinlist_winapi
  2500. EndFunc
  2501.  
  2502. Func _winapi_expandenvironmentstrings($sstring)
  2503.     Local $aresult = DllCall("kernel32.dll", "dword", "ExpandEnvironmentStringsW", "wstr", $sstring, "wstr", "", "dword", 4096)
  2504.     If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, "")
  2505.     Return $aresult[2]
  2506. EndFunc
  2507.  
  2508. Func _winapi_extracticonex($sfilepath, $iindex, $palarge, $pasmall, $iicons)
  2509.     Local $aresult = DllCall("shell32.dll", "uint", "ExtractIconExW", "wstr", $sfilepath, "int", $iindex, "struct*", $palarge, "struct*", $pasmall, "uint", $iicons)
  2510.     If @error Then Return SetError(@error, @extended, 0)
  2511.     Return $aresult[0]
  2512. EndFunc
  2513.  
  2514. Func _winapi_fatalappexit($smessage)
  2515.     DllCall("kernel32.dll", "none", "FatalAppExitW", "uint", 0, "wstr", $smessage)
  2516.     If @error Then Return SetError(@error, @extended)
  2517. EndFunc
  2518.  
  2519. Func _winapi_fillrect($hdc, $trect, $hbrush)
  2520.     Local $aresult
  2521.     If IsPtr($hbrush) Then
  2522.         $aresult = DllCall("user32.dll", "int", "FillRect", "handle", $hdc, "struct*", $trect, "handle", $hbrush)
  2523.     Else
  2524.         $aresult = DllCall("user32.dll", "int", "FillRect", "handle", $hdc, "struct*", $trect, "dword_ptr", $hbrush)
  2525.     EndIf
  2526.     If @error Then Return SetError(@error, @extended, False)
  2527.     Return $aresult[0]
  2528. EndFunc
  2529.  
  2530. Func _winapi_findexecutable($sfilename, $sdirectory = "")
  2531.     Local $aresult = DllCall("shell32.dll", "INT", "FindExecutableW", "wstr", $sfilename, "wstr", $sdirectory, "wstr", "")
  2532.     If @error Then Return SetError(@error, @extended, "")
  2533.     If $aresult[0] <= 32 Then Return SetError(10, $aresult[0], "")
  2534.     Return SetExtended($aresult[0], $aresult[3])
  2535. EndFunc
  2536.  
  2537. Func _winapi_findwindow($sclassname, $swindowname)
  2538.     Local $aresult = DllCall("user32.dll", "hwnd", "FindWindowW", "wstr", $sclassname, "wstr", $swindowname)
  2539.     If @error Then Return SetError(@error, @extended, 0)
  2540.     Return $aresult[0]
  2541. EndFunc
  2542.  
  2543. Func _winapi_flashwindow($hwnd, $binvert = True)
  2544.     Local $aresult = DllCall("user32.dll", "bool", "FlashWindow", "hwnd", $hwnd, "bool", $binvert)
  2545.     If @error Then Return SetError(@error, @extended, False)
  2546.     Return $aresult[0]
  2547. EndFunc
  2548.  
  2549. Func _winapi_flashwindowex($hwnd, $iflags = 3, $icount = 3, $itimeout = 0)
  2550.     Local $tflash = DllStructCreate($tagflashwinfo)
  2551.     Local $iflash = DllStructGetSize($tflash)
  2552.     Local $imode = 0
  2553.     If BitAND($iflags, 1) <> 0 Then $imode = BitOR($imode, $flashw_caption)
  2554.     If BitAND($iflags, 2) <> 0 Then $imode = BitOR($imode, $flashw_tray)
  2555.     If BitAND($iflags, 4) <> 0 Then $imode = BitOR($imode, $flashw_timer)
  2556.     If BitAND($iflags, 8) <> 0 Then $imode = BitOR($imode, $flashw_timernofg)
  2557.     DllStructSetData($tflash, "Size", $iflash)
  2558.     DllStructSetData($tflash, "hWnd", $hwnd)
  2559.     DllStructSetData($tflash, "Flags", $imode)
  2560.     DllStructSetData($tflash, "Count", $icount)
  2561.     DllStructSetData($tflash, "Timeout", $itimeout)
  2562.     Local $aresult = DllCall("user32.dll", "bool", "FlashWindowEx", "struct*", $tflash)
  2563.     If @error Then Return SetError(@error, @extended, False)
  2564.     Return $aresult[0]
  2565. EndFunc
  2566.  
  2567. Func _winapi_floattoint($nfloat)
  2568.     Local $tfloat = DllStructCreate("float")
  2569.     Local $tint = DllStructCreate("int", DllStructGetPtr($tfloat))
  2570.     DllStructSetData($tfloat, 1, $nfloat)
  2571.     Return DllStructGetData($tint, 1)
  2572. EndFunc
  2573.  
  2574. Func _winapi_flushfilebuffers($hfile)
  2575.     Local $aresult = DllCall("kernel32.dll", "bool", "FlushFileBuffers", "handle", $hfile)
  2576.     If @error Then Return SetError(@error, @extended, False)
  2577.     Return $aresult[0]
  2578. EndFunc
  2579.  
  2580. Func _winapi_formatmessage($iflags, $psource, $imessageid, $ilanguageid, ByRef $pbuffer, $isize, $varguments)
  2581.     Local $sbuffertype = "struct*"
  2582.     If IsString($pbuffer) Then $sbuffertype = "wstr"
  2583.     Local $aresult = DllCall("kernel32.dll", "dword", "FormatMessageW", "dword", $iflags, "struct*", $psource, "dword", $imessageid, "dword", $ilanguageid, $sbuffertype, $pbuffer, "dword", $isize, "ptr", $varguments)
  2584.     If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, 0)
  2585.     If $sbuffertype = "wstr" Then $pbuffer = $aresult[5]
  2586.     Return $aresult[0]
  2587. EndFunc
  2588.  
  2589. Func _winapi_framerect($hdc, $trect, $hbrush)
  2590.     Local $aresult = DllCall("user32.dll", "int", "FrameRect", "handle", $hdc, "struct*", $trect, "handle", $hbrush)
  2591.     If @error Then Return SetError(@error, @extended, False)
  2592.     Return $aresult[0]
  2593. EndFunc
  2594.  
  2595. Func _winapi_freelibrary($hmodule)
  2596.     Local $aresult = DllCall("kernel32.dll", "bool", "FreeLibrary", "handle", $hmodule)
  2597.     If @error Then Return SetError(@error, @extended, False)
  2598.     Return $aresult[0]
  2599. EndFunc
  2600.  
  2601. Func _winapi_getancestor($hwnd, $iflags = 1)
  2602.     Local $aresult = DllCall("user32.dll", "hwnd", "GetAncestor", "hwnd", $hwnd, "uint", $iflags)
  2603.     If @error Then Return SetError(@error, @extended, 0)
  2604.     Return $aresult[0]
  2605. EndFunc
  2606.  
  2607. Func _winapi_getasynckeystate($ikey)
  2608.     Local $aresult = DllCall("user32.dll", "short", "GetAsyncKeyState", "int", $ikey)
  2609.     If @error Then Return SetError(@error, @extended, 0)
  2610.     Return $aresult[0]
  2611. EndFunc
  2612.  
  2613. Func _winapi_getbkmode($hdc)
  2614.     Local $aresult = DllCall("gdi32.dll", "int", "GetBkMode", "handle", $hdc)
  2615.     If @error Then Return SetError(@error, @extended, 0)
  2616.     Return $aresult[0]
  2617. EndFunc
  2618.  
  2619. Func _winapi_getclassname($hwnd)
  2620.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  2621.     Local $aresult = DllCall("user32.dll", "int", "GetClassNameW", "hwnd", $hwnd, "wstr", "", "int", 4096)
  2622.     If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, "")
  2623.     Return SetExtended($aresult[0], $aresult[2])
  2624. EndFunc
  2625.  
  2626. Func _winapi_getclientheight($hwnd)
  2627.     Local $trect = _winapi_getclientrect($hwnd)
  2628.     If @error Then Return SetError(@error, @extended, 0)
  2629.     Return DllStructGetData($trect, "Bottom") - DllStructGetData($trect, "Top")
  2630. EndFunc
  2631.  
  2632. Func _winapi_getclientwidth($hwnd)
  2633.     Local $trect = _winapi_getclientrect($hwnd)
  2634.     If @error Then Return SetError(@error, @extended, 0)
  2635.     Return DllStructGetData($trect, "Right") - DllStructGetData($trect, "Left")
  2636. EndFunc
  2637.  
  2638. Func _winapi_getclientrect($hwnd)
  2639.     Local $trect = DllStructCreate($tagrect)
  2640.     Local $aret = DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $hwnd, "struct*", $trect)
  2641.     If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
  2642.     Return $trect
  2643. EndFunc
  2644.  
  2645. Func _winapi_getcurrentprocess()
  2646.     Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentProcess")
  2647.     If @error Then Return SetError(@error, @extended, 0)
  2648.     Return $aresult[0]
  2649. EndFunc
  2650.  
  2651. Func _winapi_getcurrentprocessid()
  2652.     Local $aresult = DllCall("kernel32.dll", "dword", "GetCurrentProcessId")
  2653.     If @error Then Return SetError(@error, @extended, 0)
  2654.     Return $aresult[0]
  2655. EndFunc
  2656.  
  2657. Func _winapi_getcurrentthread()
  2658.     Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentThread")
  2659.     If @error Then Return SetError(@error, @extended, 0)
  2660.     Return $aresult[0]
  2661. EndFunc
  2662.  
  2663. Func _winapi_getcurrentthreadid()
  2664.     Local $aresult = DllCall("kernel32.dll", "dword", "GetCurrentThreadId")
  2665.     If @error Then Return SetError(@error, @extended, 0)
  2666.     Return $aresult[0]
  2667. EndFunc
  2668.  
  2669. Func _winapi_getcursorinfo()
  2670.     Local $tcursor = DllStructCreate($tagcursorinfo)
  2671.     Local $icursor = DllStructGetSize($tcursor)
  2672.     DllStructSetData($tcursor, "Size", $icursor)
  2673.     Local $aret = DllCall("user32.dll", "bool", "GetCursorInfo", "struct*", $tcursor)
  2674.     If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
  2675.     Local $acursor[5]
  2676.     $acursor[0] = True
  2677.     $acursor[1] = DllStructGetData($tcursor, "Flags") <> 0
  2678.     $acursor[2] = DllStructGetData($tcursor, "hCursor")
  2679.     $acursor[3] = DllStructGetData($tcursor, "X")
  2680.     $acursor[4] = DllStructGetData($tcursor, "Y")
  2681.     Return $acursor
  2682. EndFunc
  2683.  
  2684. Func _winapi_getdc($hwnd)
  2685.     Local $aresult = DllCall("user32.dll", "handle", "GetDC", "hwnd", $hwnd)
  2686.     If @error Then Return SetError(@error, @extended, 0)
  2687.     Return $aresult[0]
  2688. EndFunc
  2689.  
  2690. Func _winapi_getdesktopwindow()
  2691.     Local $aresult = DllCall("user32.dll", "hwnd", "GetDesktopWindow")
  2692.     If @error Then Return SetError(@error, @extended, 0)
  2693.     Return $aresult[0]
  2694. EndFunc
  2695.  
  2696. Func _winapi_getdevicecaps($hdc, $iindex)
  2697.     Local $aresult = DllCall("gdi32.dll", "int", "GetDeviceCaps", "handle", $hdc, "int", $iindex)
  2698.     If @error Then Return SetError(@error, @extended, 0)
  2699.     Return $aresult[0]
  2700. EndFunc
  2701.  
  2702. Func _winapi_getdibits($hdc, $hbitmap, $istartscan, $iscanlines, $pbits, $tbi, $iusage)
  2703.     Local $aresult = DllCall("gdi32.dll", "int", "GetDIBits", "handle", $hdc, "handle", $hbitmap, "uint", $istartscan, "uint", $iscanlines, "struct*", $pbits, "struct*", $tbi, "uint", $iusage)
  2704.     If @error Then Return SetError(@error, @extended, False)
  2705.     Return $aresult[0]
  2706. EndFunc
  2707.  
  2708. Func _winapi_getdlgctrlid($hwnd)
  2709.     Local $aresult = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hwnd)
  2710.     If @error Then Return SetError(@error, @extended, 0)
  2711.     Return $aresult[0]
  2712. EndFunc
  2713.  
  2714. Func _winapi_getdlgitem($hwnd, $iitemid)
  2715.     Local $aresult = DllCall("user32.dll", "hwnd", "GetDlgItem", "hwnd", $hwnd, "int", $iitemid)
  2716.     If @error Then Return SetError(@error, @extended, 0)
  2717.     Return $aresult[0]
  2718. EndFunc
  2719.  
  2720. Func _winapi_getfilesizeex($hfile)
  2721.     Local $aresult = DllCall("kernel32.dll", "bool", "GetFileSizeEx", "handle", $hfile, "int64*", 0)
  2722.     If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, -1)
  2723.     Return $aresult[2]
  2724. EndFunc
  2725.  
  2726. Func _winapi_getfocus()
  2727.     Local $aresult = DllCall("user32.dll", "hwnd", "GetFocus")
  2728.     If @error Then Return SetError(@error, @extended, 0)
  2729.     Return $aresult[0]
  2730. EndFunc
  2731.  
  2732. Func _winapi_getforegroundwindow()
  2733.     Local $aresult = DllCall("user32.dll", "hwnd", "GetForegroundWindow")
  2734.     If @error Then Return SetError(@error, @extended, 0)
  2735.     Return $aresult[0]
  2736. EndFunc
  2737.  
  2738. Func _winapi_getguiresources($iflag = 0, $hprocess = -1)
  2739.     If $hprocess = -1 Then $hprocess = _winapi_getcurrentprocess()
  2740.     Local $aresult = DllCall("user32.dll", "dword", "GetGuiResources", "handle", $hprocess, "dword", $iflag)
  2741.     If @error Then Return SetError(@error, @extended, 0)
  2742.     Return $aresult[0]
  2743. EndFunc
  2744.  
  2745. Func _winapi_geticoninfo($hicon)
  2746.     Local $tinfo = DllStructCreate($tagiconinfo)
  2747.     Local $aret = DllCall("user32.dll", "bool", "GetIconInfo", "handle", $hicon, "struct*", $tinfo)
  2748.     If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
  2749.     Local $aicon[6]
  2750.     $aicon[0] = True
  2751.     $aicon[1] = DllStructGetData($tinfo, "Icon") <> 0
  2752.     $aicon[2] = DllStructGetData($tinfo, "XHotSpot")
  2753.     $aicon[3] = DllStructGetData($tinfo, "YHotSpot")
  2754.     $aicon[4] = DllStructGetData($tinfo, "hMask")
  2755.     $aicon[5] = DllStructGetData($tinfo, "hColor")
  2756.     Return $aicon
  2757. EndFunc
  2758.  
  2759. Func _winapi_getlasterrormessage()
  2760.     Local $ilasterror = _winapi_getlasterror()
  2761.     Local $tbufferptr = DllStructCreate("ptr")
  2762.     Local $ncount = _winapi_formatmessage(BitOR($format_message_allocate_buffer, $format_message_from_system), 0, $ilasterror, 0, $tbufferptr, 0, 0)
  2763.     If @error Then Return SetError(@error, 0, "")
  2764.     Local $stext = ""
  2765.     Local $pbuffer = DllStructGetData($tbufferptr, 1)
  2766.     If $pbuffer Then
  2767.         If $ncount > 0 Then
  2768.             Local $tbuffer = DllStructCreate("wchar[" & ($ncount + 1) & "]", $pbuffer)
  2769.             $stext = DllStructGetData($tbuffer, 1)
  2770.             If StringRight($stext, 2) = @CRLF Then $stext = StringTrimRight($stext, 2)
  2771.         EndIf
  2772.         _winapi_localfree($pbuffer)
  2773.     EndIf
  2774.     Return $stext
  2775. EndFunc
  2776.  
  2777. Func _winapi_getlayeredwindowattributes($hwnd, ByRef $itranscolor, ByRef $itransgui, $bcolorref = False)
  2778.     $itranscolor = -1
  2779.     $itransgui = -1
  2780.     Local $aresult = DllCall("user32.dll", "bool", "GetLayeredWindowAttributes", "hwnd", $hwnd, "INT*", $itranscolor, "byte*", $itransgui, "dword*", 0)
  2781.     If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, 0)
  2782.     If NOT $bcolorref Then
  2783.         $aresult[2] = Int(BinaryMid($aresult[2], 3, 1) & BinaryMid($aresult[2], 2, 1) & BinaryMid($aresult[2], 1, 1))
  2784.     EndIf
  2785.     $itranscolor = $aresult[2]
  2786.     $itransgui = $aresult[3]
  2787.     Return $aresult[4]
  2788. EndFunc
  2789.  
  2790. Func _winapi_getmodulehandle($smodulename)
  2791.     Local $smodulenametype = "wstr"
  2792.     If $smodulename = "" Then
  2793.         $smodulename = 0
  2794.         $smodulenametype = "ptr"
  2795.     EndIf
  2796.     Local $aresult = DllCall("kernel32.dll", "handle", "GetModuleHandleW", $smodulenametype, $smodulename)
  2797.     If @error Then Return SetError(@error, @extended, 0)
  2798.     Return $aresult[0]
  2799. EndFunc
  2800.  
  2801. Func _winapi_getmousepos($btoclient = False, $hwnd = 0)
  2802.     Local $imode = Opt("MouseCoordMode", 1)
  2803.     Local $apos = MouseGetPos()
  2804.     Opt("MouseCoordMode", $imode)
  2805.     Local $tpoint = DllStructCreate($tagpoint)
  2806.     DllStructSetData($tpoint, "X", $apos[0])
  2807.     DllStructSetData($tpoint, "Y", $apos[1])
  2808.     If $btoclient AND NOT _winapi_screentoclient($hwnd, $tpoint) Then Return SetError(@error + 20, @extended, 0)
  2809.     Return $tpoint
  2810. EndFunc
  2811.  
  2812. Func _winapi_getmouseposx($btoclient = False, $hwnd = 0)
  2813.     Local $tpoint = _winapi_getmousepos($btoclient, $hwnd)
  2814.     If @error Then Return SetError(@error, @extended, 0)
  2815.     Return DllStructGetData($tpoint, "X")
  2816. EndFunc
  2817.  
  2818. Func _winapi_getmouseposy($btoclient = False, $hwnd = 0)
  2819.     Local $tpoint = _winapi_getmousepos($btoclient, $hwnd)
  2820.     If @error Then Return SetError(@error, @extended, 0)
  2821.     Return DllStructGetData($tpoint, "Y")
  2822. EndFunc
  2823.  
  2824. Func _winapi_getobject($hobject, $isize, $pobject)
  2825.     Local $aresult = DllCall("gdi32.dll", "int", "GetObjectW", "handle", $hobject, "int", $isize, "struct*", $pobject)
  2826.     If @error Then Return SetError(@error, @extended, 0)
  2827.     Return $aresult[0]
  2828. EndFunc
  2829.  
  2830. Func _winapi_getopenfilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $hwndowner = 0)
  2831.     Local $ipathlen = 4096
  2832.     Local $inulls = 0
  2833.     Local $tofn = DllStructCreate($tagopenfilename)
  2834.     Local $afiles[1] = [0]
  2835.     Local $iflag = $iflags
  2836.     Local $asflines = StringSplit($sfilter, "|")
  2837.     Local $asfilter[$asflines[0] * 2 + 1]
  2838.     Local $istart, $ifinal, $tagfilter
  2839.     $asfilter[0] = $asflines[0] * 2
  2840.     For $i = 1 To $asflines[0]
  2841.         $istart = StringInStr($asflines[$i], "(", 0, 1)
  2842.         $ifinal = StringInStr($asflines[$i], ")", 0, -1)
  2843.         $asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $istart - 1), $str_stripleading + $str_striptrailing)
  2844.         $asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), $str_stripleading + $str_striptrailing)
  2845.         $tagfilter &= "wchar[" & StringLen($asfilter[$i * 2 - 1]) + 1 & "];wchar[" & StringLen($asfilter[$i * 2]) + 1 & "];"
  2846.     Next
  2847.     Local $ttitle = DllStructCreate("wchar Title[" & StringLen($stitle) + 1 & "]")
  2848.     Local $tinitialdir = DllStructCreate("wchar InitDir[" & StringLen($sinitaldir) + 1 & "]")
  2849.     Local $tfilter = DllStructCreate($tagfilter & "wchar")
  2850.     Local $tpath = DllStructCreate("wchar Path[" & $ipathlen & "]")
  2851.     Local $textn = DllStructCreate("wchar Extension[" & StringLen($sdefaultext) + 1 & "]")
  2852.     For $i = 1 To $asfilter[0]
  2853.         DllStructSetData($tfilter, $i, $asfilter[$i])
  2854.     Next
  2855.     DllStructSetData($ttitle, "Title", $stitle)
  2856.     DllStructSetData($tinitialdir, "InitDir", $sinitaldir)
  2857.     DllStructSetData($tpath, "Path", $sdefaultfile)
  2858.     DllStructSetData($textn, "Extension", $sdefaultext)
  2859.     DllStructSetData($tofn, "StructSize", DllStructGetSize($tofn))
  2860.     DllStructSetData($tofn, "hwndOwner", $hwndowner)
  2861.     DllStructSetData($tofn, "lpstrFilter", DllStructGetPtr($tfilter))
  2862.     DllStructSetData($tofn, "nFilterIndex", $ifilterindex)
  2863.     DllStructSetData($tofn, "lpstrFile", DllStructGetPtr($tpath))
  2864.     DllStructSetData($tofn, "nMaxFile", $ipathlen)
  2865.     DllStructSetData($tofn, "lpstrInitialDir", DllStructGetPtr($tinitialdir))
  2866.     DllStructSetData($tofn, "lpstrTitle", DllStructGetPtr($ttitle))
  2867.     DllStructSetData($tofn, "Flags", $iflag)
  2868.     DllStructSetData($tofn, "lpstrDefExt", DllStructGetPtr($textn))
  2869.     DllStructSetData($tofn, "FlagsEx", $iflagsex)
  2870.     Local $ares = DllCall("comdlg32.dll", "bool", "GetOpenFileNameW", "struct*", $tofn)
  2871.     If @error OR NOT $ares[0] Then Return SetError(@error + 10, @extended, $afiles)
  2872.     If BitAND($iflags, $ofn_allowmultiselect) = $ofn_allowmultiselect AND BitAND($iflags, $ofn_explorer) = $ofn_explorer Then
  2873.         For $x = 1 To $ipathlen
  2874.             If DllStructGetData($tpath, "Path", $x) = Chr(0) Then
  2875.                 DllStructSetData($tpath, "Path", "|", $x)
  2876.                 $inulls += 1
  2877.             Else
  2878.                 $inulls = 0
  2879.             EndIf
  2880.             If $inulls = 2 Then ExitLoop
  2881.         Next
  2882.         DllStructSetData($tpath, "Path", Chr(0), $x - 1)
  2883.         $afiles = StringSplit(DllStructGetData($tpath, "Path"), "|")
  2884.         If $afiles[0] = 1 Then Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
  2885.         Return StringSplit(DllStructGetData($tpath, "Path"), "|")
  2886.     ElseIf BitAND($iflags, $ofn_allowmultiselect) = $ofn_allowmultiselect Then
  2887.         $afiles = StringSplit(DllStructGetData($tpath, "Path"), " ")
  2888.         If $afiles[0] = 1 Then Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
  2889.         Return StringSplit(StringReplace(DllStructGetData($tpath, "Path"), " ", "|"), "|")
  2890.     Else
  2891.         Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
  2892.     EndIf
  2893. EndFunc
  2894.  
  2895. Func _winapi_getoverlappedresult($hfile, $toverlapped, ByRef $ibytes, $bwait = False)
  2896.     Local $aresult = DllCall("kernel32.dll", "bool", "GetOverlappedResult", "handle", $hfile, "struct*", $toverlapped, "dword*", 0, "bool", $bwait)
  2897.     If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, False)
  2898.     $ibytes = $aresult[3]
  2899.     Return $aresult[0]
  2900. EndFunc
  2901.  
  2902. Func _winapi_getparent($hwnd)
  2903.     Local $aresult = DllCall("user32.dll", "hwnd", "GetParent", "hwnd", $hwnd)
  2904.     If @error Then Return SetError(@error, @extended, 0)
  2905.     Return $aresult[0]
  2906. EndFunc
  2907.  
  2908. Func _winapi_getprocaddress($hmodule, $vname)
  2909.     Local $stype = "str"
  2910.     If IsNumber($vname) Then $stype = "word"
  2911.     Local $aresult = DllCall("kernel32.dll", "ptr", "GetProcAddress", "handle", $hmodule, $stype, $vname)
  2912.     If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, 0)
  2913.     Return $aresult[0]
  2914. EndFunc
  2915.  
  2916. Func _winapi_getprocessaffinitymask($hprocess)
  2917.     Local $aresult = DllCall("kernel32.dll", "bool", "GetProcessAffinityMask", "handle", $hprocess, "dword_ptr*", 0, "dword_ptr*", 0)
  2918.     If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, 0)
  2919.     Local $amask[3]
  2920.     $amask[0] = True
  2921.     $amask[1] = $aresult[2]
  2922.     $amask[2] = $aresult[3]
  2923.     Return $amask
  2924. EndFunc
  2925.  
  2926. Func _winapi_getsavefilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $hwndowner = 0)
  2927.     Local $ipathlen = 4096
  2928.     Local $tofn = DllStructCreate($tagopenfilename)
  2929.     Local $afiles[1] = [0]
  2930.     Local $iflag = $iflags
  2931.     Local $asflines = StringSplit($sfilter, "|")
  2932.     Local $asfilter[$asflines[0] * 2 + 1]
  2933.     Local $istart, $ifinal, $tagfilter
  2934.     $asfilter[0] = $asflines[0] * 2
  2935.     For $i = 1 To $asflines[0]
  2936.         $istart = StringInStr($asflines[$i], "(", 0, 1)
  2937.         $ifinal = StringInStr($asflines[$i], ")", 0, -1)
  2938.         $asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $istart - 1), $str_stripleading + $str_striptrailing)
  2939.         $asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), $str_stripleading + $str_striptrailing)
  2940.         $tagfilter &= "wchar[" & StringLen($asfilter[$i * 2 - 1]) + 1 & "];wchar[" & StringLen($asfilter[$i * 2]) + 1 & "];"
  2941.     Next
  2942.     Local $ttitle = DllStructCreate("wchar Title[" & StringLen($stitle) + 1 & "]")
  2943.     Local $tinitialdir = DllStructCreate("wchar InitDir[" & StringLen($sinitaldir) + 1 & "]")
  2944.     Local $tfilter = DllStructCreate($tagfilter & "wchar")
  2945.     Local $tpath = DllStructCreate("wchar Path[" & $ipathlen & "]")
  2946.     Local $textn = DllStructCreate("wchar Extension[" & StringLen($sdefaultext) + 1 & "]")
  2947.     For $i = 1 To $asfilter[0]
  2948.         DllStructSetData($tfilter, $i, $asfilter[$i])
  2949.     Next
  2950.     DllStructSetData($ttitle, "Title", $stitle)
  2951.     DllStructSetData($tinitialdir, "InitDir", $sinitaldir)
  2952.     DllStructSetData($tpath, "Path", $sdefaultfile)
  2953.     DllStructSetData($textn, "Extension", $sdefaultext)
  2954.     DllStructSetData($tofn, "StructSize", DllStructGetSize($tofn))
  2955.     DllStructSetData($tofn, "hwndOwner", $hwndowner)
  2956.     DllStructSetData($tofn, "lpstrFilter", DllStructGetPtr($tfilter))
  2957.     DllStructSetData($tofn, "nFilterIndex", $ifilterindex)
  2958.     DllStructSetData($tofn, "lpstrFile", DllStructGetPtr($tpath))
  2959.     DllStructSetData($tofn, "nMaxFile", $ipathlen)
  2960.     DllStructSetData($tofn, "lpstrInitialDir", DllStructGetPtr($tinitialdir))
  2961.     DllStructSetData($tofn, "lpstrTitle", DllStructGetPtr($ttitle))
  2962.     DllStructSetData($tofn, "Flags", $iflag)
  2963.     DllStructSetData($tofn, "lpstrDefExt", DllStructGetPtr($textn))
  2964.     DllStructSetData($tofn, "FlagsEx", $iflagsex)
  2965.     Local $ares = DllCall("comdlg32.dll", "bool", "GetSaveFileNameW", "struct*", $tofn)
  2966.     If @error OR NOT $ares[0] Then Return SetError(@error + 10, @extended, $afiles)
  2967.     Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
  2968. EndFunc
  2969.  
  2970. Func _winapi_getstockobject($iobject)
  2971.     Local $aresult = DllCall("gdi32.dll", "handle", "GetStockObject", "int", $iobject)
  2972.     If @error Then Return SetError(@error, @extended, 0)
  2973.     Return $aresult[0]
  2974. EndFunc
  2975.  
  2976. Func _winapi_getstdhandle($istdhandle)
  2977.     If $istdhandle < 0 OR $istdhandle > 2 Then Return SetError(2, 0, -1)
  2978.     Local Const $ahandle[3] = [-10, -11, -12]
  2979.     Local $aresult = DllCall("kernel32.dll", "handle", "GetStdHandle", "dword", $ahandle[$istdhandle])
  2980.     If @error Then Return SetError(@error, @extended, -1)
  2981.     Return $aresult[0]
  2982. EndFunc
  2983.  
  2984. Func _winapi_getsyscolor($iindex)
  2985.     Local $aresult = DllCall("user32.dll", "INT", "GetSysColor", "int", $iindex)
  2986.     If @error Then Return SetError(@error, @extended, 0)
  2987.     Return $aresult[0]
  2988. EndFunc
  2989.  
  2990. Func _winapi_getsyscolorbrush($iindex)
  2991.     Local $aresult = DllCall("user32.dll", "handle", "GetSysColorBrush", "int", $iindex)
  2992.     If @error Then Return SetError(@error, @extended, 0)
  2993.     Return $aresult[0]
  2994. EndFunc
  2995.  
  2996. Func _winapi_getsystemmetrics($iindex)
  2997.     Local $aresult = DllCall("user32.dll", "int", "GetSystemMetrics", "int", $iindex)
  2998.     If @error Then Return SetError(@error, @extended, 0)
  2999.     Return $aresult[0]
  3000. EndFunc
  3001.  
  3002. Func _winapi_gettextextentpoint32($hdc, $stext)
  3003.     Local $tsize = DllStructCreate($tagsize)
  3004.     Local $isize = StringLen($stext)
  3005.     Local $aret = DllCall("gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $hdc, "wstr", $stext, "int", $isize, "struct*", $tsize)
  3006.     If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
  3007.     Return $tsize
  3008. EndFunc
  3009.  
  3010. Func _winapi_gettextmetrics($hdc)
  3011.     Local $ttextmetric = DllStructCreate($tagtextmetric)
  3012.     Local $aret = DllCall("gdi32.dll", "bool", "GetTextMetricsW", "handle", $hdc, "struct*", $ttextmetric)
  3013.     If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
  3014.     Return $ttextmetric
  3015. EndFunc
  3016.  
  3017. Func _winapi_getwindow($hwnd, $icmd)
  3018.     Local $aresult = DllCall("user32.dll", "hwnd", "GetWindow", "hwnd", $hwnd, "uint", $icmd)
  3019.     If @error Then Return SetError(@error, @extended, 0)
  3020.     Return $aresult[0]
  3021. EndFunc
  3022.  
  3023. Func _winapi_getwindowdc($hwnd)
  3024.     Local $aresult = DllCall("user32.dll", "handle", "GetWindowDC", "hwnd", $hwnd)
  3025.     If @error Then Return SetError(@error, @extended, 0)
  3026.     Return $aresult[0]
  3027. EndFunc
  3028.  
  3029. Func _winapi_getwindowheight($hwnd)
  3030.     Local $trect = _winapi_getwindowrect($hwnd)
  3031.     If @error Then Return SetError(@error, @extended, 0)
  3032.     Return DllStructGetData($trect, "Bottom") - DllStructGetData($trect, "Top")
  3033. EndFunc
  3034.  
  3035. Func _winapi_getwindowlong($hwnd, $iindex)
  3036.     Local $sfuncname = "GetWindowLongW"
  3037.     If @AutoItX64 Then $sfuncname = "GetWindowLongPtrW"
  3038.     Local $aresult = DllCall("user32.dll", "long_ptr", $sfuncname, "hwnd", $hwnd, "int", $iindex)
  3039.     If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, 0)
  3040.     Return $aresult[0]
  3041. EndFunc
  3042.  
  3043. Func _winapi_getwindowplacement($hwnd)
  3044.     Local $twindowplacement = DllStructCreate($tagwindowplacement)
  3045.     DllStructSetData($twindowplacement, "length", DllStructGetSize($twindowplacement))
  3046.     Local $aret = DllCall("user32.dll", "bool", "GetWindowPlacement", "hwnd", $hwnd, "struct*", $twindowplacement)
  3047.     If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
  3048.     Return $twindowplacement
  3049. EndFunc
  3050.  
  3051. Func _winapi_getwindowrect($hwnd)
  3052.     Local $trect = DllStructCreate($tagrect)
  3053.     Local $aret = DllCall("user32.dll", "bool", "GetWindowRect", "hwnd", $hwnd, "struct*", $trect)
  3054.     If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
  3055.     Return $trect
  3056. EndFunc
  3057.  
  3058. Func _winapi_getwindowrgn($hwnd, $hrgn)
  3059.     Local $aresult = DllCall("user32.dll", "int", "GetWindowRgn", "hwnd", $hwnd, "handle", $hrgn)
  3060.     If @error Then Return SetError(@error, @extended, 0)
  3061.     Return $aresult[0]
  3062. EndFunc
  3063.  
  3064. Func _winapi_getwindowtext($hwnd)
  3065.     Local $aresult = DllCall("user32.dll", "int", "GetWindowTextW", "hwnd", $hwnd, "wstr", "", "int", 4096)
  3066.     If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, "")
  3067.     Return SetExtended($aresult[0], $aresult[2])
  3068. EndFunc
  3069.  
  3070. Func _winapi_getwindowthreadprocessid($hwnd, ByRef $ipid)
  3071.     Local $aresult = DllCall("user32.dll", "dword", "GetWindowThreadProcessId", "hwnd", $hwnd, "dword*", 0)
  3072.     If @error Then Return SetError(@error, @extended, 0)
  3073.     $ipid = $aresult[2]
  3074.     Return $aresult[0]
  3075. EndFunc
  3076.  
  3077. Func _winapi_getwindowwidth($hwnd)
  3078.     Local $trect = _winapi_getwindowrect($hwnd)
  3079.     If @error Then Return SetError(@error, @extended, 0)
  3080.     Return DllStructGetData($trect, "Right") - DllStructGetData($trect, "Left")
  3081. EndFunc
  3082.  
  3083. Func _winapi_getxyfrompoint(ByRef $tpoint, ByRef $ix, ByRef $iy)
  3084.     $ix = DllStructGetData($tpoint, "X")
  3085.     $iy = DllStructGetData($tpoint, "Y")
  3086. EndFunc
  3087.  
  3088. Func _winapi_globalmemorystatus()
  3089.     Local $tmem = DllStructCreate($tagmemorystatusex)
  3090.     DllStructSetData($tmem, 1, DllStructGetSize($tmem))
  3091.     Local $aret = DllCall("kernel32.dll", "bool", "GlobalMemoryStatusEx", "struct*", $tmem)
  3092.     If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
  3093.     Local $amem[7]
  3094.     $amem[0] = DllStructGetData($tmem, 2)
  3095.     $amem[1] = DllStructGetData($tmem, 3)
  3096.     $amem[2] = DllStructGetData($tmem, 4)
  3097.     $amem[3] = DllStructGetData($tmem, 5)
  3098.     $amem[4] = DllStructGetData($tmem, 6)
  3099.     $amem[5] = DllStructGetData($tmem, 7)
  3100.     $amem[6] = DllStructGetData($tmem, 8)
  3101.     Return $amem
  3102. EndFunc
  3103.  
  3104. Func _winapi_guidfromstring($sguid)
  3105.     Local $tguid = DllStructCreate($tagguid)
  3106.     _winapi_guidfromstringex($sguid, $tguid)
  3107.     If @error Then Return SetError(@error + 10, @extended, 0)
  3108.     Return $tguid
  3109. EndFunc
  3110.  
  3111. Func _winapi_guidfromstringex($sguid, $tguid)
  3112.     Local $aresult = DllCall("ole32.dll", "long", "CLSIDFromString", "wstr", $sguid, "struct*", $tguid)
  3113.     If @error Then Return SetError(@error, @extended, False)
  3114.     Return $aresult[0]
  3115. EndFunc
  3116.  
  3117. Func _winapi_hiword($ilong)
  3118.     Return BitShift($ilong, 16)
  3119. EndFunc
  3120.  
  3121. Func _winapi_inprocess($hwnd, ByRef $hlastwnd)
  3122.     If $hwnd = $hlastwnd Then Return True
  3123.     For $ii = $__g_ainprocess_winapi[0][0] To 1 Step -1
  3124.         If $hwnd = $__g_ainprocess_winapi[$ii][0] Then
  3125.             If $__g_ainprocess_winapi[$ii][1] Then
  3126.                 $hlastwnd = $hwnd
  3127.                 Return True
  3128.             Else
  3129.                 Return False
  3130.             EndIf
  3131.         EndIf
  3132.     Next
  3133.     Local $ipid
  3134.     _winapi_getwindowthreadprocessid($hwnd, $ipid)
  3135.     Local $icount = $__g_ainprocess_winapi[0][0] + 1
  3136.     If $icount >= 64 Then $icount = 1
  3137.     $__g_ainprocess_winapi[0][0] = $icount
  3138.     $__g_ainprocess_winapi[$icount][0] = $hwnd
  3139.     $__g_ainprocess_winapi[$icount][1] = ($ipid = @AutoItPID)
  3140.     Return $__g_ainprocess_winapi[$icount][1]
  3141. EndFunc
  3142.  
  3143. Func _winapi_inttofloat($iint)
  3144.     Local $tint = DllStructCreate("int")
  3145.     Local $tfloat = DllStructCreate("float", DllStructGetPtr($tint))
  3146.     DllStructSetData($tint, 1, $iint)
  3147.     Return DllStructGetData($tfloat, 1)
  3148. EndFunc
  3149.  
  3150. Func _winapi_isclassname($hwnd, $sclassname)
  3151.     Local $sseparator = Opt("GUIDataSeparatorChar")
  3152.     Local $aclassname = StringSplit($sclassname, $sseparator)
  3153.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3154.     Local $sclasscheck = _winapi_getclassname($hwnd)
  3155.     For $x = 1 To UBound($aclassname) - 1
  3156.         If StringUpper(StringMid($sclasscheck, 1, StringLen($aclassname[$x]))) = StringUpper($aclassname[$x]) Then Return True
  3157.     Next
  3158.     Return False
  3159. EndFunc
  3160.  
  3161. Func _winapi_iswindow($hwnd)
  3162.     Local $aresult = DllCall("user32.dll", "bool", "IsWindow", "hwnd", $hwnd)
  3163.     If @error Then Return SetError(@error, @extended, 0)
  3164.     Return $aresult[0]
  3165. EndFunc
  3166.  
  3167. Func _winapi_iswindowvisible($hwnd)
  3168.     Local $aresult = DllCall("user32.dll", "bool", "IsWindowVisible", "hwnd", $hwnd)
  3169.     If @error Then Return SetError(@error, @extended, 0)
  3170.     Return $aresult[0]
  3171. EndFunc
  3172.  
  3173. Func _winapi_invalidaterect($hwnd, $trect = 0, $berase = True)
  3174.     Local $aresult = DllCall("user32.dll", "bool", "InvalidateRect", "hwnd", $hwnd, "struct*", $trect, "bool", $berase)
  3175.     If @error Then Return SetError(@error, @extended, False)
  3176.     Return $aresult[0]
  3177. EndFunc
  3178.  
  3179. Func _winapi_lineto($hdc, $ix, $iy)
  3180.     Local $aresult = DllCall("gdi32.dll", "bool", "LineTo", "handle", $hdc, "int", $ix, "int", $iy)
  3181.     If @error Then Return SetError(@error, @extended, False)
  3182.     Return $aresult[0]
  3183. EndFunc
  3184.  
  3185. Func _winapi_loadbitmap($hinstance, $sbitmap)
  3186.     Local $sbitmaptype = "int"
  3187.     If IsString($sbitmap) Then $sbitmaptype = "wstr"
  3188.     Local $aresult = DllCall("user32.dll", "handle", "LoadBitmapW", "handle", $hinstance, $sbitmaptype, $sbitmap)
  3189.     If @error Then Return SetError(@error, @extended, 0)
  3190.     Return $aresult[0]
  3191. EndFunc
  3192.  
  3193. Func _winapi_loadimage($hinstance, $simage, $itype, $ixdesired, $iydesired, $iload)
  3194.     Local $aresult, $simagetype = "int"
  3195.     If IsString($simage) Then $simagetype = "wstr"
  3196.     $aresult = DllCall("user32.dll", "handle", "LoadImageW", "handle", $hinstance, $simagetype, $simage, "uint", $itype, "int", $ixdesired, "int", $iydesired, "uint", $iload)
  3197.     If @error Then Return SetError(@error, @extended, 0)
  3198.     Return $aresult[0]
  3199. EndFunc
  3200.  
  3201. Func _winapi_loadlibrary($sfilename)
  3202.     Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryW", "wstr", $sfilename)
  3203.     If @error Then Return SetError(@error, @extended, 0)
  3204.     Return $aresult[0]
  3205. EndFunc
  3206.  
  3207. Func _winapi_loadlibraryex($sfilename, $iflags = 0)
  3208.     Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryExW", "wstr", $sfilename, "ptr", 0, "dword", $iflags)
  3209.     If @error Then Return SetError(@error, @extended, 0)
  3210.     Return $aresult[0]
  3211. EndFunc
  3212.  
  3213. Func _winapi_loadshell32icon($iiconid)
  3214.     Local $ticons = DllStructCreate("ptr Data")
  3215.     Local $iicons = _winapi_extracticonex("shell32.dll", $iiconid, 0, $ticons, 1)
  3216.     If @error Then Return SetError(@error, @extended, 0)
  3217.     If $iicons <= 0 Then Return SetError(10, 0, 0)
  3218.     Return DllStructGetData($ticons, "Data")
  3219. EndFunc
  3220.  
  3221. Func _winapi_loadstring($hinstance, $istringid)
  3222.     Local $aresult = DllCall("user32.dll", "int", "LoadStringW", "handle", $hinstance, "uint", $istringid, "wstr", "", "int", 4096)
  3223.     If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, "")
  3224.     Return SetExtended($aresult[0], $aresult[3])
  3225. EndFunc
  3226.  
  3227. Func _winapi_localfree($hmemory)
  3228.     Local $aresult = DllCall("kernel32.dll", "handle", "LocalFree", "handle", $hmemory)
  3229.     If @error Then Return SetError(@error, @extended, False)
  3230.     Return $aresult[0]
  3231. EndFunc
  3232.  
  3233. Func _winapi_loword($ilong)
  3234.     Return BitAND($ilong, 65535)
  3235. EndFunc
  3236.  
  3237. Func _winapi_makelangid($ilngidprimary, $ilngidsub)
  3238.     Return BitOR(BitShift($ilngidsub, -10), $ilngidprimary)
  3239. EndFunc
  3240.  
  3241. Func _winapi_makelcid($ilngid, $isortid)
  3242.     Return BitOR(BitShift($isortid, -16), $ilngid)
  3243. EndFunc
  3244.  
  3245. Func _winapi_makelong($ilo, $ihi)
  3246.     Return BitOR(BitShift($ihi, -16), BitAND($ilo, 65535))
  3247. EndFunc
  3248.  
  3249. Func _winapi_makeqword($ilodword, $ihidword)
  3250.     Local $tint64 = DllStructCreate("uint64")
  3251.     Local $tdwords = DllStructCreate("dword;dword", DllStructGetPtr($tint64))
  3252.     DllStructSetData($tdwords, 1, $ilodword)
  3253.     DllStructSetData($tdwords, 2, $ihidword)
  3254.     Return DllStructGetData($tint64, 1)
  3255. EndFunc
  3256.  
  3257. Func _winapi_messagebeep($itype = 1)
  3258.     Local $isound
  3259.     Switch $itype
  3260.         Case 1
  3261.             $isound = 0
  3262.         Case 2
  3263.             $isound = 16
  3264.         Case 3
  3265.             $isound = 32
  3266.         Case 4
  3267.             $isound = 48
  3268.         Case 5
  3269.             $isound = 64
  3270.         Case Else
  3271.             $isound = -1
  3272.     EndSwitch
  3273.     Local $aresult = DllCall("user32.dll", "bool", "MessageBeep", "uint", $isound)
  3274.     If @error Then Return SetError(@error, @extended, False)
  3275.     Return $aresult[0]
  3276. EndFunc
  3277.  
  3278. Func _winapi_msgbox($iflags, $stitle, $stext)
  3279.     BlockInput(0)
  3280.     MsgBox($iflags, $stitle, $stext & "      ")
  3281. EndFunc
  3282.  
  3283. Func _winapi_mouse_event($iflags, $ix = 0, $iy = 0, $idata = 0, $iextrainfo = 0)
  3284.     DllCall("user32.dll", "none", "mouse_event", "dword", $iflags, "dword", $ix, "dword", $iy, "dword", $idata, "ulong_ptr", $iextrainfo)
  3285.     If @error Then Return SetError(@error, @extended)
  3286. EndFunc
  3287.  
  3288. Func _winapi_moveto($hdc, $ix, $iy)
  3289.     Local $aresult = DllCall("gdi32.dll", "bool", "MoveToEx", "handle", $hdc, "int", $ix, "int", $iy, "ptr", 0)
  3290.     If @error Then Return SetError(@error, @extended, False)
  3291.     Return $aresult[0]
  3292. EndFunc
  3293.  
  3294. Func _winapi_movewindow($hwnd, $ix, $iy, $iwidth, $iheight, $brepaint = True)
  3295.     Local $aresult = DllCall("user32.dll", "bool", "MoveWindow", "hwnd", $hwnd, "int", $ix, "int", $iy, "int", $iwidth, "int", $iheight, "bool", $brepaint)
  3296.     If @error Then Return SetError(@error, @extended, False)
  3297.     Return $aresult[0]
  3298. EndFunc
  3299.  
  3300. Func _winapi_muldiv($inumber, $inumerator, $idenominator)
  3301.     Local $aresult = DllCall("kernel32.dll", "int", "MulDiv", "int", $inumber, "int", $inumerator, "int", $idenominator)
  3302.     If @error Then Return SetError(@error, @extended, -1)
  3303.     Return $aresult[0]
  3304. EndFunc
  3305.  
  3306. Func _winapi_multibytetowidechar($vtext, $icodepage = 0, $iflags = 0, $bretstring = False)
  3307.     Local $stexttype = "str"
  3308.     If NOT IsString($vtext) Then $stexttype = "struct*"
  3309.     Local $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $vtext, "int", -1, "ptr", 0, "int", 0)
  3310.     If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, 0)
  3311.     Local $iout = $aresult[0]
  3312.     Local $tout = DllStructCreate("wchar[" & $iout & "]")
  3313.     $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $vtext, "int", -1, "struct*", $tout, "int", $iout)
  3314.     If @error OR NOT $aresult[0] Then Return SetError(@error + 20, @extended, 0)
  3315.     If $bretstring Then Return DllStructGetData($tout, 1)
  3316.     Return $tout
  3317. EndFunc
  3318.  
  3319. Func _winapi_multibytetowidecharex($stext, $ptext, $icodepage = 0, $iflags = 0)
  3320.     Local $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, "STR", $stext, "int", -1, "struct*", $ptext, "int", (StringLen($stext) + 1) * 2)
  3321.     If @error Then Return SetError(@error, @extended, False)
  3322.     Return $aresult[0]
  3323. EndFunc
  3324.  
  3325. Func _winapi_openprocess($iaccess, $binherit, $ipid, $bdebugpriv = False)
  3326.     Local $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $binherit, "dword", $ipid)
  3327.     If @error Then Return SetError(@error, @extended, 0)
  3328.     If $aresult[0] Then Return $aresult[0]
  3329.     If NOT $bdebugpriv Then Return SetError(100, 0, 0)
  3330.     Local $htoken = _security__openthreadtokenex(BitOR($token_adjust_privileges, $token_query))
  3331.     If @error Then Return SetError(@error + 10, @extended, 0)
  3332.     _security__setprivilege($htoken, "SeDebugPrivilege", True)
  3333.     Local $ierror = @error
  3334.     Local $iextended = @extended
  3335.     Local $iret = 0
  3336.     If NOT @error Then
  3337.         $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $binherit, "dword", $ipid)
  3338.         $ierror = @error
  3339.         $iextended = @extended
  3340.         If $aresult[0] Then $iret = $aresult[0]
  3341.         _security__setprivilege($htoken, "SeDebugPrivilege", False)
  3342.         If @error Then
  3343.             $ierror = @error + 20
  3344.             $iextended = @extended
  3345.         EndIf
  3346.     Else
  3347.         $ierror = @error + 30
  3348.     EndIf
  3349.     _winapi_closehandle($htoken)
  3350.     Return SetError($ierror, $iextended, $iret)
  3351. EndFunc
  3352.  
  3353. Func __winapi_parsefiledialogpath($spath)
  3354.     Local $afiles[3]
  3355.     $afiles[0] = 2
  3356.     Local $stemp = StringMid($spath, 1, StringInStr($spath, "\", 0, -1) - 1)
  3357.     $afiles[1] = $stemp
  3358.     $afiles[2] = StringMid($spath, StringInStr($spath, "\", 0, -1) + 1)
  3359.     Return $afiles
  3360. EndFunc
  3361.  
  3362. Func _winapi_pathfindonpath(Const $sfilepath, $aextrapaths = "", Const $spathdelimiter = @LF)
  3363.     Local $iextracount = 0
  3364.     If IsString($aextrapaths) Then
  3365.         If StringLen($aextrapaths) Then
  3366.             $aextrapaths = StringSplit($aextrapaths, $spathdelimiter, $str_entiresplit + $str_nocount)
  3367.             $iextracount = UBound($aextrapaths, $ubound_rows)
  3368.         EndIf
  3369.     ElseIf IsArray($aextrapaths) Then
  3370.         $iextracount = UBound($aextrapaths)
  3371.     EndIf
  3372.     Local $tpaths, $tpathptrs
  3373.     If $iextracount Then
  3374.         Local $tagstruct = ""
  3375.         For $path In $aextrapaths
  3376.             $tagstruct &= "wchar[" & StringLen($path) + 1 & "];"
  3377.         Next
  3378.         $tpaths = DllStructCreate($tagstruct)
  3379.         $tpathptrs = DllStructCreate("ptr[" & $iextracount + 1 & "]")
  3380.         For $i = 1 To $iextracount
  3381.             DllStructSetData($tpaths, $i, $aextrapaths[$i - 1])
  3382.             DllStructSetData($tpathptrs, 1, DllStructGetPtr($tpaths, $i), $i)
  3383.         Next
  3384.         DllStructSetData($tpathptrs, 1, Ptr(0), $iextracount + 1)
  3385.     EndIf
  3386.     Local $aresult = DllCall("shlwapi.dll", "bool", "PathFindOnPathW", "wstr", $sfilepath, "struct*", $tpathptrs)
  3387.     If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, $sfilepath)
  3388.     Return $aresult[1]
  3389. EndFunc
  3390.  
  3391. Func _winapi_pointfromrect(ByRef $trect, $bcenter = True)
  3392.     Local $ix1 = DllStructGetData($trect, "Left")
  3393.     Local $iy1 = DllStructGetData($trect, "Top")
  3394.     Local $ix2 = DllStructGetData($trect, "Right")
  3395.     Local $iy2 = DllStructGetData($trect, "Bottom")
  3396.     If $bcenter Then
  3397.         $ix1 = $ix1 + (($ix2 - $ix1) / 2)
  3398.         $iy1 = $iy1 + (($iy2 - $iy1) / 2)
  3399.     EndIf
  3400.     Local $tpoint = DllStructCreate($tagpoint)
  3401.     DllStructSetData($tpoint, "X", $ix1)
  3402.     DllStructSetData($tpoint, "Y", $iy1)
  3403.     Return $tpoint
  3404. EndFunc
  3405.  
  3406. Func _winapi_postmessage($hwnd, $imsg, $wparam, $lparam)
  3407.     Local $aresult = DllCall("user32.dll", "bool", "PostMessage", "hwnd", $hwnd, "uint", $imsg, "wparam", $wparam, "lparam", $lparam)
  3408.     If @error Then Return SetError(@error, @extended, False)
  3409.     Return $aresult[0]
  3410. EndFunc
  3411.  
  3412. Func _winapi_primarylangid($ilngid)
  3413.     Return BitAND($ilngid, 1023)
  3414. EndFunc
  3415.  
  3416. Func _winapi_ptinrect(ByRef $trect, ByRef $tpoint)
  3417.     Local $aresult = DllCall("user32.dll", "bool", "PtInRect", "struct*", $trect, "struct", $tpoint)
  3418.     If @error Then Return SetError(@error, @extended, False)
  3419.     Return $aresult[0]
  3420. EndFunc
  3421.  
  3422. Func _winapi_readfile($hfile, $pbuffer, $itoread, ByRef $iread, $toverlapped = 0)
  3423.     Local $aresult = DllCall("kernel32.dll", "bool", "ReadFile", "handle", $hfile, "struct*", $pbuffer, "dword", $itoread, "dword*", 0, "struct*", $toverlapped)
  3424.     If @error Then Return SetError(@error, @extended, False)
  3425.     $iread = $aresult[4]
  3426.     Return $aresult[0]
  3427. EndFunc
  3428.  
  3429. Func _winapi_readprocessmemory($hprocess, $pbaseaddress, $pbuffer, $isize, ByRef $iread)
  3430.     Local $aresult = DllCall("kernel32.dll", "bool", "ReadProcessMemory", "handle", $hprocess, "ptr", $pbaseaddress, "struct*", $pbuffer, "ulong_ptr", $isize, "ulong_ptr*", 0)
  3431.     If @error Then Return SetError(@error, @extended, False)
  3432.     $iread = $aresult[5]
  3433.     Return $aresult[0]
  3434. EndFunc
  3435.  
  3436. Func _winapi_rectisempty(ByRef $trect)
  3437.     Return (DllStructGetData($trect, "Left") = 0) AND (DllStructGetData($trect, "Top") = 0) AND (DllStructGetData($trect, "Right") = 0) AND (DllStructGetData($trect, "Bottom") = 0)
  3438. EndFunc
  3439.  
  3440. Func _winapi_redrawwindow($hwnd, $trect = 0, $hregion = 0, $iflags = 5)
  3441.     Local $aresult = DllCall("user32.dll", "bool", "RedrawWindow", "hwnd", $hwnd, "struct*", $trect, "handle", $hregion, "uint", $iflags)
  3442.     If @error Then Return SetError(@error, @extended, False)
  3443.     Return $aresult[0]
  3444. EndFunc
  3445.  
  3446. Func _winapi_registerwindowmessage($smessage)
  3447.     Local $aresult = DllCall("user32.dll", "uint", "RegisterWindowMessageW", "wstr", $smessage)
  3448.     If @error Then Return SetError(@error, @extended, 0)
  3449.     Return $aresult[0]
  3450. EndFunc
  3451.  
  3452. Func _winapi_releasecapture()
  3453.     Local $aresult = DllCall("user32.dll", "bool", "ReleaseCapture")
  3454.     If @error Then Return SetError(@error, @extended, False)
  3455.     Return $aresult[0]
  3456. EndFunc
  3457.  
  3458. Func _winapi_releasedc($hwnd, $hdc)
  3459.     Local $aresult = DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hwnd, "handle", $hdc)
  3460.     If @error Then Return SetError(@error, @extended, False)
  3461.     Return $aresult[0]
  3462. EndFunc
  3463.  
  3464. Func _winapi_screentoclient($hwnd, ByRef $tpoint)
  3465.     Local $aresult = DllCall("user32.dll", "bool", "ScreenToClient", "hwnd", $hwnd, "struct*", $tpoint)
  3466.     If @error Then Return SetError(@error, @extended, False)
  3467.     Return $aresult[0]
  3468. EndFunc
  3469.  
  3470. Func _winapi_selectobject($hdc, $hgdiobj)
  3471.     Local $aresult = DllCall("gdi32.dll", "handle", "SelectObject", "handle", $hdc, "handle", $hgdiobj)
  3472.     If @error Then Return SetError(@error, @extended, False)
  3473.     Return $aresult[0]
  3474. EndFunc
  3475.  
  3476. Func _winapi_setbkcolor($hdc, $icolor)
  3477.     Local $aresult = DllCall("gdi32.dll", "INT", "SetBkColor", "handle", $hdc, "INT", $icolor)
  3478.     If @error Then Return SetError(@error, @extended, -1)
  3479.     Return $aresult[0]
  3480. EndFunc
  3481.  
  3482. Func _winapi_setbkmode($hdc, $ibkmode)
  3483.     Local $aresult = DllCall("gdi32.dll", "int", "SetBkMode", "handle", $hdc, "int", $ibkmode)
  3484.     If @error Then Return SetError(@error, @extended, 0)
  3485.     Return $aresult[0]
  3486. EndFunc
  3487.  
  3488. Func _winapi_setcapture($hwnd)
  3489.     Local $aresult = DllCall("user32.dll", "hwnd", "SetCapture", "hwnd", $hwnd)
  3490.     If @error Then Return SetError(@error, @extended, 0)
  3491.     Return $aresult[0]
  3492. EndFunc
  3493.  
  3494. Func _winapi_setcursor($hcursor)
  3495.     Local $aresult = DllCall("user32.dll", "handle", "SetCursor", "handle", $hcursor)
  3496.     If @error Then Return SetError(@error, @extended, 0)
  3497.     Return $aresult[0]
  3498. EndFunc
  3499.  
  3500. Func _winapi_setdefaultprinter($sprinter)
  3501.     Local $aresult = DllCall("winspool.drv", "bool", "SetDefaultPrinterW", "wstr", $sprinter)
  3502.     If @error Then Return SetError(@error, @extended, False)
  3503.     Return $aresult[0]
  3504. EndFunc
  3505.  
  3506. Func _winapi_setdibits($hdc, $hbitmap, $istartscan, $iscanlines, $pbits, $tbmi, $icoloruse = 0)
  3507.     Local $aresult = DllCall("gdi32.dll", "int", "SetDIBits", "handle", $hdc, "handle", $hbitmap, "uint", $istartscan, "uint", $iscanlines, "struct*", $pbits, "struct*", $tbmi, "INT", $icoloruse)
  3508.     If @error Then Return SetError(@error, @extended, False)
  3509.     Return $aresult[0]
  3510. EndFunc
  3511.  
  3512. Func _winapi_setendoffile($hfile)
  3513.     Local $aresult = DllCall("kernel32.dll", "bool", "SetEndOfFile", "handle", $hfile)
  3514.     If @error Then Return SetError(@error, @extended, False)
  3515.     Return $aresult[0]
  3516. EndFunc
  3517.  
  3518. Func _winapi_setevent($hevent)
  3519.     Local $aresult = DllCall("kernel32.dll", "bool", "SetEvent", "handle", $hevent)
  3520.     If @error Then Return SetError(@error, @extended, False)
  3521.     Return $aresult[0]
  3522. EndFunc
  3523.  
  3524. Func _winapi_setfilepointer($hfile, $ipos, $imethod = 0)
  3525.     Local $aresult = DllCall("kernel32.dll", "INT", "SetFilePointer", "handle", $hfile, "long", $ipos, "ptr", 0, "long", $imethod)
  3526.     If @error Then Return SetError(@error, @extended, -1)
  3527.     Return $aresult[0]
  3528. EndFunc
  3529.  
  3530. Func _winapi_setfocus($hwnd)
  3531.     Local $aresult = DllCall("user32.dll", "hwnd", "SetFocus", "hwnd", $hwnd)
  3532.     If @error Then Return SetError(@error, @extended, 0)
  3533.     Return $aresult[0]
  3534. EndFunc
  3535.  
  3536. Func _winapi_setfont($hwnd, $hfont, $bredraw = True)
  3537.     _sendmessage($hwnd, $__winapiconstant_wm_setfont, $hfont, $bredraw, 0, "hwnd")
  3538. EndFunc
  3539.  
  3540. Func _winapi_sethandleinformation($hobject, $imask, $iflags)
  3541.     Local $aresult = DllCall("kernel32.dll", "bool", "SetHandleInformation", "handle", $hobject, "dword", $imask, "dword", $iflags)
  3542.     If @error Then Return SetError(@error, @extended, False)
  3543.     Return $aresult[0]
  3544. EndFunc
  3545.  
  3546. Func _winapi_setlayeredwindowattributes($hwnd, $itranscolor, $itransgui = 255, $iflags = 3, $bcolorref = False)
  3547.     If $iflags = Default OR $iflags = "" OR $iflags < 0 Then $iflags = 3
  3548.     If NOT $bcolorref Then
  3549.         $itranscolor = Int(BinaryMid($itranscolor, 3, 1) & BinaryMid($itranscolor, 2, 1) & BinaryMid($itranscolor, 1, 1))
  3550.     EndIf
  3551.     Local $aresult = DllCall("user32.dll", "bool", "SetLayeredWindowAttributes", "hwnd", $hwnd, "INT", $itranscolor, "byte", $itransgui, "dword", $iflags)
  3552.     If @error Then Return SetError(@error, @extended, False)
  3553.     Return $aresult[0]
  3554. EndFunc
  3555.  
  3556. Func _winapi_setparent($hwndchild, $hwndparent)
  3557.     Local $aresult = DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $hwndchild, "hwnd", $hwndparent)
  3558.     If @error Then Return SetError(@error, @extended, 0)
  3559.     Return $aresult[0]
  3560. EndFunc
  3561.  
  3562. Func _winapi_setprocessaffinitymask($hprocess, $imask)
  3563.     Local $aresult = DllCall("kernel32.dll", "bool", "SetProcessAffinityMask", "handle", $hprocess, "ulong_ptr", $imask)
  3564.     If @error Then Return SetError(@error, @extended, False)
  3565.     Return $aresult[0]
  3566. EndFunc
  3567.  
  3568. Func _winapi_setsyscolors($velements, $vcolors)
  3569.     Local $bisearray = IsArray($velements), $biscarray = IsArray($vcolors)
  3570.     Local $ielementnum
  3571.     If NOT $biscarray AND NOT $bisearray Then
  3572.         $ielementnum = 1
  3573.     ElseIf $biscarray OR $bisearray Then
  3574.         If NOT $biscarray OR NOT $bisearray Then Return SetError(-1, -1, False)
  3575.         If UBound($velements) <> UBound($vcolors) Then Return SetError(-1, -1, False)
  3576.         $ielementnum = UBound($velements)
  3577.     EndIf
  3578.     Local $telements = DllStructCreate("int Element[" & $ielementnum & "]")
  3579.     Local $tcolors = DllStructCreate("INT NewColor[" & $ielementnum & "]")
  3580.     If NOT $bisearray Then
  3581.         DllStructSetData($telements, "Element", $velements, 1)
  3582.     Else
  3583.         For $x = 0 To $ielementnum - 1
  3584.             DllStructSetData($telements, "Element", $velements[$x], $x + 1)
  3585.         Next
  3586.     EndIf
  3587.     If NOT $biscarray Then
  3588.         DllStructSetData($tcolors, "NewColor", $vcolors, 1)
  3589.     Else
  3590.         For $x = 0 To $ielementnum - 1
  3591.             DllStructSetData($tcolors, "NewColor", $vcolors[$x], $x + 1)
  3592.         Next
  3593.     EndIf
  3594.     Local $aresult = DllCall("user32.dll", "bool", "SetSysColors", "int", $ielementnum, "struct*", $telements, "struct*", $tcolors)
  3595.     If @error Then Return SetError(@error, @extended, False)
  3596.     Return $aresult[0]
  3597. EndFunc
  3598.  
  3599. Func _winapi_settextcolor($hdc, $icolor)
  3600.     Local $aresult = DllCall("gdi32.dll", "INT", "SetTextColor", "handle", $hdc, "INT", $icolor)
  3601.     If @error Then Return SetError(@error, @extended, -1)
  3602.     Return $aresult[0]
  3603. EndFunc
  3604.  
  3605. Func _winapi_setwindowlong($hwnd, $iindex, $ivalue)
  3606.     _winapi_setlasterror(0)
  3607.     Local $sfuncname = "SetWindowLongW"
  3608.     If @AutoItX64 Then $sfuncname = "SetWindowLongPtrW"
  3609.     Local $aresult = DllCall("user32.dll", "long_ptr", $sfuncname, "hwnd", $hwnd, "int", $iindex, "long_ptr", $ivalue)
  3610.     If @error Then Return SetError(@error, @extended, 0)
  3611.     Return $aresult[0]
  3612. EndFunc
  3613.  
  3614. Func _winapi_setwindowplacement($hwnd, $twindowplacement)
  3615.     Local $aresult = DllCall("user32.dll", "bool", "SetWindowPlacement", "hwnd", $hwnd, "struct*", $twindowplacement)
  3616.     If @error Then Return SetError(@error, @extended, False)
  3617.     Return $aresult[0]
  3618. EndFunc
  3619.  
  3620. Func _winapi_setwindowpos($hwnd, $hafter, $ix, $iy, $icx, $icy, $iflags)
  3621.     Local $aresult = DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $hwnd, "hwnd", $hafter, "int", $ix, "int", $iy, "int", $icx, "int", $icy, "uint", $iflags)
  3622.     If @error Then Return SetError(@error, @extended, False)
  3623.     Return $aresult[0]
  3624. EndFunc
  3625.  
  3626. Func _winapi_setwindowrgn($hwnd, $hrgn, $bredraw = True)
  3627.     Local $aresult = DllCall("user32.dll", "int", "SetWindowRgn", "hwnd", $hwnd, "handle", $hrgn, "bool", $bredraw)
  3628.     If @error Then Return SetError(@error, @extended, False)
  3629.     Return $aresult[0]
  3630. EndFunc
  3631.  
  3632. Func _winapi_setwindowshookex($ihook, $pproc, $hdll, $ithreadid = 0)
  3633.     Local $aresult = DllCall("user32.dll", "handle", "SetWindowsHookEx", "int", $ihook, "ptr", $pproc, "handle", $hdll, "dword", $ithreadid)
  3634.     If @error Then Return SetError(@error, @extended, 0)
  3635.     Return $aresult[0]
  3636. EndFunc
  3637.  
  3638. Func _winapi_setwindowtext($hwnd, $stext)
  3639.     Local $aresult = DllCall("user32.dll", "bool", "SetWindowTextW", "hwnd", $hwnd, "wstr", $stext)
  3640.     If @error Then Return SetError(@error, @extended, False)
  3641.     Return $aresult[0]
  3642. EndFunc
  3643.  
  3644. Func _winapi_showcursor($bshow)
  3645.     Local $aresult = DllCall("user32.dll", "int", "ShowCursor", "bool", $bshow)
  3646.     If @error Then Return SetError(@error, @extended, 0)
  3647.     Return $aresult[0]
  3648. EndFunc
  3649.  
  3650. Func _winapi_showerror($stext, $bexit = True)
  3651.     _winapi_msgbox($mb_systemmodal, "Error", $stext)
  3652.     If $bexit Then Exit
  3653. EndFunc
  3654.  
  3655. Func _winapi_showmsg($stext)
  3656.     _winapi_msgbox($mb_systemmodal, "Information", $stext)
  3657. EndFunc
  3658.  
  3659. Func _winapi_showwindow($hwnd, $icmdshow = 5)
  3660.     Local $aresult = DllCall("user32.dll", "bool", "ShowWindow", "hwnd", $hwnd, "int", $icmdshow)
  3661.     If @error Then Return SetError(@error, @extended, False)
  3662.     Return $aresult[0]
  3663. EndFunc
  3664.  
  3665. Func _winapi_stringfromguid($tguid)
  3666.     Local $aresult = DllCall("ole32.dll", "int", "StringFromGUID2", "struct*", $tguid, "wstr", "", "int", 40)
  3667.     If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, "")
  3668.     Return SetExtended($aresult[0], $aresult[2])
  3669. EndFunc
  3670.  
  3671. Func _winapi_stringlena(Const ByRef $tstring)
  3672.     Local $aresult = DllCall("kernel32.dll", "int", "lstrlenA", "struct*", $tstring)
  3673.     If @error Then Return SetError(@error, @extended, 0)
  3674.     Return $aresult[0]
  3675. EndFunc
  3676.  
  3677. Func _winapi_stringlenw(Const ByRef $tstring)
  3678.     Local $aresult = DllCall("kernel32.dll", "int", "lstrlenW", "struct*", $tstring)
  3679.     If @error Then Return SetError(@error, @extended, 0)
  3680.     Return $aresult[0]
  3681. EndFunc
  3682.  
  3683. Func _winapi_sublangid($ilngid)
  3684.     Return BitShift($ilngid, 10)
  3685. EndFunc
  3686.  
  3687. Func _winapi_systemparametersinfo($iaction, $iparam = 0, $vparam = 0, $iwinini = 0)
  3688.     Local $aresult = DllCall("user32.dll", "bool", "SystemParametersInfoW", "uint", $iaction, "uint", $iparam, "struct*", $vparam, "uint", $iwinini)
  3689.     If @error Then Return SetError(@error, @extended, False)
  3690.     Return $aresult[0]
  3691. EndFunc
  3692.  
  3693. Func _winapi_twipsperpixelx()
  3694.     Local $hdc, $itwipsperpixelx
  3695.     $hdc = _winapi_getdc(0)
  3696.     $itwipsperpixelx = 1440 / _winapi_getdevicecaps($hdc, $__winapiconstant_logpixelsx)
  3697.     _winapi_releasedc(0, $hdc)
  3698.     Return $itwipsperpixelx
  3699. EndFunc
  3700.  
  3701. Func _winapi_twipsperpixely()
  3702.     Local $hdc, $itwipsperpixely
  3703.     $hdc = _winapi_getdc(0)
  3704.     $itwipsperpixely = 1440 / _winapi_getdevicecaps($hdc, $__winapiconstant_logpixelsy)
  3705.     _winapi_releasedc(0, $hdc)
  3706.     Return $itwipsperpixely
  3707. EndFunc
  3708.  
  3709. Func _winapi_unhookwindowshookex($hhook)
  3710.     Local $aresult = DllCall("user32.dll", "bool", "UnhookWindowsHookEx", "handle", $hhook)
  3711.     If @error Then Return SetError(@error, @extended, False)
  3712.     Return $aresult[0]
  3713. EndFunc
  3714.  
  3715. Func _winapi_updatelayeredwindow($hwnd, $hdestdc, $tptdest, $tsize, $hsrcdc, $tptsrce, $irgb, $tblend, $iflags)
  3716.     Local $aresult = DllCall("user32.dll", "bool", "UpdateLayeredWindow", "hwnd", $hwnd, "handle", $hdestdc, "struct*", $tptdest, "struct*", $tsize, "handle", $hsrcdc, "struct*", $tptsrce, "dword", $irgb, "struct*", $tblend, "dword", $iflags)
  3717.     If @error Then Return SetError(@error, @extended, False)
  3718.     Return $aresult[0]
  3719. EndFunc
  3720.  
  3721. Func _winapi_updatewindow($hwnd)
  3722.     Local $aresult = DllCall("user32.dll", "bool", "UpdateWindow", "hwnd", $hwnd)
  3723.     If @error Then Return SetError(@error, @extended, False)
  3724.     Return $aresult[0]
  3725. EndFunc
  3726.  
  3727. Func _winapi_waitforinputidle($hprocess, $itimeout = -1)
  3728.     Local $aresult = DllCall("user32.dll", "dword", "WaitForInputIdle", "handle", $hprocess, "dword", $itimeout)
  3729.     If @error Then Return SetError(@error, @extended, False)
  3730.     Return $aresult[0]
  3731. EndFunc
  3732.  
  3733. Func _winapi_waitformultipleobjects($icount, $pahandles, $bwaitall = False, $itimeout = -1)
  3734.     Local $aresult = DllCall("kernel32.dll", "INT", "WaitForMultipleObjects", "dword", $icount, "struct*", $pahandles, "bool", $bwaitall, "dword", $itimeout)
  3735.     If @error Then Return SetError(@error, @extended, -1)
  3736.     Return $aresult[0]
  3737. EndFunc
  3738.  
  3739. Func _winapi_waitforsingleobject($hhandle, $itimeout = -1)
  3740.     Local $aresult = DllCall("kernel32.dll", "INT", "WaitForSingleObject", "handle", $hhandle, "dword", $itimeout)
  3741.     If @error Then Return SetError(@error, @extended, -1)
  3742.     Return $aresult[0]
  3743. EndFunc
  3744.  
  3745. Func _winapi_widechartomultibyte($vunicode, $icodepage = 0, $bretstring = True)
  3746.     Local $sunicodetype = "wstr"
  3747.     If NOT IsString($vunicode) Then $sunicodetype = "struct*"
  3748.     Local $aresult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "uint", $icodepage, "dword", 0, $sunicodetype, $vunicode, "int", -1, "ptr", 0, "int", 0, "ptr", 0, "ptr", 0)
  3749.     If @error OR NOT $aresult[0] Then Return SetError(@error + 20, @extended, "")
  3750.     Local $tmultibyte = DllStructCreate("char[" & $aresult[0] & "]")
  3751.     $aresult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "uint", $icodepage, "dword", 0, $sunicodetype, $vunicode, "int", -1, "struct*", $tmultibyte, "int", $aresult[0], "ptr", 0, "ptr", 0)
  3752.     If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, "")
  3753.     If $bretstring Then Return DllStructGetData($tmultibyte, 1)
  3754.     Return $tmultibyte
  3755. EndFunc
  3756.  
  3757. Func _winapi_windowfrompoint(ByRef $tpoint)
  3758.     Local $aresult = DllCall("user32.dll", "hwnd", "WindowFromPoint", "struct", $tpoint)
  3759.     If @error Then Return SetError(@error, @extended, 0)
  3760.     Return $aresult[0]
  3761. EndFunc
  3762.  
  3763. Func _winapi_writeconsole($hconsole, $stext)
  3764.     Local $aresult = DllCall("kernel32.dll", "bool", "WriteConsoleW", "handle", $hconsole, "wstr", $stext, "dword", StringLen($stext), "dword*", 0, "ptr", 0)
  3765.     If @error Then Return SetError(@error, @extended, False)
  3766.     Return $aresult[0]
  3767. EndFunc
  3768.  
  3769. Func _winapi_writefile($hfile, $pbuffer, $itowrite, ByRef $iwritten, $toverlapped = 0)
  3770.     Local $aresult = DllCall("kernel32.dll", "bool", "WriteFile", "handle", $hfile, "struct*", $pbuffer, "dword", $itowrite, "dword*", 0, "struct*", $toverlapped)
  3771.     If @error Then Return SetError(@error, @extended, False)
  3772.     $iwritten = $aresult[4]
  3773.     Return $aresult[0]
  3774. EndFunc
  3775.  
  3776. Func _winapi_writeprocessmemory($hprocess, $pbaseaddress, $pbuffer, $isize, ByRef $iwritten, $sbuffer = "ptr")
  3777.     Local $aresult = DllCall("kernel32.dll", "bool", "WriteProcessMemory", "handle", $hprocess, "ptr", $pbaseaddress, $sbuffer, $pbuffer, "ulong_ptr", $isize, "ulong_ptr*", 0)
  3778.     If @error Then Return SetError(@error, @extended, False)
  3779.     $iwritten = $aresult[5]
  3780.     Return $aresult[0]
  3781. EndFunc
  3782.  
  3783. Global Const $_udf_globalids_offset = 2
  3784. Global Const $_udf_globalid_max_win = 16
  3785. Global Const $_udf_startid = 10000
  3786. Global Const $_udf_globalid_max_ids = 55535
  3787. Global Const $__udfguiconstant_ws_tabstop = 65536
  3788. Global Const $__udfguiconstant_ws_visible = 268435456
  3789. Global Const $__udfguiconstant_ws_child = 1073741824
  3790. Global $__g_audf_globalids_used[$_udf_globalid_max_win][$_udf_globalid_max_ids + $_udf_globalids_offset + 1]
  3791.  
  3792. Func __udf_getnextglobalid($hwnd)
  3793.     Local $nctrlid, $iusedindex = -1, $ballused = True
  3794.     If NOT WinExists($hwnd) Then Return SetError(-1, -1, 0)
  3795.     For $iindex = 0 To $_udf_globalid_max_win - 1
  3796.         If $__g_audf_globalids_used[$iindex][0] <> 0 Then
  3797.             If NOT WinExists($__g_audf_globalids_used[$iindex][0]) Then
  3798.                 For $x = 0 To UBound($__g_audf_globalids_used, $ubound_columns) - 1
  3799.                     $__g_audf_globalids_used[$iindex][$x] = 0
  3800.                 Next
  3801.                 $__g_audf_globalids_used[$iindex][1] = $_udf_startid
  3802.                 $ballused = False
  3803.             EndIf
  3804.         EndIf
  3805.     Next
  3806.     For $iindex = 0 To $_udf_globalid_max_win - 1
  3807.         If $__g_audf_globalids_used[$iindex][0] = $hwnd Then
  3808.             $iusedindex = $iindex
  3809.             ExitLoop
  3810.         EndIf
  3811.     Next
  3812.     If $iusedindex = -1 Then
  3813.         For $iindex = 0 To $_udf_globalid_max_win - 1
  3814.             If $__g_audf_globalids_used[$iindex][0] = 0 Then
  3815.                 $__g_audf_globalids_used[$iindex][0] = $hwnd
  3816.                 $__g_audf_globalids_used[$iindex][1] = $_udf_startid
  3817.                 $ballused = False
  3818.                 $iusedindex = $iindex
  3819.                 ExitLoop
  3820.             EndIf
  3821.         Next
  3822.     EndIf
  3823.     If $iusedindex = -1 AND $ballused Then Return SetError(16, 0, 0)
  3824.     If $__g_audf_globalids_used[$iusedindex][1] = $_udf_startid + $_udf_globalid_max_ids Then
  3825.         For $iidindex = $_udf_globalids_offset To UBound($__g_audf_globalids_used, $ubound_columns) - 1
  3826.             If $__g_audf_globalids_used[$iusedindex][$iidindex] = 0 Then
  3827.                 $nctrlid = ($iidindex - $_udf_globalids_offset) + 10000
  3828.                 $__g_audf_globalids_used[$iusedindex][$iidindex] = $nctrlid
  3829.                 Return $nctrlid
  3830.             EndIf
  3831.         Next
  3832.         Return SetError(-1, $_udf_globalid_max_ids, 0)
  3833.     EndIf
  3834.     $nctrlid = $__g_audf_globalids_used[$iusedindex][1]
  3835.     $__g_audf_globalids_used[$iusedindex][1] += 1
  3836.     $__g_audf_globalids_used[$iusedindex][($nctrlid - 10000) + $_udf_globalids_offset] = $nctrlid
  3837.     Return $nctrlid
  3838. EndFunc
  3839.  
  3840. Func __udf_freeglobalid($hwnd, $iglobalid)
  3841.     If $iglobalid - $_udf_startid < 0 OR $iglobalid - $_udf_startid > $_udf_globalid_max_ids Then Return SetError(-1, 0, False)
  3842.     For $iindex = 0 To $_udf_globalid_max_win - 1
  3843.         If $__g_audf_globalids_used[$iindex][0] = $hwnd Then
  3844.             For $x = $_udf_globalids_offset To UBound($__g_audf_globalids_used, $ubound_columns) - 1
  3845.                 If $__g_audf_globalids_used[$iindex][$x] = $iglobalid Then
  3846.                     $__g_audf_globalids_used[$iindex][$x] = 0
  3847.                     Return True
  3848.                 EndIf
  3849.             Next
  3850.             Return SetError(-3, 0, False)
  3851.         EndIf
  3852.     Next
  3853.     Return SetError(-2, 0, False)
  3854. EndFunc
  3855.  
  3856. Global $__g_hbuttonlastwnd
  3857. Global Const $tagbutton_imagelist = "ptr ImageList;" & $tagrect & ";uint Align"
  3858. Global Const $tagbutton_splitinfo = "uint mask;handle himlGlyph;uint uSplitStyle;" & $tagsize
  3859. Global Const $__buttonconstant_classname = "Button"
  3860. Global Const $__buttonconstant_gwl_style = -16
  3861. Global Const $__buttonconstant_wm_setfont = 48
  3862. Global Const $__buttonconstant_default_gui_font = 17
  3863.  
  3864. Func _guictrlbutton_click($hwnd)
  3865.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3866.     _sendmessage($hwnd, $bm_click)
  3867. EndFunc
  3868.  
  3869. Func _guictrlbutton_create($hwnd, $stext, $ix, $iy, $iwidth, $iheight, $istyle = -1, $iexstyle = -1)
  3870.     If NOT IsHWnd($hwnd) Then
  3871.         Return SetError(1, 0, 0)
  3872.     EndIf
  3873.     If NOT IsString($stext) Then
  3874.         Return SetError(2, 0, 0)
  3875.     EndIf
  3876.     Local $iforcedstyle = BitOR($__udfguiconstant_ws_tabstop, $__udfguiconstant_ws_visible, $__udfguiconstant_ws_child, $bs_notify)
  3877.     If $istyle = -1 Then
  3878.         $istyle = $iforcedstyle
  3879.     Else
  3880.         $istyle = BitOR($istyle, $iforcedstyle)
  3881.     EndIf
  3882.     If $iexstyle = -1 Then $iexstyle = 0
  3883.     Local $nctrlid = __udf_getnextglobalid($hwnd)
  3884.     If @error Then Return SetError(@error, @extended, 0)
  3885.     Local $hbutton = _winapi_createwindowex($iexstyle, $__buttonconstant_classname, $stext, $istyle, $ix, $iy, $iwidth, $iheight, $hwnd, $nctrlid)
  3886.     _sendmessage($hbutton, $__buttonconstant_wm_setfont, _winapi_getstockobject($__buttonconstant_default_gui_font), True)
  3887.     Return $hbutton
  3888. EndFunc
  3889.  
  3890. Func _guictrlbutton_destroy(ByRef $hwnd)
  3891.     If NOT _winapi_isclassname($hwnd, $__buttonconstant_classname) Then Return SetError(2, 2, False)
  3892.     Local $idestroyed = 0
  3893.     If IsHWnd($hwnd) Then
  3894.         If _winapi_inprocess($hwnd, $__g_hbuttonlastwnd) Then
  3895.             Local $nctrlid = _winapi_getdlgctrlid($hwnd)
  3896.             Local $hparent = _winapi_getparent($hwnd)
  3897.             $idestroyed = _winapi_destroywindow($hwnd)
  3898.             Local $iret = __udf_freeglobalid($hparent, $nctrlid)
  3899.             If NOT $iret Then
  3900.             EndIf
  3901.         Else
  3902.             Return SetError(1, 1, False)
  3903.         EndIf
  3904.     Else
  3905.         $idestroyed = GUICtrlDelete($hwnd)
  3906.     EndIf
  3907.     If $idestroyed Then $hwnd = 0
  3908.     Return $idestroyed <> 0
  3909. EndFunc
  3910.  
  3911. Func _guictrlbutton_enable($hwnd, $benable = True)
  3912.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3913.     If _winapi_isclassname($hwnd, $__buttonconstant_classname) Then Return _winapi_enablewindow($hwnd, $benable) = $benable
  3914. EndFunc
  3915.  
  3916. Func _guictrlbutton_getcheck($hwnd)
  3917.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3918.     Return _sendmessage($hwnd, $bm_getcheck)
  3919. EndFunc
  3920.  
  3921. Func _guictrlbutton_getfocus($hwnd)
  3922.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3923.     If _winapi_isclassname($hwnd, $__buttonconstant_classname) Then Return _winapi_getfocus() = $hwnd
  3924. EndFunc
  3925.  
  3926. Func _guictrlbutton_getidealsize($hwnd)
  3927.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3928.     Local $tsize = DllStructCreate($tagsize), $asize[2]
  3929.     Local $iret = _sendmessage($hwnd, $bcm_getidealsize, 0, $tsize, 0, "wparam", "struct*")
  3930.     If NOT $iret Then Return SetError(-1, -1, $asize)
  3931.     $asize[0] = DllStructGetData($tsize, "X")
  3932.     $asize[1] = DllStructGetData($tsize, "Y")
  3933.     Return $asize
  3934. EndFunc
  3935.  
  3936. Func _guictrlbutton_getimage($hwnd)
  3937.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3938.     Local $iret = _sendmessage($hwnd, $bm_getimage, 0, 0, 0, "wparam", "lparam", "hwnd")
  3939.     If $iret <> 0 Then Return $iret
  3940.     $iret = _sendmessage($hwnd, $bm_getimage, 1, 0, 0, "wparam", "lparam", "hwnd")
  3941.     If $iret = 0 Then Return 0
  3942.     Return $iret
  3943. EndFunc
  3944.  
  3945. Func _guictrlbutton_getimagelist($hwnd)
  3946.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3947.     Local $tbutton_imagelist = DllStructCreate($tagbutton_imagelist), $aimagelist[6]
  3948.     If NOT _sendmessage($hwnd, $bcm_getimagelist, 0, $tbutton_imagelist, 0, "wparam", "struct*") Then Return SetError(-1, -1, $aimagelist)
  3949.     $aimagelist[0] = DllStructGetData($tbutton_imagelist, "ImageList")
  3950.     $aimagelist[1] = DllStructGetData($tbutton_imagelist, "Left")
  3951.     $aimagelist[2] = DllStructGetData($tbutton_imagelist, "Right")
  3952.     $aimagelist[3] = DllStructGetData($tbutton_imagelist, "Top")
  3953.     $aimagelist[4] = DllStructGetData($tbutton_imagelist, "Bottom")
  3954.     $aimagelist[5] = DllStructGetData($tbutton_imagelist, "Align")
  3955.     Return $aimagelist
  3956. EndFunc
  3957.  
  3958. Func _guictrlbutton_getnote($hwnd)
  3959.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3960.     Local $ilen = _guictrlbutton_getnotelength($hwnd) + 1
  3961.     Local $tnote = DllStructCreate("wchar Note[" & $ilen & "]")
  3962.     Local $tlen = DllStructCreate("dword")
  3963.     DllStructSetData($tlen, 1, $ilen)
  3964.     If NOT _sendmessage($hwnd, $bcm_getnote, $tlen, $tnote, 0, "struct*", "struct*") Then Return SetError(-1, 0, "")
  3965.     Return _winapi_widechartomultibyte($tnote)
  3966. EndFunc
  3967.  
  3968. Func _guictrlbutton_getnotelength($hwnd)
  3969.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3970.     Return _sendmessage($hwnd, $bcm_getnotelength)
  3971. EndFunc
  3972.  
  3973. Func _guictrlbutton_getsplitinfo($hwnd)
  3974.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3975.     Local $tsplitinfo = DllStructCreate($tagbutton_splitinfo), $ainfo[4]
  3976.     DllStructSetData($tsplitinfo, "mask", BitOR($bcsif_glyph, $bcsif_image, $bcsif_size, $bcsif_style))
  3977.     If NOT _sendmessage($hwnd, $bcm_getsplitinfo, 0, $tsplitinfo, 0, "wparam", "struct*") Then Return SetError(-1, 0, $ainfo)
  3978.     $ainfo[0] = DllStructGetData($tsplitinfo, "himlGlyph")
  3979.     $ainfo[1] = DllStructGetData($tsplitinfo, "uSplitStyle")
  3980.     $ainfo[2] = DllStructGetData($tsplitinfo, "X")
  3981.     $ainfo[3] = DllStructGetData($tsplitinfo, "Y")
  3982.     Return $ainfo
  3983. EndFunc
  3984.  
  3985. Func _guictrlbutton_getstate($hwnd)
  3986.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3987.     Return _sendmessage($hwnd, $bm_getstate)
  3988. EndFunc
  3989.  
  3990. Func _guictrlbutton_gettext($hwnd)
  3991.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3992.     If _winapi_isclassname($hwnd, $__buttonconstant_classname) Then Return _winapi_getwindowtext($hwnd)
  3993.     Return ""
  3994. EndFunc
  3995.  
  3996. Func _guictrlbutton_gettextmargin($hwnd)
  3997.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  3998.     Local $trect = DllStructCreate($tagrect), $arect[4]
  3999.     If NOT _sendmessage($hwnd, $bcm_gettextmargin, 0, $trect, 0, "wparam", "struct*") Then Return SetError(-1, -1, $arect)
  4000.     $arect[0] = DllStructGetData($trect, "Left")
  4001.     $arect[1] = DllStructGetData($trect, "Top")
  4002.     $arect[2] = DllStructGetData($trect, "Right")
  4003.     $arect[3] = DllStructGetData($trect, "Bottom")
  4004.     Return $arect
  4005. EndFunc
  4006.  
  4007. Func _guictrlbutton_setcheck($hwnd, $istate = $bst_checked)
  4008.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4009.     _sendmessage($hwnd, $bm_setcheck, $istate)
  4010. EndFunc
  4011.  
  4012. Func _guictrlbutton_setdontclick($hwnd, $bstate = True)
  4013.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4014.     _sendmessage($hwnd, $bm_setdontclick, $bstate)
  4015. EndFunc
  4016.  
  4017. Func _guictrlbutton_setdropdownstate($hwnd, $bstate = True)
  4018.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4019.     Return _sendmessage($hwnd, $bcm_setdropdownstate, $bstate) <> 0
  4020. EndFunc
  4021.  
  4022. Func _guictrlbutton_setfocus($hwnd, $bfocus = True)
  4023.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4024.     If _winapi_isclassname($hwnd, $__buttonconstant_classname) Then
  4025.         If $bfocus Then
  4026.             Return _winapi_setfocus($hwnd) <> 0
  4027.         Else
  4028.             Return _winapi_setfocus(_winapi_getparent($hwnd)) <> 0
  4029.         EndIf
  4030.     EndIf
  4031. EndFunc
  4032.  
  4033. Func _guictrlbutton_setimage($hwnd, $simagefile, $iiconid = -1, $blarge = False)
  4034.     Local $himage, $hprevimage
  4035.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4036.     If StringUpper(StringMid($simagefile, StringLen($simagefile) - 2)) = "BMP" Then
  4037.         If BitAND(_winapi_getwindowlong($hwnd, $__buttonconstant_gwl_style), $bs_bitmap) = $bs_bitmap Then
  4038.             $himage = _winapi_loadimage(0, $simagefile, 0, 0, 0, BitOR($lr_loadfromfile, $lr_createdibsection))
  4039.             If NOT $himage Then Return SetError(-1, -1, False)
  4040.             $hprevimage = _sendmessage($hwnd, $bm_setimage, 0, $himage)
  4041.             If $hprevimage Then
  4042.                 If NOT _winapi_deleteobject($hprevimage) Then _winapi_destroyicon($hprevimage)
  4043.             EndIf
  4044.             _winapi_updatewindow($hwnd)
  4045.             Return True
  4046.         EndIf
  4047.     Else
  4048.         If $iiconid = -1 Then
  4049.             $himage = _winapi_loadimage(0, $simagefile, 1, 0, 0, BitOR($lr_loadfromfile, $lr_createdibsection))
  4050.             If NOT $himage Then Return SetError(-1, -1, False)
  4051.             $hprevimage = _sendmessage($hwnd, $bm_setimage, 1, $himage)
  4052.             If $hprevimage Then
  4053.                 If NOT _winapi_deleteobject($hprevimage) Then _winapi_destroyicon($hprevimage)
  4054.             EndIf
  4055.             _winapi_updatewindow($hwnd)
  4056.             Return True
  4057.         Else
  4058.             Local $ticon = DllStructCreate("handle Handle")
  4059.             Local $iret
  4060.             If $blarge Then
  4061.                 $iret = _winapi_extracticonex($simagefile, $iiconid, $ticon, 0, 1)
  4062.             Else
  4063.                 $iret = _winapi_extracticonex($simagefile, $iiconid, 0, $ticon, 1)
  4064.             EndIf
  4065.             If NOT $iret Then Return SetError(-1, -1, False)
  4066.             $hprevimage = _sendmessage($hwnd, $bm_setimage, 1, DllStructGetData($ticon, "Handle"))
  4067.             If $hprevimage Then
  4068.                 If NOT _winapi_deleteobject($hprevimage) Then _winapi_destroyicon($hprevimage)
  4069.             EndIf
  4070.             _winapi_updatewindow($hwnd)
  4071.             Return True
  4072.         EndIf
  4073.     EndIf
  4074.     Return False
  4075. EndFunc
  4076.  
  4077. Func _guictrlbutton_setimagelist($hwnd, $himage, $ialign = 0, $ileft = 1, $itop = 1, $iright = 1, $ibottom = 1)
  4078.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4079.     If $ialign < 0 OR $ialign > 4 Then $ialign = 0
  4080.     Local $tbutton_imagelist = DllStructCreate($tagbutton_imagelist)
  4081.     DllStructSetData($tbutton_imagelist, "ImageList", $himage)
  4082.     DllStructSetData($tbutton_imagelist, "Left", $ileft)
  4083.     DllStructSetData($tbutton_imagelist, "Top", $itop)
  4084.     DllStructSetData($tbutton_imagelist, "Right", $iright)
  4085.     DllStructSetData($tbutton_imagelist, "Bottom", $ibottom)
  4086.     DllStructSetData($tbutton_imagelist, "Align", $ialign)
  4087.     Local $benabled = _guictrlbutton_enable($hwnd, False)
  4088.     Local $iret = _sendmessage($hwnd, $bcm_setimagelist, 0, $tbutton_imagelist, 0, "wparam", "struct*") <> 0
  4089.     _guictrlbutton_enable($hwnd)
  4090.     If NOT $benabled Then _guictrlbutton_enable($hwnd, False)
  4091.     Return $iret
  4092. EndFunc
  4093.  
  4094. Func _guictrlbutton_setnote($hwnd, $snote)
  4095.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4096.     Local $tnote = _winapi_multibytetowidechar($snote)
  4097.     Return _sendmessage($hwnd, $bcm_setnote, 0, $tnote, 0, "wparam", "struct*") <> 0
  4098. EndFunc
  4099.  
  4100. Func _guictrlbutton_setshield($hwnd, $brequired = True)
  4101.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4102.     Return _sendmessage($hwnd, $bcm_setshield, 0, $brequired) = 1
  4103. EndFunc
  4104.  
  4105. Func _guictrlbutton_setsize($hwnd, $iwidth, $iheight)
  4106.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4107.     If NOT _winapi_isclassname($hwnd, $__buttonconstant_classname) Then Return SetError(-1, -1, False)
  4108.     Local $hparent = _winapi_getparent($hwnd)
  4109.     If NOT $hparent Then Return SetError(-1, -1, False)
  4110.     Local $apos = WinGetPos($hwnd)
  4111.     If NOT IsArray($apos) Then Return SetError(-1, -1, False)
  4112.     Local $tpoint = DllStructCreate($tagpoint)
  4113.     DllStructSetData($tpoint, "X", $apos[0])
  4114.     DllStructSetData($tpoint, "Y", $apos[1])
  4115.     If NOT _winapi_screentoclient($hparent, $tpoint) Then Return SetError(-1, -1, False)
  4116.     Local $iret = WinMove($hwnd, "", DllStructGetData($tpoint, "X"), DllStructGetData($tpoint, "Y"), $iwidth, $iheight)
  4117.     Return SetError($iret - 1, $iret - 1, $iret <> 0)
  4118. EndFunc
  4119.  
  4120. Func _guictrlbutton_setsplitinfo($hwnd, $himlglyph = -1, $isplitstyle = $bcss_alignleft, $iwidth = 0, $iheight = 0)
  4121.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4122.     Local $tsplitinfo = DllStructCreate($tagbutton_splitinfo), $imask = 0
  4123.     If $himlglyph <> -1 Then
  4124.         $imask = BitOR($imask, $bcsif_glyph)
  4125.         DllStructSetData($tsplitinfo, "himlGlyph", $himlglyph)
  4126.     EndIf
  4127.     $imask = BitOR($imask, $bcsif_style)
  4128.     If BitAND($isplitstyle, $bcss_image) = $bcss_image Then $imask = BitOR($imask, $bcsif_image)
  4129.     DllStructSetData($tsplitinfo, "uSplitStyle", $isplitstyle)
  4130.     If $iwidth > 0 OR $iheight > 0 Then
  4131.         $imask = BitOR($imask, $bcsif_size)
  4132.         DllStructSetData($tsplitinfo, "X", $iwidth)
  4133.         DllStructSetData($tsplitinfo, "Y", $iheight)
  4134.     EndIf
  4135.     DllStructSetData($tsplitinfo, "mask", $imask)
  4136.     Return _sendmessage($hwnd, $bcm_setsplitinfo, 0, $tsplitinfo, 0, "wparam", "struct*") <> 0
  4137. EndFunc
  4138.  
  4139. Func _guictrlbutton_setstate($hwnd, $bhighlighted = True)
  4140.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4141.     _sendmessage($hwnd, $bm_setstate, $bhighlighted)
  4142. EndFunc
  4143.  
  4144. Func _guictrlbutton_setstyle($hwnd, $istyle)
  4145.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4146.     _sendmessage($hwnd, $bm_setstyle, $istyle, True)
  4147.     _winapi_updatewindow($hwnd)
  4148. EndFunc
  4149.  
  4150. Func _guictrlbutton_settext($hwnd, $stext)
  4151.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4152.     If _winapi_isclassname($hwnd, $__buttonconstant_classname) Then Return _winapi_setwindowtext($hwnd, $stext)
  4153. EndFunc
  4154.  
  4155. Func _guictrlbutton_settextmargin($hwnd, $ileft = 1, $itop = 1, $iright = 1, $ibottom = 1)
  4156.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4157.     Local $trect = DllStructCreate($tagrect)
  4158.     DllStructSetData($trect, "Left", $ileft)
  4159.     DllStructSetData($trect, "Top", $itop)
  4160.     DllStructSetData($trect, "Right", $iright)
  4161.     DllStructSetData($trect, "Bottom", $ibottom)
  4162.     Return _sendmessage($hwnd, $bcm_settextmargin, 0, $trect, 0, "wparam", "struct*") <> 0
  4163. EndFunc
  4164.  
  4165. Func _guictrlbutton_show($hwnd, $bshow = True)
  4166.     If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
  4167.     If _winapi_isclassname($hwnd, $__buttonconstant_classname) Then
  4168.         If $bshow Then
  4169.             Return _winapi_showwindow($hwnd, @SW_SHOW)
  4170.         Else
  4171.             Return _winapi_showwindow($hwnd, @SW_HIDE)
  4172.         EndIf
  4173.     EndIf
  4174. EndFunc
  4175.  
  4176. Global Const $es_left = 0
  4177. Global Const $es_center = 1
  4178. Global Const $es_right = 2
  4179. Global Const $es_multiline = 4
  4180. Global Const $es_uppercase = 8
  4181. Global Const $es_lowercase = 16
  4182. Global Const $es_password = 32
  4183. Global Const $es_autovscroll = 64
  4184. Global Const $es_autohscroll = 128
  4185. Global Const $es_nohidesel = 256
  4186. Global Const $es_oemconvert = 1024
  4187. Global Const $es_readonly = 2048
  4188. Global Const $es_wantreturn = 4096
  4189. Global Const $es_number = 8192
  4190. Global Const $ec_err = -1
  4191. Global Const $ecm_first = 5376
  4192. Global Const $em_canundo = 198
  4193. Global Const $em_charfrompos = 215
  4194. Global Const $em_emptyundobuffer = 205
  4195. Global Const $em_fmtlines = 200
  4196. Global Const $em_getcuebanner = ($ecm_first + 2)
  4197. Global Const $em_getfirstvisibleline = 206
  4198. Global Const $em_gethandle = 189
  4199. Global Const $em_getimestatus = 217
  4200. Global Const $em_getlimittext = 213
  4201. Global Const $em_getline = 196
  4202. Global Const $em_getlinecount = 186
  4203. Global Const $em_getmargins = 212
  4204. Global Const $em_getmodify = 184
  4205. Global Const $em_getpasswordchar = 210
  4206. Global Const $em_getrect = 178
  4207. Global Const $em_getsel = 176
  4208. Global Const $em_getthumb = 190
  4209. Global Const $em_getwordbreakproc = 209
  4210. Global Const $em_hideballoontip = ($ecm_first + 4)
  4211. Global Const $em_limittext = 197
  4212. Global Const $em_linefromchar = 201
  4213. Global Const $em_lineindex = 187
  4214. Global Const $em_linelength = 193
  4215. Global Const $em_linescroll = 182
  4216. Global Const $em_posfromchar = 214
  4217. Global Const $em_replacesel = 194
  4218. Global Const $em_scroll = 181
  4219. Global Const $em_scrollcaret = 183
  4220. Global Const $em_setcuebanner = ($ecm_first + 1)
  4221. Global Const $em_sethandle = 188
  4222. Global Const $em_setimestatus = 216
  4223. Global Const $em_setlimittext = $em_limittext
  4224. Global Const $em_setmargins = 211
  4225. Global Const $em_setmodify = 185
  4226. Global Const $em_setpasswordchar = 204
  4227. Global Const $em_setreadonly = 207
  4228. Global Const $em_setrect = 179
  4229. Global Const $em_setrectnp = 180
  4230. Global Const $em_setsel = 177
  4231. Global Const $em_settabstops = 203
  4232. Global Const $em_setwordbreakproc = 208
  4233. Global Const $em_showballoontip = ($ecm_first + 3)
  4234. Global Const $em_undo = 199
  4235. Global Const $ec_leftmargin = 1
  4236. Global Const $ec_rightmargin = 2
  4237. Global Const $ec_usefontinfo = 65535
  4238. Global Const $emsis_compositionstring = 1
  4239. Global Const $eimes_getcompstratonce = 1
  4240. Global Const $eimes_cancelcompstrinfocus = 2
  4241. Global Const $eimes_completecompstrkillfocus = 4
  4242. Global Const $en_align_ltr_ec = 1792
  4243. Global Const $en_align_rtl_ec = 1793
  4244. Global Const $en_change = 768
  4245. Global Const $en_errspace = 1280
  4246. Global Const $en_hscroll = 1537
  4247. Global Const $en_killfocus = 512
  4248. Global Const $en_maxtext = 1281
  4249. Global Const $en_setfocus = 256
  4250. Global Const $en_update = 1024
  4251. Global Const $en_vscroll = 1538
  4252. Global Const $gui_ss_default_edit = 3150016
  4253. Global Const $gui_ss_default_input = 128
  4254. $form1 = GUICreate("GET FILE INDEX", 339, 38, -1, -1, -1, -1)
  4255. GUISetBkColor(0, $form1)
  4256. GUICtrlSetBkColor(-1, 0)
  4257. GUICtrlSetColor($form1, 43520)
  4258. GUICtrlSetCursor(-1, 0)
  4259. $button1 = GUICtrlCreateButton("DOWNLOAD", 231, 10, 100, 23, -1, -1)
  4260. GUICtrlSetBkColor(-1, 0)
  4261. GUICtrlSetColor($button1, 43520)
  4262. GUICtrlSetCursor(-1, 0)
  4263. $input1 = GUICtrlCreateInput("Nhập Link Index Vào Đây(Hiệp Khách Du Hành)", 11, 10, 211, 23, $es_center, $ws_ex_clientedge)
  4264. GUICtrlSetBkColor(-1, 0)
  4265. GUICtrlSetColor($input1, 43520)
  4266. GUICtrlSetCursor(-1, 0)
  4267. GUISetState(@SW_SHOW)
  4268. While 1
  4269.     $nmsg = GUIGetMsg()
  4270.     Switch $nmsg
  4271.         Case $gui_event_close
  4272.             Exit
  4273.         Case $button1
  4274.             $slink = GUICtrlRead($input1)
  4275.             Global $sget = httpget($slink)
  4276.             FileWrite("index.html", $sget)
  4277.             $result = MsgBox(64, "Thông Báo", "Ok Index Save Thành Công", 0)
  4278.     EndSwitch
  4279. WEnd
Advertisement
Add Comment
Please, Sign In to add comment