Advertisement
KiLLerBoy_001

Lagtool Enhanced Source

Jun 22nd, 2018
1,097
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 149.45 KB | None | 0 0
  1. #RequireAdmin
  2. Global Const $gui_event_close = -3
  3. Global Const $gui_event_minimize = -4
  4. Global Const $gui_event_restore = -5
  5. Global Const $gui_event_maximize = -6
  6. Global Const $gui_event_primarydown = -7
  7. Global Const $gui_event_primaryup = -8
  8. Global Const $gui_event_secondarydown = -9
  9. Global Const $gui_event_secondaryup = -10
  10. Global Const $gui_event_mousemove = -11
  11. Global Const $gui_event_resized = -12
  12. Global Const $gui_event_dropped = -13
  13. Global Const $gui_rundefmsg = "GUI_RUNDEFMSG"
  14. Global Const $gui_avistop = 0
  15. Global Const $gui_avistart = 1
  16. Global Const $gui_aviclose = 2
  17. Global Const $gui_checked = 1
  18. Global Const $gui_indeterminate = 2
  19. Global Const $gui_unchecked = 4
  20. Global Const $gui_dropaccepted = 8
  21. Global Const $gui_nodropaccepted = 4096
  22. Global Const $gui_acceptfiles = $gui_dropaccepted
  23. Global Const $gui_show = 16
  24. Global Const $gui_hide = 32
  25. Global Const $gui_enable = 64
  26. Global Const $gui_disable = 128
  27. Global Const $gui_focus = 256
  28. Global Const $gui_nofocus = 8192
  29. Global Const $gui_defbutton = 512
  30. Global Const $gui_expand = 1024
  31. Global Const $gui_ontop = 2048
  32. Global Const $gui_fontitalic = 2
  33. Global Const $gui_fontunder = 4
  34. Global Const $gui_fontstrike = 8
  35. Global Const $gui_dockauto = 1
  36. Global Const $gui_dockleft = 2
  37. Global Const $gui_dockright = 4
  38. Global Const $gui_dockhcenter = 8
  39. Global Const $gui_docktop = 32
  40. Global Const $gui_dockbottom = 64
  41. Global Const $gui_dockvcenter = 128
  42. Global Const $gui_dockwidth = 256
  43. Global Const $gui_dockheight = 512
  44. Global Const $gui_docksize = 768
  45. Global Const $gui_dockmenubar = 544
  46. Global Const $gui_dockstatebar = 576
  47. Global Const $gui_dockall = 802
  48. Global Const $gui_dockborders = 102
  49. Global Const $gui_gr_close = 1
  50. Global Const $gui_gr_line = 2
  51. Global Const $gui_gr_bezier = 4
  52. Global Const $gui_gr_move = 6
  53. Global Const $gui_gr_color = 8
  54. Global Const $gui_gr_rect = 10
  55. Global Const $gui_gr_ellipse = 12
  56. Global Const $gui_gr_pie = 14
  57. Global Const $gui_gr_dot = 16
  58. Global Const $gui_gr_pixel = 18
  59. Global Const $gui_gr_hint = 20
  60. Global Const $gui_gr_refresh = 22
  61. Global Const $gui_gr_pensize = 24
  62. Global Const $gui_gr_nobkcolor = -2
  63. Global Const $gui_bkcolor_default = -1
  64. Global Const $gui_bkcolor_transparent = -2
  65. Global Const $gui_bkcolor_lv_alternate = -33554432
  66. Global Const $gui_ws_ex_parentdrag = 1048576
  67. Global Const $ws_tiled = 0
  68. Global Const $ws_overlapped = 0
  69. Global Const $ws_maximizebox = 65536
  70. Global Const $ws_minimizebox = 131072
  71. Global Const $ws_tabstop = 65536
  72. Global Const $ws_group = 131072
  73. Global Const $ws_sizebox = 262144
  74. Global Const $ws_thickframe = 262144
  75. Global Const $ws_sysmenu = 524288
  76. Global Const $ws_hscroll = 1048576
  77. Global Const $ws_vscroll = 2097152
  78. Global Const $ws_dlgframe = 4194304
  79. Global Const $ws_border = 8388608
  80. Global Const $ws_caption = 12582912
  81. Global Const $ws_overlappedwindow = 13565952
  82. Global Const $ws_tiledwindow = 13565952
  83. Global Const $ws_maximize = 16777216
  84. Global Const $ws_clipchildren = 33554432
  85. Global Const $ws_clipsiblings = 67108864
  86. Global Const $ws_disabled = 134217728
  87. Global Const $ws_visible = 268435456
  88. Global Const $ws_minimize = 536870912
  89. Global Const $ws_child = 1073741824
  90. Global Const $ws_popup = -2147483648
  91. Global Const $ws_popupwindow = -2138570752
  92. Global Const $ds_modalframe = 128
  93. Global Const $ds_setforeground = 512
  94. Global Const $ds_contexthelp = 8192
  95. Global Const $ws_ex_acceptfiles = 16
  96. Global Const $ws_ex_mdichild = 64
  97. Global Const $ws_ex_appwindow = 262144
  98. Global Const $ws_ex_composited = 33554432
  99. Global Const $ws_ex_clientedge = 512
  100. Global Const $ws_ex_contexthelp = 1024
  101. Global Const $ws_ex_dlgmodalframe = 1
  102. Global Const $ws_ex_leftscrollbar = 16384
  103. Global Const $ws_ex_overlappedwindow = 768
  104. Global Const $ws_ex_right = 4096
  105. Global Const $ws_ex_staticedge = 131072
  106. Global Const $ws_ex_toolwindow = 128
  107. Global Const $ws_ex_topmost = 8
  108. Global Const $ws_ex_transparent = 32
  109. Global Const $ws_ex_windowedge = 256
  110. Global Const $ws_ex_layered = 524288
  111. Global Const $ws_ex_controlparent = 65536
  112. Global Const $ws_ex_layoutrtl = 4194304
  113. Global Const $ws_ex_rtlreading = 8192
  114. Global Const $wm_gettextlength = 14
  115. Global Const $wm_gettext = 13
  116. Global Const $wm_size = 5
  117. Global Const $wm_sizing = 532
  118. Global Const $wm_user = 1024
  119. Global Const $wm_create = 1
  120. Global Const $wm_destroy = 2
  121. Global Const $wm_move = 3
  122. Global Const $wm_activate = 6
  123. Global Const $wm_setfocus = 7
  124. Global Const $wm_killfocus = 8
  125. Global Const $wm_enable = 10
  126. Global Const $wm_setredraw = 11
  127. Global Const $wm_settext = 12
  128. Global Const $wm_paint = 15
  129. Global Const $wm_close = 16
  130. Global Const $wm_quit = 18
  131. Global Const $wm_erasebkgnd = 20
  132. Global Const $wm_syscolorchange = 21
  133. Global Const $wm_showwindow = 24
  134. Global Const $wm_wininichange = 26
  135. Global Const $wm_devmodechange = 27
  136. Global Const $wm_activateapp = 28
  137. Global Const $wm_fontchange = 29
  138. Global Const $wm_timechange = 30
  139. Global Const $wm_cancelmode = 31
  140. Global Const $wm_setcursor = 32
  141. Global Const $wm_mouseactivate = 33
  142. Global Const $wm_childactivate = 34
  143. Global Const $wm_queuesync = 35
  144. Global Const $wm_getminmaxinfo = 36
  145. Global Const $wm_painticon = 38
  146. Global Const $wm_iconerasebkgnd = 39
  147. Global Const $wm_nextdlgctl = 40
  148. Global Const $wm_spoolerstatus = 42
  149. Global Const $wm_drawitem = 43
  150. Global Const $wm_measureitem = 44
  151. Global Const $wm_deleteitem = 45
  152. Global Const $wm_vkeytoitem = 46
  153. Global Const $wm_chartoitem = 47
  154. Global Const $wm_setfont = 48
  155. Global Const $wm_getfont = 49
  156. Global Const $wm_sethotkey = 50
  157. Global Const $wm_gethotkey = 51
  158. Global Const $wm_querydragicon = 55
  159. Global Const $wm_compareitem = 57
  160. Global Const $wm_getobject = 61
  161. Global Const $wm_compacting = 65
  162. Global Const $wm_commnotify = 68
  163. Global Const $wm_windowposchanging = 70
  164. Global Const $wm_windowposchanged = 71
  165. Global Const $wm_power = 72
  166. Global Const $wm_notify = 78
  167. Global Const $wm_copydata = 74
  168. Global Const $wm_canceljournal = 75
  169. Global Const $wm_inputlangchangerequest = 80
  170. Global Const $wm_inputlangchange = 81
  171. Global Const $wm_tcard = 82
  172. Global Const $wm_help = 83
  173. Global Const $wm_userchanged = 84
  174. Global Const $wm_notifyformat = 85
  175. Global Const $wm_cut = 768
  176. Global Const $wm_copy = 769
  177. Global Const $wm_paste = 770
  178. Global Const $wm_clear = 771
  179. Global Const $wm_undo = 772
  180. Global Const $wm_contextmenu = 123
  181. Global Const $wm_stylechanging = 124
  182. Global Const $wm_stylechanged = 125
  183. Global Const $wm_displaychange = 126
  184. Global Const $wm_geticon = 127
  185. Global Const $wm_seticon = 128
  186. Global Const $wm_nccreate = 129
  187. Global Const $wm_ncdestroy = 130
  188. Global Const $wm_nccalcsize = 131
  189. Global Const $wm_nchittest = 132
  190. Global Const $wm_ncpaint = 133
  191. Global Const $wm_ncactivate = 134
  192. Global Const $wm_getdlgcode = 135
  193. Global Const $wm_syncpaint = 136
  194. Global Const $wm_ncmousemove = 160
  195. Global Const $wm_nclbuttondown = 161
  196. Global Const $wm_nclbuttonup = 162
  197. Global Const $wm_nclbuttondblclk = 163
  198. Global Const $wm_ncrbuttondown = 164
  199. Global Const $wm_ncrbuttonup = 165
  200. Global Const $wm_ncrbuttondblclk = 166
  201. Global Const $wm_ncmbuttondown = 167
  202. Global Const $wm_ncmbuttonup = 168
  203. Global Const $wm_ncmbuttondblclk = 169
  204. Global Const $wm_keydown = 256
  205. Global Const $wm_keyup = 257
  206. Global Const $wm_char = 258
  207. Global Const $wm_deadchar = 259
  208. Global Const $wm_syskeydown = 260
  209. Global Const $wm_syskeyup = 261
  210. Global Const $wm_syschar = 262
  211. Global Const $wm_sysdeadchar = 263
  212. Global Const $wm_initdialog = 272
  213. Global Const $wm_command = 273
  214. Global Const $wm_syscommand = 274
  215. Global Const $wm_timer = 275
  216. Global Const $wm_hscroll = 276
  217. Global Const $wm_vscroll = 277
  218. Global Const $wm_initmenu = 278
  219. Global Const $wm_initmenupopup = 279
  220. Global Const $wm_menuselect = 287
  221. Global Const $wm_menuchar = 288
  222. Global Const $wm_enteridle = 289
  223. Global Const $wm_menurbuttonup = 290
  224. Global Const $wm_menudrag = 291
  225. Global Const $wm_menugetobject = 292
  226. Global Const $wm_uninitmenupopup = 293
  227. Global Const $wm_menucommand = 294
  228. Global Const $wm_changeuistate = 295
  229. Global Const $wm_updateuistate = 296
  230. Global Const $wm_queryuistate = 297
  231. Global Const $wm_ctlcolormsgbox = 306
  232. Global Const $wm_ctlcoloredit = 307
  233. Global Const $wm_ctlcolorlistbox = 308
  234. Global Const $wm_ctlcolorbtn = 309
  235. Global Const $wm_ctlcolordlg = 310
  236. Global Const $wm_ctlcolorscrollbar = 311
  237. Global Const $wm_ctlcolorstatic = 312
  238. Global Const $wm_ctlcolor = 25
  239. Global Const $mn_gethmenu = 481
  240. Global Const $nm_first = 0
  241. Global Const $nm_outofmemory = $nm_first - 1
  242. Global Const $nm_click = $nm_first - 2
  243. Global Const $nm_dblclk = $nm_first - 3
  244. Global Const $nm_return = $nm_first - 4
  245. Global Const $nm_rclick = $nm_first - 5
  246. Global Const $nm_rdblclk = $nm_first - 6
  247. Global Const $nm_setfocus = $nm_first - 7
  248. Global Const $nm_killfocus = $nm_first - 8
  249. Global Const $nm_customdraw = $nm_first - 12
  250. Global Const $nm_hover = $nm_first - 13
  251. Global Const $nm_nchittest = $nm_first - 14
  252. Global Const $nm_keydown = $nm_first - 15
  253. Global Const $nm_releasedcapture = $nm_first - 16
  254. Global Const $nm_setcursor = $nm_first - 17
  255. Global Const $nm_char = $nm_first - 18
  256. Global Const $nm_tooltipscreated = $nm_first - 19
  257. Global Const $nm_ldown = $nm_first - 20
  258. Global Const $nm_rdown = $nm_first - 21
  259. Global Const $nm_themechanged = $nm_first - 22
  260. Global Const $wm_mousemove = 512
  261. Global Const $wm_lbuttondown = 513
  262. Global Const $wm_lbuttonup = 514
  263. Global Const $wm_lbuttondblclk = 515
  264. Global Const $wm_rbuttondown = 516
  265. Global Const $wm_rbuttonup = 517
  266. Global Const $wm_rbuttondblck = 518
  267. Global Const $wm_mbuttondown = 519
  268. Global Const $wm_mbuttonup = 520
  269. Global Const $wm_mbuttondblck = 521
  270. Global Const $wm_mousewheel = 522
  271. Global Const $wm_xbuttondown = 523
  272. Global Const $wm_xbuttonup = 524
  273. Global Const $wm_xbuttondblclk = 525
  274. Global Const $wm_mousehwheel = 526
  275. Global Const $ps_solid = 0
  276. Global Const $ps_dash = 1
  277. Global Const $ps_dot = 2
  278. Global Const $ps_dashdot = 3
  279. Global Const $ps_dashdotdot = 4
  280. Global Const $ps_null = 5
  281. Global Const $ps_insideframe = 6
  282. Global Const $lwa_alpha = 2
  283. Global Const $lwa_colorkey = 1
  284. Global Const $rgn_and = 1
  285. Global Const $rgn_or = 2
  286. Global Const $rgn_xor = 3
  287. Global Const $rgn_diff = 4
  288. Global Const $rgn_copy = 5
  289. Global Const $errorregion = 0
  290. Global Const $nullregion = 1
  291. Global Const $simpleregion = 2
  292. Global Const $complexregion = 3
  293. Global Const $TotalTimeransparent = 1
  294. Global Const $opaque = 2
  295. Global Const $ccm_first = 8192
  296. Global Const $ccm_getunicodeformat = ($ccm_first + 6)
  297. Global Const $ccm_setunicodeformat = ($ccm_first + 5)
  298. Global Const $ccm_setbkcolor = $ccm_first + 1
  299. Global Const $ccm_setcolorscheme = $ccm_first + 2
  300. Global Const $ccm_getcolorscheme = $ccm_first + 3
  301. Global Const $ccm_getdroptarget = $ccm_first + 4
  302. Global Const $ccm_setwindowtheme = $ccm_first + 11
  303. Global Const $ga_parent = 1
  304. Global Const $ga_root = 2
  305. Global Const $ga_rootowner = 3
  306. Global Const $sm_cxscreen = 0
  307. Global Const $sm_cyscreen = 1
  308. Global Const $sm_cxvscroll = 2
  309. Global Const $sm_cyhscroll = 3
  310. Global Const $sm_cycaption = 4
  311. Global Const $sm_cxborder = 5
  312. Global Const $sm_cyborder = 6
  313. Global Const $sm_cxdlgframe = 7
  314. Global Const $sm_cydlgframe = 8
  315. Global Const $sm_cyvthumb = 9
  316. Global Const $sm_cxhthumb = 10
  317. Global Const $sm_cxicon = 11
  318. Global Const $sm_cyicon = 12
  319. Global Const $sm_cxcursor = 13
  320. Global Const $sm_cycursor = 14
  321. Global Const $sm_cymenu = 15
  322. Global Const $sm_cxfullscreen = 16
  323. Global Const $sm_cyfullscreen = 17
  324. Global Const $sm_cykanjiwindow = 18
  325. Global Const $sm_mousepresent = 19
  326. Global Const $sm_cyvscroll = 20
  327. Global Const $sm_cxhscroll = 21
  328. Global Const $sm_debug = 22
  329. Global Const $sm_swapbutton = 23
  330. Global Const $sm_reserved1 = 24
  331. Global Const $sm_reserved2 = 25
  332. Global Const $sm_reserved3 = 26
  333. Global Const $sm_reserved4 = 27
  334. Global Const $sm_cxmin = 28
  335. Global Const $sm_cymin = 29
  336. Global Const $sm_cxsize = 30
  337. Global Const $sm_cysize = 31
  338. Global Const $sm_cxframe = 32
  339. Global Const $sm_cyframe = 33
  340. Global Const $sm_cxmintrack = 34
  341. Global Const $sm_cymintrack = 35
  342. Global Const $sm_cxdoubleclk = 36
  343. Global Const $sm_cydoubleclk = 37
  344. Global Const $sm_cxiconspacing = 38
  345. Global Const $sm_cyiconspacing = 39
  346. Global Const $sm_menudropalignment = 40
  347. Global Const $sm_penwindows = 41
  348. Global Const $sm_dbcsenabled = 42
  349. Global Const $sm_cmousebuttons = 43
  350. Global Const $sm_secure = 44
  351. Global Const $sm_cxedge = 45
  352. Global Const $sm_cyedge = 46
  353. Global Const $sm_cxminspacing = 47
  354. Global Const $sm_cyminspacing = 48
  355. Global Const $sm_cxsmicon = 49
  356. Global Const $sm_cysmicon = 50
  357. Global Const $sm_cysmcaption = 51
  358. Global Const $sm_cxsmsize = 52
  359. Global Const $sm_cysmsize = 53
  360. Global Const $sm_cxmenusize = 54
  361. Global Const $sm_cymenusize = 55
  362. Global Const $sm_arrange = 56
  363. Global Const $sm_cxminimized = 57
  364. Global Const $sm_cyminimized = 58
  365. Global Const $sm_cxmaxtrack = 59
  366. Global Const $sm_cymaxtrack = 60
  367. Global Const $sm_cxmaximized = 61
  368. Global Const $sm_cymaximized = 62
  369. Global Const $sm_network = 63
  370. Global Const $sm_cleanboot = 67
  371. Global Const $sm_cxdrag = 68
  372. Global Const $sm_cydrag = 69
  373. Global Const $sm_showsounds = 70
  374. Global Const $sm_cxmenucheck = 71
  375. Global Const $sm_cymenucheck = 72
  376. Global Const $sm_slowmachine = 73
  377. Global Const $sm_mideastenabled = 74
  378. Global Const $sm_mousewheelpresent = 75
  379. Global Const $sm_xvirtualscreen = 76
  380. Global Const $sm_yvirtualscreen = 77
  381. Global Const $sm_cxvirtualscreen = 78
  382. Global Const $sm_cyvirtualscreen = 79
  383. Global Const $sm_cmonitors = 80
  384. Global Const $sm_samedisplayformat = 81
  385. Global Const $sm_immenabled = 82
  386. Global Const $sm_cxfocusborder = 83
  387. Global Const $sm_cyfocusborder = 84
  388. Global Const $sm_tabletpc = 86
  389. Global Const $sm_mediacenter = 87
  390. Global Const $sm_starter = 88
  391. Global Const $sm_serverr2 = 89
  392. Global Const $sm_cmetrics = 90
  393. Global Const $sm_remotesession = 4096
  394. Global Const $sm_shuttingdown = 8192
  395. Global Const $sm_remotecontrol = 8193
  396. Global Const $sm_caretblinkingenabled = 8194
  397. Global Const $blackness = 66
  398. Global Const $captureblt = 1073741824
  399. Global Const $dstinvert = 5570569
  400. Global Const $mergecopy = 12583114
  401. Global Const $mergepaint = 12255782
  402. Global Const $nomirrorbitmap = -2147483648
  403. Global Const $notsrccopy = 3342344
  404. Global Const $notsrcerase = 1114278
  405. Global Const $patcopy = 15728673
  406. Global Const $patinvert = 5898313
  407. Global Const $patpaint = 16452105
  408. Global Const $srcand = 8913094
  409. Global Const $srccopy = 13369376
  410. Global Const $srcerase = 4457256
  411. Global Const $srcinvert = 6684742
  412. Global Const $srcpaint = 15597702
  413. Global Const $whiteness = 16711778
  414. Global Const $dt_bottom = 8
  415. Global Const $dt_calcrect = 1024
  416. Global Const $dt_center = 1
  417. Global Const $dt_editcontrol = 8192
  418. Global Const $dt_end_ellipsis = 32768
  419. Global Const $dt_expandtabs = 64
  420. Global Const $dt_externalleading = 512
  421. Global Const $dt_hideprefix = 1048576
  422. Global Const $dt_internal = 4096
  423. Global Const $dt_left = 0
  424. Global Const $dt_modifystring = 65536
  425. Global Const $dt_noclip = 256
  426. Global Const $dt_nofullwidthcharbreak = 524288
  427. Global Const $dt_noprefix = 2048
  428. Global Const $dt_path_ellipsis = 16384
  429. Global Const $dt_prefixonly = 2097152
  430. Global Const $dt_right = 2
  431. Global Const $dt_rtlreading = 131072
  432. Global Const $dt_singleline = 32
  433. Global Const $dt_tabstop = 128
  434. Global Const $dt_top = 0
  435. Global Const $dt_vcenter = 4
  436. Global Const $dt_wordbreak = 16
  437. Global Const $dt_word_ellipsis = 262144
  438. Global Const $rdw_erase = 4
  439. Global Const $rdw_frame = 1024
  440. Global Const $rdw_internalpaint = 2
  441. Global Const $rdw_invalidate = 1
  442. Global Const $rdw_noerase = 32
  443. Global Const $rdw_noframe = 2048
  444. Global Const $rdw_nointernalpaint = 16
  445. Global Const $rdw_validate = 8
  446. Global Const $rdw_erasenow = 512
  447. Global Const $rdw_updatenow = 256
  448. Global Const $rdw_allchildren = 128
  449. Global Const $rdw_nochildren = 64
  450. Global Const $wm_renderformat = 773
  451. Global Const $wm_renderallformats = 774
  452. Global Const $wm_destroyclipboard = 775
  453. Global Const $wm_drawclipboard = 776
  454. Global Const $wm_paintclipboard = 777
  455. Global Const $wm_vscrollclipboard = 778
  456. Global Const $wm_sizeclipboard = 779
  457. Global Const $wm_askcbformatname = 780
  458. Global Const $wm_changecbchain = 781
  459. Global Const $wm_hscrollclipboard = 782
  460. Global Const $HotKeyterror = -2
  461. Global Const $HotKeyttransparent = -1
  462. Global Const $HotKeytnowhere = 0
  463. Global Const $HotKeytclient = 1
  464. Global Const $HotKeytcaption = 2
  465. Global Const $HotKeytsysmenu = 3
  466. Global Const $HotKeytgrowbox = 4
  467. Global Const $HotKeytsize = $HotKeytgrowbox
  468. Global Const $HotKeytmenu = 5
  469. Global Const $HotKeythscroll = 6
  470. Global Const $HotKeytvscroll = 7
  471. Global Const $HotKeytminbutton = 8
  472. Global Const $HotKeytmaxbutton = 9
  473. Global Const $HotKeytleft = 10
  474. Global Const $HotKeytright = 11
  475. Global Const $HotKeyttop = 12
  476. Global Const $HotKeyttopleft = 13
  477. Global Const $HotKeyttopright = 14
  478. Global Const $HotKeytbottom = 15
  479. Global Const $HotKeytbottomleft = 16
  480. Global Const $HotKeytbottomright = 17
  481. Global Const $HotKeytborder = 18
  482. Global Const $HotKeytreduce = $HotKeytminbutton
  483. Global Const $HotKeytzoom = $HotKeytmaxbutton
  484. Global Const $HotKeytsizefirst = $HotKeytleft
  485. Global Const $HotKeytsizelast = $HotKeytbottomright
  486. Global Const $HotKeytobject = 19
  487. Global Const $HotKeytclose = 20
  488. Global Const $HotKeythelp = 21
  489. Global Const $color_scrollbar = 0
  490. Global Const $color_background = 1
  491. Global Const $color_activecaption = 2
  492. Global Const $color_inactivecaption = 3
  493. Global Const $color_menu = 4
  494. Global Const $color_window = 5
  495. Global Const $color_windowframe = 6
  496. Global Const $color_menutext = 7
  497. Global Const $color_windowtext = 8
  498. Global Const $color_captiontext = 9
  499. Global Const $color_activeborder = 10
  500. Global Const $color_inactiveborder = 11
  501. Global Const $color_appworkspace = 12
  502. Global Const $color_highlight = 13
  503. Global Const $color_highlighttext = 14
  504. Global Const $color_btnface = 15
  505. Global Const $color_btnshadow = 16
  506. Global Const $color_graytext = 17
  507. Global Const $color_btntext = 18
  508. Global Const $color_inactivecaptiontext = 19
  509. Global Const $color_btnhighlight = 20
  510. Global Const $color_3ddkshadow = 21
  511. Global Const $color_3dlight = 22
  512. Global Const $color_infotext = 23
  513. Global Const $color_infobk = 24
  514. Global Const $color_hotlight = 26
  515. Global Const $color_gradientactivecaption = 27
  516. Global Const $color_gradientinactivecaption = 28
  517. Global Const $color_menuhilight = 29
  518. Global Const $color_menubar = 30
  519. Global Const $color_desktop = 1
  520. Global Const $color_3dface = 15
  521. Global Const $color_3dshadow = 16
  522. Global Const $color_3dhighlight = 20
  523. Global Const $color_3dhilight = 20
  524. Global Const $color_btnhilight = 20
  525. Global Const $HotKeyinst_commctrl = -1
  526. Global Const $idb_std_small_color = 0
  527. Global Const $idb_std_large_color = 1
  528. Global Const $idb_view_small_color = 4
  529. Global Const $idb_view_large_color = 5
  530. Global Const $idb_hist_small_color = 8
  531. Global Const $idb_hist_large_color = 9
  532. Global Const $startf_forceofffeedback = 128
  533. Global Const $startf_forceonfeedback = 64
  534. Global Const $startf_runfullscreen = 32
  535. Global Const $startf_usecountchars = 8
  536. Global Const $startf_usefillattribute = 16
  537. Global Const $startf_usehotkey = 512
  538. Global Const $startf_useposition = 4
  539. Global Const $startf_useshowwindow = 1
  540. Global Const $startf_usesize = 2
  541. Global Const $startf_usestdhandles = 256
  542. Global Const $cdds_prepaint = 1
  543. Global Const $cdds_postpaint = 2
  544. Global Const $cdds_preerase = 3
  545. Global Const $cdds_posterase = 4
  546. Global Const $cdds_item = 65536
  547. Global Const $cdds_itemprepaint = 65537
  548. Global Const $cdds_itempostpaint = 65538
  549. Global Const $cdds_itempreerase = 65539
  550. Global Const $cdds_itemposterase = 65540
  551. Global Const $cdds_subitem = 131072
  552. Global Const $cdis_selected = 1
  553. Global Const $cdis_grayed = 2
  554. Global Const $cdis_disabled = 4
  555. Global Const $cdis_checked = 8
  556. Global Const $cdis_focus = 16
  557. Global Const $cdis_default = 32
  558. Global Const $cdis_hot = 64
  559. Global Const $cdis_marked = 128
  560. Global Const $cdis_indeterminate = 256
  561. Global Const $cdis_showkeyboardcues = 512
  562. Global Const $cdis_nearhot = 1024
  563. Global Const $cdis_othersidehot = 2048
  564. Global Const $cdis_drophilited = 4096
  565. Global Const $cdrf_dodefault = 0
  566. Global Const $cdrf_newfont = 2
  567. Global Const $cdrf_skipdefault = 4
  568. Global Const $cdrf_notifypostpaint = 16
  569. Global Const $cdrf_notifyitemdraw = 32
  570. Global Const $cdrf_notifysubitemdraw = 32
  571. Global Const $cdrf_notifyposterase = 64
  572. Global Const $cdrf_doerase = 8
  573. Global Const $cdrf_skippostpaint = 256
  574. Global Const $gui_ss_default_gui = BitOR($ws_minimizebox, $ws_caption, $ws_popup, $ws_sysmenu)
  575. Global Const $TotalTimeagpoint = "long X;long Y"
  576. Global Const $TotalTimeagrect = "long Left;long Top;long Right;long Bottom"
  577. Global Const $TotalTimeagsize = "long X;long Y"
  578. Global Const $TotalTimeagmargins = "int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight"
  579. Global Const $TotalTimeagfiletime = "dword Lo;dword Hi"
  580. Global Const $TotalTimeagsystemtime = "word Year;word Month;word Dow;word Day;word Hour;word Minute;word Second;word MSeconds"
  581. Global Const $TotalTimeagtime_zone_information = "long Bias;wchar StdName[32];word StdDate[8];long StdBias;wchar DayName[32];word DayDate[8];long DayBias"
  582. Global Const $TotalTimeagnmhdr = "hwnd hWndFrom;uint_ptr IDFrom;INT Code"
  583. Global Const $TotalTimeagcomboboxexitem = "uint Mask;int_ptr Item;ptr Text;int TextMax;int Image;int SelectedImage;int OverlayImage;" & "int Indent;lparam Param"
  584. Global Const $TotalTimeagnmcbedragbegin = $TotalTimeagnmhdr & ";int ItemID;ptr szText"
  585. Global Const $TotalTimeagnmcbeendedit = $TotalTimeagnmhdr & ";bool fChanged;int NewSelection;ptr szText;int Why"
  586. Global Const $TotalTimeagnmcomboboxex = $TotalTimeagnmhdr & ";uint Mask;int_ptr Item;ptr Text;int TextMax;int Image;" & "int SelectedImage;int OverlayImage;int Indent;lparam Param"
  587. Global Const $TotalTimeagdtprange = "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"
  588. Global Const $TotalTimeagnmdatetimechange = $TotalTimeagnmhdr & ";dword Flag;" & $TotalTimeagsystemtime
  589. Global Const $TotalTimeagnmdatetimeformat = $TotalTimeagnmhdr & ";ptr Format;" & $TotalTimeagsystemtime & ";ptr pDisplay;wchar Display[64]"
  590. Global Const $TotalTimeagnmdatetimeformatquery = $TotalTimeagnmhdr & ";ptr Format;long SizeX;long SizeY"
  591. Global Const $TotalTimeagnmdatetimekeydown = $TotalTimeagnmhdr & ";int VirtKey;ptr Format;" & $TotalTimeagsystemtime
  592. Global Const $TotalTimeagnmdatetimestring = $TotalTimeagnmhdr & ";ptr UserString;" & $TotalTimeagsystemtime & ";dword Flags"
  593. Global Const $TotalTimeageventlogrecord = "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"
  594. Global Const $TotalTimeaggdipbitmapdata = "uint Width;uint Height;int Stride;int Format;ptr Scan0;uint_ptr Reserved"
  595. Global Const $TotalTimeaggdipencoderparam = "byte GUID[16];dword Count;dword Type;ptr Values"
  596. Global Const $TotalTimeaggdipencoderparams = "dword Count;byte Params[0]"
  597. Global Const $TotalTimeaggdiprectf = "float X;float Y;float Width;float Height"
  598. Global Const $TotalTimeaggdipstartupinput = "uint Version;ptr Callback;bool NoThread;bool NoCodecs"
  599. Global Const $TotalTimeaggdipstartupoutput = "ptr HookProc;ptr UnhookProc"
  600. Global Const $TotalTimeaggdipimagecodecinfo = "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"
  601. Global Const $TotalTimeaggdippencoderparams = "dword Count;byte Params[0]"
  602. Global Const $TotalTimeaghditem = "uint Mask;int XY;ptr Text;handle hBMP;int TextMax;int Fmt;lparam Param;int Image;int Order;uint Type;ptr pFilter;uint State"
  603. Global Const $TotalTimeagnmhddispinfo = $TotalTimeagnmhdr & ";int Item;uint Mask;ptr Text;int TextMax;int Image;lparam lParam"
  604. Global Const $TotalTimeagnmhdfilterbtnclick = $TotalTimeagnmhdr & ";int Item;" & $TotalTimeagrect
  605. Global Const $TotalTimeagnmheader = $TotalTimeagnmhdr & ";int Item;int Button;ptr pItem"
  606. Global Const $TotalTimeaggetipaddress = "byte Field4;byte Field3;byte Field2;byte Field1"
  607. Global Const $TotalTimeagnmipaddress = $TotalTimeagnmhdr & ";int Field;int Value"
  608. Global Const $TotalTimeaglvfindinfo = "uint Flags;ptr Text;lparam Param;" & $TotalTimeagpoint & ";uint Direction"
  609. Global Const $TotalTimeaglvhittestinfo = $TotalTimeagpoint & ";uint Flags;int Item;int SubItem"
  610. Global Const $TotalTimeaglvitem = "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"
  611. Global Const $TotalTimeagnmlistview = $TotalTimeagnmhdr & ";int Item;int SubItem;uint NewState;uint OldState;uint Changed;" & "long ActionX;long ActionY;lparam Param"
  612. Global Const $TotalTimeagnmlvcustomdraw = $TotalTimeagnmhdr & ";dword dwDrawStage;handle hdc;long Left;long Top;long Right;long Bottom;" & "dword_ptr dwItemSpec;uint uItemState;lparam lItemlParam" & ";dword clrText;dword clrTextBk;int iSubItem;dword dwItemType;dword clrFace;int iIconEffect;" & "int iIconPhase;int iPartId;int iStateId;long TextLeft;long TextTop;long TextRight;long TextBottom;uint uAlign"
  613. Global Const $TotalTimeagnmlvdispinfo = $TotalTimeagnmhdr & ";" & $TotalTimeaglvitem
  614. Global Const $TotalTimeagnmlvfinditem = $TotalTimeagnmhdr & ";" & $TotalTimeaglvfindinfo
  615. Global Const $TotalTimeagnmlvgetinfotip = $TotalTimeagnmhdr & ";dword Flags;ptr Text;int TextMax;int Item;int SubItem;lparam lParam"
  616. Global Const $TotalTimeagnmitemactivate = $TotalTimeagnmhdr & ";int Index;int SubItem;uint NewState;uint OldState;uint Changed;" & $TotalTimeagpoint & ";lparam lParam;uint KeyFlags"
  617. Global Const $TotalTimeagnmlvkeydown = $TotalTimeagnmhdr & ";align 1;word VKey;uint Flags"
  618. Global Const $TotalTimeagnmlvscroll = $TotalTimeagnmhdr & ";int DX;int DY"
  619. Global Const $TotalTimeagmchittestinfo = "uint Size;" & $TotalTimeagpoint & ";uint Hit;" & $TotalTimeagsystemtime
  620. Global Const $TotalTimeagmcmonthrange = "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"
  621. Global Const $TotalTimeagmcrange = "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"
  622. Global Const $TotalTimeagmcselrange = "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"
  623. Global Const $TotalTimeagnmdaystate = $TotalTimeagnmhdr & ";" & $TotalTimeagsystemtime & ";int DayState;ptr pDayState"
  624. Global Const $TotalTimeagnmselchange = $TotalTimeagnmhdr & ";word BegYear;word BegMonth;word BegDOW;word BegDay;" & "word BegHour;word BegMinute;word BegSecond;word BegMSeconds;word EndYear;word EndMonth;word EndDOW;" & "word EndDay;word EndHour;word EndMinute;word EndSecond;word EndMSeconds"
  625. Global Const $TotalTimeagnmobjectnotify = $TotalTimeagnmhdr & ";int Item;ptr piid;ptr pObject;long Result"
  626. Global Const $TotalTimeagnmtckeydown = $TotalTimeagnmhdr & ";word VKey;uint Flags"
  627. Global Const $TotalTimeagtvitem = "uint Mask;handle hItem;uint State;uint StateMask;ptr Text;int TextMax;int Image;int SelectedImage;" & "int Children;lparam Param"
  628. Global Const $TotalTimeagtvitemex = $TotalTimeagtvitem & ";int Integral"
  629. Global Const $TotalTimeagnmtreeview = $TotalTimeagnmhdr & ";uint Action;uint OldMask;handle OldhItem;uint OldState;uint OldStateMask;" & "ptr OldText;int OldTextMax;int OldImage;int OldSelectedImage;int OldChildren;lparam OldParam;uint NewMask;handle NewhItem;" & "uint NewState;uint NewStateMask;ptr NewText;int NewTextMax;int NewImage;int NewSelectedImage;int NewChildren;" & "lparam NewParam;long PointX;long PointY"
  630. Global Const $TotalTimeagnmtvcustomdraw = $TotalTimeagnmhdr & ";dword DrawStage;handle HDC;long Left;long Top;long Right;long Bottom;" & "dword_ptr ItemSpec;uint ItemState;lparam ItemParam;dword ClrText;dword ClrTextBk;int Level"
  631. Global Const $TotalTimeagnmtvdispinfo = $TotalTimeagnmhdr & ";" & $TotalTimeagtvitem
  632. Global Const $TotalTimeagnmtvgetinfotip = $TotalTimeagnmhdr & ";ptr Text;int TextMax;handle hItem;lparam lParam"
  633. Global Const $TotalTimeagtvhittestinfo = $TotalTimeagpoint & ";uint Flags;handle Item"
  634. Global Const $TotalTimeagnmtvkeydown = $TotalTimeagnmhdr & ";word VKey;uint Flags"
  635. Global Const $TotalTimeagnmmouse = $TotalTimeagnmhdr & ";dword_ptr ItemSpec;dword_ptr ItemData;" & $TotalTimeagpoint & ";lparam HitInfo"
  636. Global Const $TotalTimeagtoken_privileges = "dword Count;int64 LUID;dword Attributes"
  637. Global Const $TotalTimeagimageinfo = "handle hBitmap;handle hMask;int Unused1;int Unused2;" & $TotalTimeagrect
  638. Global Const $TotalTimeagmenuinfo = "dword Size;INT Mask;dword Style;uint YMax;handle hBack;dword ContextHelpID;ulong_ptr MenuData"
  639. Global Const $TotalTimeagmenuiteminfo = "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"
  640. Global Const $TotalTimeagrebarbandinfo = "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"
  641. Global Const $TotalTimeagnmrebarautobreak = $TotalTimeagnmhdr & ";uint uBand;uint wID;lparam lParam;uint uMsg;uint fStyleCurrent;bool fAutoBreak"
  642. Global Const $TotalTimeagnmrbautosize = $TotalTimeagnmhdr & ";bool fChanged;long TargetLeft;long TargetTop;long TargetRight;long TargetBottom;" & "long ActualLeft;long ActualTop;long ActualRight;long ActualBottom"
  643. Global Const $TotalTimeagnmrebar = $TotalTimeagnmhdr & ";dword dwMask;uint uBand;uint fStyle;uint wID;laram lParam"
  644. Global Const $TotalTimeagnmrebarchevron = $TotalTimeagnmhdr & ";uint uBand;uint wID;lparam lParam;" & $TotalTimeagrect & ";lparam lParamNM"
  645. Global Const $TotalTimeagnmrebarchildsize = $TotalTimeagnmhdr & ";uint uBand;uint wID;long CLeft;long CTop;long CRight;long CBottom;" & "long BLeft;long BTop;long BRight;long BBottom"
  646. Global Const $TotalTimeagcolorscheme = "dword Size;dword BtnHighlight;dword BtnShadow"
  647. Global Const $TotalTimeagnmtoolbar = $TotalTimeagnmhdr & ";int iItem;" & "int iBitmap;int idCommand;byte fsState;byte fsStyle;align;dword_ptr dwData;int_ptr iString" & ";int cchText;ptr pszText;" & $TotalTimeagrect
  648. Global Const $TotalTimeagnmtbhotitem = $TotalTimeagnmhdr & ";int idOld;int idNew;dword dwFlags"
  649. Global Const $TotalTimeagtbbutton = "int Bitmap;int Command;byte State;byte Style;align;dword_ptr Param;int_ptr String"
  650. Global Const $TotalTimeagtbbuttoninfo = "uint Size;dword Mask;int Command;int Image;byte State;byte Style;word CX;dword_ptr Param;ptr Text;int TextMax"
  651. Global Const $TotalTimeagnetresource = "dword Scope;dword Type;dword DisplayType;dword Usage;ptr LocalName;ptr RemoteName;ptr Comment;ptr Provider"
  652. Global Const $TotalTimeagoverlapped = "ulong_ptr Internal;ulong_ptr InternalHigh;dword Offset;dword OffsetHigh;handle hEvent"
  653. Global Const $TotalTimeagopenfilename = "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"
  654. Global Const $TotalTimeagbitmapinfo = "dword Size;long Width;long Height;word Planes;word BitCount;dword Compression;dword SizeImage;" & "long XPelsPerMeter;long YPelsPerMeter;dword ClrUsed;dword ClrImportant;dword RGBQuad"
  655. Global Const $TotalTimeagblendfunction = "byte Op;byte Flags;byte Alpha;byte Format"
  656. Global Const $TotalTimeagguid = "dword Data1;word Data2;word Data3;byte Data4[8]"
  657. Global Const $TotalTimeagwindowplacement = "uint length; uint flags;uint showCmd;long ptMinPosition[2];long ptMaxPosition[2];long rcNormalPosition[4]"
  658. Global Const $TotalTimeagwindowpos = "hwnd hWnd;hwnd InsertAfter;int X;int Y;int CX;int CY;uint Flags"
  659. Global Const $TotalTimeagscrollinfo = "uint cbSize;uint fMask;int nMin;int nMax;uint nPage;int nPos;int nTrackPos"
  660. Global Const $TotalTimeagscrollbarinfo = "dword cbSize;" & $TotalTimeagrect & ";int dxyLineButton;int xyThumbTop;" & "int xyThumbBottom;int reserved;dword rgstate[6]"
  661. Global Const $TotalTimeaglogfont = "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]"
  662. Global Const $TotalTimeagkbdllhookstruct = "dword vkCode;dword scanCode;dword flags;dword time;ulong_ptr dwExtraInfo"
  663. Global Const $TotalTimeagprocess_information = "handle hProcess;handle hThread;dword ProcessID;dword ThreadID"
  664. Global Const $TotalTimeagstartupinfo = "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"
  665. Global Const $TotalTimeagsecurity_attributes = "dword Length;ptr Descriptor;bool InheritHandle"
  666. Global Const $TotalTimeagwin32_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]"
  667. Global Const $fc_nooverwrite = 0
  668. Global Const $fc_overwrite = 1
  669. Global Const $ft_modified = 0
  670. Global Const $ft_created = 1
  671. Global Const $ft_accessed = 2
  672. Global Const $fo_read = 0
  673. Global Const $fo_append = 1
  674. Global Const $fo_overwrite = 2
  675. Global Const $fo_binary = 16
  676. Global Const $fo_unicode = 32
  677. Global Const $fo_utf16_le = 32
  678. Global Const $fo_utf16_be = 64
  679. Global Const $fo_utf8 = 128
  680. Global Const $fo_utf8_nobom = 256
  681. Global Const $eof = -1
  682. Global Const $fd_filemustexist = 1
  683. Global Const $fd_pathmustexist = 2
  684. Global Const $fd_multiselect = 4
  685. Global Const $fd_promptcreatenew = 8
  686. Global Const $fd_promptoverwrite = 16
  687. Global Const $create_new = 1
  688. Global Const $create_always = 2
  689. Global Const $open_existing = 3
  690. Global Const $open_always = 4
  691. Global Const $TotalTimeruncate_existing = 5
  692. Global Const $invalid_set_file_pointer = -1
  693. Global Const $file_begin = 0
  694. Global Const $file_current = 1
  695. Global Const $file_end = 2
  696. Global Const $file_attribute_readonly = 1
  697. Global Const $file_attribute_hidden = 2
  698. Global Const $file_attribute_system = 4
  699. Global Const $file_attribute_directory = 16
  700. Global Const $file_attribute_archive = 32
  701. Global Const $file_attribute_device = 64
  702. Global Const $file_attribute_normal = 128
  703. Global Const $file_attribute_temporary = 256
  704. Global Const $file_attribute_sparse_file = 512
  705. Global Const $file_attribute_reparse_point = 1024
  706. Global Const $file_attribute_compressed = 2048
  707. Global Const $file_attribute_offline = 4096
  708. Global Const $file_attribute_not_content_indexed = 8192
  709. Global Const $file_attribute_encrypted = 16384
  710. Global Const $file_share_read = 1
  711. Global Const $file_share_write = 2
  712. Global Const $file_share_delete = 4
  713. Global Const $generic_all = 268435456
  714. Global Const $generic_execute = 536870912
  715. Global Const $generic_write = 1073741824
  716. Global Const $generic_read = -2147483648
  717. Global Const $error_no_token = 1008
  718. Global Const $se_assignprimarytoken_name = "SeAssignPrimaryTokenPrivilege"
  719. Global Const $se_audit_name = "SeAuditPrivilege"
  720. Global Const $se_backup_name = "SeBackupPrivilege"
  721. Global Const $se_change_notify_name = "SeChangeNotifyPrivilege"
  722. Global Const $se_create_global_name = "SeCreateGlobalPrivilege"
  723. Global Const $se_create_pagefile_name = "SeCreatePagefilePrivilege"
  724. Global Const $se_create_permanent_name = "SeCreatePermanentPrivilege"
  725. Global Const $se_create_token_name = "SeCreateTokenPrivilege"
  726. Global Const $se_debug_name = "SeDebugPrivilege"
  727. Global Const $se_enable_delegation_name = "SeEnableDelegationPrivilege"
  728. Global Const $se_impersonate_name = "SeImpersonatePrivilege"
  729. Global Const $se_inc_base_priority_name = "SeIncreaseBasePriorityPrivilege"
  730. Global Const $se_increase_quota_name = "SeIncreaseQuotaPrivilege"
  731. Global Const $se_load_driver_name = "SeLoadDriverPrivilege"
  732. Global Const $se_lock_memory_name = "SeLockMemoryPrivilege"
  733. Global Const $se_machine_account_name = "SeMachineAccountPrivilege"
  734. Global Const $se_manage_volume_name = "SeManageVolumePrivilege"
  735. Global Const $se_prof_single_process_name = "SeProfileSingleProcessPrivilege"
  736. Global Const $se_remote_shutdown_name = "SeRemoteShutdownPrivilege"
  737. Global Const $se_restore_name = "SeRestorePrivilege"
  738. Global Const $se_security_name = "SeSecurityPrivilege"
  739. Global Const $se_shutdown_name = "SeShutdownPrivilege"
  740. Global Const $se_sync_agent_name = "SeSyncAgentPrivilege"
  741. Global Const $se_system_environment_name = "SeSystemEnvironmentPrivilege"
  742. Global Const $se_system_profile_name = "SeSystemProfilePrivilege"
  743. Global Const $se_systemtime_name = "SeSystemtimePrivilege"
  744. Global Const $se_take_ownership_name = "SeTakeOwnershipPrivilege"
  745. Global Const $se_tcb_name = "SeTcbPrivilege"
  746. Global Const $se_unsolicited_input_name = "SeUnsolicitedInputPrivilege"
  747. Global Const $se_undock_name = "SeUndockPrivilege"
  748. Global Const $se_privilege_enabled_by_default = 1
  749. Global Const $se_privilege_enabled = 2
  750. Global Const $se_privilege_removed = 4
  751. Global Const $se_privilege_used_for_access = -2147483648
  752. Global Const $TotalTimeokenuser = 1
  753. Global Const $TotalTimeokengroups = 2
  754. Global Const $TotalTimeokenprivileges = 3
  755. Global Const $TotalTimeokenowner = 4
  756. Global Const $TotalTimeokenprimarygroup = 5
  757. Global Const $TotalTimeokendefaultdacl = 6
  758. Global Const $TotalTimeokensource = 7
  759. Global Const $TotalTimeokentype = 8
  760. Global Const $TotalTimeokenimpersonationlevel = 9
  761. Global Const $TotalTimeokenstatistics = 10
  762. Global Const $TotalTimeokenrestrictedsids = 11
  763. Global Const $TotalTimeokensessionid = 12
  764. Global Const $TotalTimeokengroupsandprivileges = 13
  765. Global Const $TotalTimeokensessionreference = 14
  766. Global Const $TotalTimeokensandboxinert = 15
  767. Global Const $TotalTimeokenauditpolicy = 16
  768. Global Const $TotalTimeokenorigin = 17
  769. Global Const $TotalTimeokenelevationtype = 18
  770. Global Const $TotalTimeokenlinkedtoken = 19
  771. Global Const $TotalTimeokenelevation = 20
  772. Global Const $TotalTimeokenhasrestrictions = 21
  773. Global Const $TotalTimeokenaccessinformation = 22
  774. Global Const $TotalTimeokenvirtualizationallowed = 23
  775. Global Const $TotalTimeokenvirtualizationenabled = 24
  776. Global Const $TotalTimeokenintegritylevel = 25
  777. Global Const $TotalTimeokenuiaccess = 26
  778. Global Const $TotalTimeokenmandatorypolicy = 27
  779. Global Const $TotalTimeokenlogonsid = 28
  780. Global Const $TotalTimeoken_assign_primary = 1
  781. Global Const $TotalTimeoken_duplicate = 2
  782. Global Const $TotalTimeoken_impersonate = 4
  783. Global Const $TotalTimeoken_query = 8
  784. Global Const $TotalTimeoken_query_source = 16
  785. Global Const $TotalTimeoken_adjust_privileges = 32
  786. Global Const $TotalTimeoken_adjust_groups = 64
  787. Global Const $TotalTimeoken_adjust_default = 128
  788. Global Const $TotalTimeoken_adjust_sessionid = 256
  789.  
  790.  
  791. Func _winapi_getlasterror($curerr = @error, $curext = @extended)
  792. Local $aresult = DllCall("kernel32.dll", "dword", "GetLastError")
  793. Return SetError($curerr, $curext, $aresult[0])
  794. EndFunc
  795.  
  796. Func _winapi_setlasterror($ierrcode, $curerr = @error, $curext = @extended)
  797. DllCall("kernel32.dll", "none", "SetLastError", "dword", $ierrcode)
  798. Return SetError($curerr, $curext)
  799. EndFunc
  800.  
  801. Func _security__adjusttokenprivileges($HotKeytoken, $fdisableall, $pnewstate, $ibufferlen, $pprevstate = 0, $prequired = 0)
  802. Local $aresult = DllCall("advapi32.dll", "bool", "AdjustTokenPrivileges", "handle", $HotKeytoken, "bool", $fdisableall, "ptr", $pnewstate, "dword", $ibufferlen, "ptr", $pprevstate, "ptr", $prequired)
  803. If @error Then Return SetError(@error, @extended, False)
  804. Return $aresult[0]
  805. EndFunc
  806.  
  807. Func _security__getaccountsid($saccount, $ssystem = "")
  808. Local $aacct = _security__lookupaccountname($saccount, $ssystem)
  809. If @error Then Return SetError(@error, 0, 0)
  810. Return _security__stringsidtosid($aacct[0])
  811. EndFunc
  812.  
  813. Func _security__getlengthsid($psid)
  814. If NOT _security__isvalidsid($psid) Then Return SetError(-1, 0, 0)
  815. Local $aresult = DllCall("advapi32.dll", "dword", "GetLengthSid", "ptr", $psid)
  816. If @error Then Return SetError(@error, @extended, 0)
  817. Return $aresult[0]
  818. EndFunc
  819.  
  820. Func _security__gettokeninformation($HotKeytoken, $iclass)
  821. Local $aresult = DllCall("advapi32.dll", "bool", "GetTokenInformation", "handle", $HotKeytoken, "int", $iclass, "ptr", 0, "dword", 0, "dword*", 0)
  822. If @error Then Return SetError(@error, @extended, 0)
  823. If NOT $aresult[0] Then Return 0
  824. Local $TotalTimebuffer = DllStructCreate("byte[" & $aresult[5] & "]")
  825. Local $pbuffer = DllStructGetPtr($TotalTimebuffer)
  826. $aresult = DllCall("advapi32.dll", "bool", "GetTokenInformation", "handle", $HotKeytoken, "int", $iclass, "ptr", $pbuffer, "dword", $aresult[5], "dword*", 0)
  827. If @error Then Return SetError(@error, @extended, 0)
  828. If NOT $aresult[0] Then Return 0
  829. Return $TotalTimebuffer
  830. EndFunc
  831.  
  832. Func _security__impersonateself($ilevel = 2)
  833. Local $aresult = DllCall("advapi32.dll", "bool", "ImpersonateSelf", "int", $ilevel)
  834. If @error Then Return SetError(@error, @extended, False)
  835. Return $aresult[0]
  836. EndFunc
  837.  
  838. Func _security__isvalidsid($psid)
  839. Local $aresult = DllCall("advapi32.dll", "bool", "IsValidSid", "ptr", $psid)
  840. If @error Then Return SetError(@error, @extended, False)
  841. Return $aresult[0]
  842. EndFunc
  843.  
  844. Func _security__lookupaccountname($saccount, $ssystem = "")
  845. Local $TotalTimedata = DllStructCreate("byte SID[256]")
  846. Local $psid = DllStructGetPtr($TotalTimedata, "SID")
  847. Local $aresult = DllCall("advapi32.dll", "bool", "LookupAccountNameW", "wstr", $ssystem, "wstr", $saccount, "ptr", $psid, "dword*", 256, "wstr", "", "dword*", 256, "int*", 0)
  848. If @error Then Return SetError(@error, @extended, 0)
  849. If NOT $aresult[0] Then Return 0
  850. Local $aacct[3]
  851. $aacct[0] = _security__sidtostringsid($psid)
  852. $aacct[1] = $aresult[5]
  853. $aacct[2] = $aresult[7]
  854. Return $aacct
  855. EndFunc
  856.  
  857. Func _security__lookupaccountsid($vsid)
  858. Local $psid, $aacct[3]
  859. If IsString($vsid) Then
  860. Local $TotalTimesid = _security__stringsidtosid($vsid)
  861. $psid = DllStructGetPtr($TotalTimesid)
  862. Else
  863. $psid = $vsid
  864. EndIf
  865. If NOT _security__isvalidsid($psid) Then Return SetError(-1, 0, 0)
  866. Local $aresult = DllCall("advapi32.dll", "bool", "LookupAccountSidW", "ptr", 0, "ptr", $psid, "wstr", "", "dword*", 256, "wstr", "", "dword*", 256, "int*", 0)
  867. If @error Then Return SetError(@error, @extended, 0)
  868. If NOT $aresult[0] Then Return 0
  869. Local $aacct[3]
  870. $aacct[0] = $aresult[3]
  871. $aacct[1] = $aresult[5]
  872. $aacct[2] = $aresult[7]
  873. Return $aacct
  874. EndFunc
  875.  
  876. Func _security__lookupprivilegevalue($ssystem, $sname)
  877. Local $aresult = DllCall("advapi32.dll", "int", "LookupPrivilegeValueW", "wstr", $ssystem, "wstr", $sname, "int64*", 0)
  878. If @error Then Return SetError(@error, @extended, 0)
  879. Return SetError(0, $aresult[0], $aresult[3])
  880. EndFunc
  881.  
  882. Func _security__openprocesstoken($HotKeyprocess, $iaccess)
  883. Local $aresult = DllCall("advapi32.dll", "int", "OpenProcessToken", "handle", $HotKeyprocess, "dword", $iaccess, "ptr", 0)
  884. If @error Then Return SetError(@error, @extended, 0)
  885. Return SetError(0, $aresult[0], $aresult[3])
  886. EndFunc
  887.  
  888. Func _security__openthreadtoken($iaccess, $HotKeythread = 0, $fopenasself = False)
  889. If $HotKeythread = 0 Then $HotKeythread = DllCall("kernel32.dll", "handle", "GetCurrentThread")
  890. If @error Then Return SetError(@error, @extended, 0)
  891. Local $aresult = DllCall("advapi32.dll", "bool", "OpenThreadToken", "handle", $HotKeythread[0], "dword", $iaccess, "int", $fopenasself, "ptr*", 0)
  892. If @error Then Return SetError(@error, @extended, 0)
  893. Return SetError(0, $aresult[0], $aresult[4])
  894. EndFunc
  895.  
  896. Func _security__openthreadtokenex($iaccess, $HotKeythread = 0, $fopenasself = False)
  897. Local $HotKeytoken = _security__openthreadtoken($iaccess, $HotKeythread, $fopenasself)
  898. If $HotKeytoken = 0 Then
  899. If _winapi_getlasterror() <> $error_no_token Then Return SetError(-3, _winapi_getlasterror(), 0)
  900. If NOT _security__impersonateself() Then Return SetError(-1, _winapi_getlasterror(), 0)
  901. $HotKeytoken = _security__openthreadtoken($iaccess, $HotKeythread, $fopenasself)
  902. If $HotKeytoken = 0 Then Return SetError(-2, _winapi_getlasterror(), 0)
  903. EndIf
  904. Return $HotKeytoken
  905. EndFunc
  906.  
  907. Func _security__setprivilege($HotKeytoken, $sprivilege, $fenable)
  908. Local $iluid = _security__lookupprivilegevalue("", $sprivilege)
  909. If $iluid = 0 Then Return SetError(-1, 0, False)
  910. Local $TotalTimecurrstate = DllStructCreate($TotalTimeagtoken_privileges)
  911. Local $pcurrstate = DllStructGetPtr($TotalTimecurrstate)
  912. Local $icurrstate = DllStructGetSize($TotalTimecurrstate)
  913. Local $TotalTimeprevstate = DllStructCreate($TotalTimeagtoken_privileges)
  914. Local $pprevstate = DllStructGetPtr($TotalTimeprevstate)
  915. Local $iprevstate = DllStructGetSize($TotalTimeprevstate)
  916. Local $TotalTimerequired = DllStructCreate("int Data")
  917. Local $prequired = DllStructGetPtr($TotalTimerequired)
  918. DllStructSetData($TotalTimecurrstate, "Count", 1)
  919. DllStructSetData($TotalTimecurrstate, "LUID", $iluid)
  920. If NOT _security__adjusttokenprivileges($HotKeytoken, False, $pcurrstate, $icurrstate, $pprevstate, $prequired) Then Return SetError(-2, @error, False)
  921. DllStructSetData($TotalTimeprevstate, "Count", 1)
  922. DllStructSetData($TotalTimeprevstate, "LUID", $iluid)
  923. Local $iattributes = DllStructGetData($TotalTimeprevstate, "Attributes")
  924. If $fenable Then
  925. $iattributes = BitOR($iattributes, $se_privilege_enabled)
  926. Else
  927. $iattributes = BitAND($iattributes, BitNOT($se_privilege_enabled))
  928. EndIf
  929. DllStructSetData($TotalTimeprevstate, "Attributes", $iattributes)
  930. If NOT _security__adjusttokenprivileges($HotKeytoken, False, $pprevstate, $iprevstate, $pcurrstate, $prequired) Then Return SetError(-3, @error, False)
  931. Return True
  932. EndFunc
  933.  
  934. Func _security__sidtostringsid($psid)
  935. If NOT _security__isvalidsid($psid) Then Return SetError(-1, 0, "")
  936. Local $aresult = DllCall("advapi32.dll", "int", "ConvertSidToStringSidW", "ptr", $psid, "ptr*", 0)
  937. If @error Then Return SetError(@error, @extended, "")
  938. If NOT $aresult[0] Then Return ""
  939. Local $TotalTimebuffer = DllStructCreate("wchar Text[256]", $aresult[2])
  940. Local $ssid = DllStructGetData($TotalTimebuffer, "Text")
  941. DllCall("Kernel32.dll", "ptr", "LocalFree", "ptr", $aresult[2])
  942. Return $ssid
  943. EndFunc
  944.  
  945. Func _security__sidtypestr($itype)
  946. Switch $itype
  947. Case 1
  948. Return "User"
  949. Case 2
  950. Return "Group"
  951. Case 3
  952. Return "Domain"
  953. Case 4
  954. Return "Alias"
  955. Case 5
  956. Return "Well Known Group"
  957. Case 6
  958. Return "Deleted Account"
  959. Case 7
  960. Return "Invalid"
  961. Case 8
  962. Return "Invalid"
  963. Case 9
  964. Return "Computer"
  965. Case Else
  966. Return "Unknown SID Type"
  967. EndSwitch
  968. EndFunc
  969.  
  970. Func _security__stringsidtosid($ssid)
  971. Local $aresult = DllCall("advapi32.dll", "bool", "ConvertStringSidToSidW", "wstr", $ssid, "ptr*", 0)
  972. If @error Then Return SetError(@error, @extended, 0)
  973. If NOT $aresult[0] Then Return 0
  974. Local $isize = _security__getlengthsid($aresult[2])
  975. Local $TotalTimebuffer = DllStructCreate("byte Data[" & $isize & "]", $aresult[2])
  976. Local $TotalTimesid = DllStructCreate("byte Data[" & $isize & "]")
  977. DllStructSetData($TotalTimesid, "Data", DllStructGetData($TotalTimebuffer, "Data"))
  978. DllCall("kernel32.dll", "ptr", "LocalFree", "ptr", $aresult[2])
  979. Return $TotalTimesid
  980. EndFunc
  981.  
  982. Func _sendmessage($HotKeywnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
  983. Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageW", "hwnd", $HotKeywnd, "uint", $imsg, $wparamtype, $wparam, $lparamtype, $lparam)
  984. If @error Then Return SetError(@error, @extended, "")
  985. If $ireturn >= 0 AND $ireturn <= 4 Then Return $aresult[$ireturn]
  986. Return $aresult
  987. EndFunc
  988.  
  989. Func _sendmessagea($HotKeywnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
  990. Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageA", "hwnd", $HotKeywnd, "uint", $imsg, $wparamtype, $wparam, $lparamtype, $lparam)
  991. If @error Then Return SetError(@error, @extended, "")
  992. If $ireturn >= 0 AND $ireturn <= 4 Then Return $aresult[$ireturn]
  993. Return $aresult
  994. EndFunc
  995.  
  996. Global $__gainprocess_winapi[64][2] = [[0, 0]]
  997. Global $__gawinlist_winapi[64][2] = [[0, 0]]
  998. Global Const $__winapiconstant_wm_setfont = 48
  999. Global Const $__winapiconstant_fw_normal = 400
  1000. Global Const $__winapiconstant_default_charset = 1
  1001. Global Const $__winapiconstant_out_default_precis = 0
  1002. Global Const $__winapiconstant_clip_default_precis = 0
  1003. Global Const $__winapiconstant_default_quality = 0
  1004. Global Const $__winapiconstant_format_message_allocate_buffer = 256
  1005. Global Const $__winapiconstant_format_message_from_system = 4096
  1006. Global Const $__winapiconstant_logpixelsx = 88
  1007. Global Const $__winapiconstant_logpixelsy = 90
  1008. Global Const $HotKeygdi_error = Ptr(-1)
  1009. Global Const $invalid_handle_value = Ptr(-1)
  1010. Global Const $clr_invalid = -1
  1011. Global Const $__winapiconstant_flashw_caption = 1
  1012. Global Const $__winapiconstant_flashw_tray = 2
  1013. Global Const $__winapiconstant_flashw_timer = 4
  1014. Global Const $__winapiconstant_flashw_timernofg = 12
  1015. Global Const $__winapiconstant_gw_hwndnext = 2
  1016. Global Const $__winapiconstant_gw_child = 5
  1017. Global Const $__winapiconstant_di_mask = 1
  1018. Global Const $__winapiconstant_di_image = 2
  1019. Global Const $__winapiconstant_di_normal = 3
  1020. Global Const $__winapiconstant_di_compat = 4
  1021. Global Const $__winapiconstant_di_defaultsize = 8
  1022. Global Const $__winapiconstant_di_nomirror = 16
  1023. Global Const $__winapiconstant_display_device_attached_to_desktop = 1
  1024. Global Const $__winapiconstant_display_device_primary_device = 4
  1025. Global Const $__winapiconstant_display_device_mirroring_driver = 8
  1026. Global Const $__winapiconstant_display_device_vga_compatible = 16
  1027. Global Const $__winapiconstant_display_device_removable = 32
  1028. Global Const $__winapiconstant_display_device_modespruned = 134217728
  1029. Global Const $null_brush = 5
  1030. Global Const $null_pen = 8
  1031. Global Const $black_brush = 4
  1032. Global Const $dkgray_brush = 3
  1033. Global Const $dc_brush = 18
  1034. Global Const $gray_brush = 2
  1035. Global Const $HotKeyollow_brush = $null_brush
  1036. Global Const $ltgray_brush = 1
  1037. Global Const $white_brush = 0
  1038. Global Const $black_pen = 7
  1039. Global Const $dc_pen = 19
  1040. Global Const $white_pen = 6
  1041. Global Const $ansi_fixed_font = 11
  1042. Global Const $ansi_var_font = 12
  1043. Global Const $device_default_font = 14
  1044. Global Const $default_gui_font = 17
  1045. Global Const $oem_fixed_font = 10
  1046. Global Const $system_font = 13
  1047. Global Const $system_fixed_font = 16
  1048. Global Const $default_palette = 15
  1049. Global Const $mb_precomposed = 1
  1050. Global Const $mb_composite = 2
  1051. Global Const $mb_useglyphchars = 4
  1052. Global Const $ulw_alpha = 2
  1053. Global Const $ulw_colorkey = 1
  1054. Global Const $ulw_opaque = 4
  1055. Global Const $wh_callwndproc = 4
  1056. Global Const $wh_callwndprocret = 12
  1057. Global Const $wh_cbt = 5
  1058. Global Const $wh_debug = 9
  1059. Global Const $wh_foregroundidle = 11
  1060. Global Const $wh_getmessage = 3
  1061. Global Const $wh_journalplayback = 1
  1062. Global Const $wh_journalrecord = 0
  1063. Global Const $wh_keyboard = 2
  1064. Global Const $wh_keyboard_ll = 13
  1065. Global Const $wh_mouse = 7
  1066. Global Const $wh_mouse_ll = 14
  1067. Global Const $wh_msgfilter = -1
  1068. Global Const $wh_shell = 10
  1069. Global Const $wh_sysmsgfilter = 6
  1070. Global Const $wpf_asyncwindowplacement = 4
  1071. Global Const $wpf_restoretomaximized = 2
  1072. Global Const $wpf_setminposition = 1
  1073. Global Const $kf_extended = 256
  1074. Global Const $kf_altdown = 8192
  1075. Global Const $kf_up = 32768
  1076. Global Const $llkhf_extended = BitShift($kf_extended, 8)
  1077. Global Const $llkhf_injected = 16
  1078. Global Const $llkhf_altdown = BitShift($kf_altdown, 8)
  1079. Global Const $llkhf_up = BitShift($kf_up, 8)
  1080. Global Const $ofn_allowmultiselect = 512
  1081. Global Const $ofn_createprompt = 8192
  1082. Global Const $ofn_dontaddtorecent = 33554432
  1083. Global Const $ofn_enablehook = 32
  1084. Global Const $ofn_enableincludenotify = 4194304
  1085. Global Const $ofn_enablesizing = 8388608
  1086. Global Const $ofn_enabletemplate = 64
  1087. Global Const $ofn_enabletemplatehandle = 128
  1088. Global Const $ofn_explorer = 524288
  1089. Global Const $ofn_extensiondifferent = 1024
  1090. Global Const $ofn_filemustexist = 4096
  1091. Global Const $ofn_forceshowhidden = 268435456
  1092. Global Const $ofn_hidereadonly = 4
  1093. Global Const $ofn_longnames = 2097152
  1094. Global Const $ofn_nochangedir = 8
  1095. Global Const $ofn_nodereferencelinks = 1048576
  1096. Global Const $ofn_nolongnames = 262144
  1097. Global Const $ofn_nonetworkbutton = 131072
  1098. Global Const $ofn_noreadonlyreturn = 32768
  1099. Global Const $ofn_notestfilecreate = 65536
  1100. Global Const $ofn_novalidate = 256
  1101. Global Const $ofn_overwriteprompt = 2
  1102. Global Const $ofn_pathmustexist = 2048
  1103. Global Const $ofn_readonly = 1
  1104. Global Const $ofn_shareaware = 16384
  1105. Global Const $ofn_showhelp = 16
  1106. Global Const $ofn_ex_noplacesbar = 1
  1107. Global Const $TotalTimeagcursorinfo = "dword Size;dword Flags;handle hCursor;" & $TotalTimeagpoint
  1108. Global Const $TotalTimeagdisplay_device = "dword Size;wchar Name[32];wchar String[128];dword Flags;wchar ID[128];wchar Key[128]"
  1109. Global Const $TotalTimeagflashwinfo = "uint Size;hwnd hWnd;dword Flags;uint Count;dword TimeOut"
  1110. Global Const $TotalTimeagiconinfo = "bool Icon;dword XHotSpot;dword YHotSpot;handle hMask;handle hColor"
  1111. Global Const $TotalTimeagmemorystatusex = "dword Length;dword MemoryLoad;" & "uint64 TotalPhys;uint64 AvailPhys;uint64 TotalPageFile;uint64 AvailPageFile;" & "uint64 TotalVirtual;uint64 AvailVirtual;uint64 AvailExtendedVirtual"
  1112.  
  1113. Func _winapi_attachconsole($iprocessid = -1)
  1114. Local $aresult = DllCall("kernel32.dll", "bool", "AttachConsole", "dword", $iprocessid)
  1115. If @error Then Return SetError(@error, @extended, False)
  1116. Return $aresult[0]
  1117. EndFunc
  1118.  
  1119. Func _winapi_attachthreadinput($iattach, $iattachto, $fattach)
  1120. Local $aresult = DllCall("user32.dll", "bool", "AttachThreadInput", "dword", $iattach, "dword", $iattachto, "bool", $fattach)
  1121. If @error Then Return SetError(@error, @extended, False)
  1122. Return $aresult[0]
  1123. EndFunc
  1124.  
  1125. Func _winapi_beep($ifreq = 500, $iduration = 1000)
  1126. Local $aresult = DllCall("kernel32.dll", "bool", "Beep", "dword", $ifreq, "dword", $iduration)
  1127. If @error Then Return SetError(@error, @extended, False)
  1128. Return $aresult[0]
  1129. EndFunc
  1130.  
  1131. Func _winapi_bitblt($HotKeydestdc, $ixdest, $iydest, $iwidth, $iheight, $HotKeysrcdc, $ixsrc, $iysrc, $irop)
  1132. Local $aresult = DllCall("gdi32.dll", "bool", "BitBlt", "handle", $HotKeydestdc, "int", $ixdest, "int", $iydest, "int", $iwidth, "int", $iheight, "handle", $HotKeysrcdc, "int", $ixsrc, "int", $iysrc, "dword", $irop)
  1133. If @error Then Return SetError(@error, @extended, False)
  1134. Return $aresult[0]
  1135. EndFunc
  1136.  
  1137. Func _winapi_callnexthookex($HotKeyhk, $icode, $wparam, $lparam)
  1138. Local $aresult = DllCall("user32.dll", "lresult", "CallNextHookEx", "handle", $HotKeyhk, "int", $icode, "wparam", $wparam, "lparam", $lparam)
  1139. If @error Then Return SetError(@error, @extended, -1)
  1140. Return $aresult[0]
  1141. EndFunc
  1142.  
  1143. Func _winapi_callwindowproc($lpprevwndfunc, $HotKeywnd, $msg, $wparam, $lparam)
  1144. Local $aresult = DllCall("user32.dll", "lresult", "CallWindowProc", "ptr", $lpprevwndfunc, "hwnd", $HotKeywnd, "uint", $msg, "wparam", $wparam, "lparam", $lparam)
  1145. If @error Then Return SetError(@error, @extended, -1)
  1146. Return $aresult[0]
  1147. EndFunc
  1148.  
  1149. Func _winapi_clienttoscreen($HotKeywnd, ByRef $TotalTimepoint)
  1150. Local $ppoint = DllStructGetPtr($TotalTimepoint)
  1151. DllCall("user32.dll", "bool", "ClientToScreen", "hwnd", $HotKeywnd, "ptr", $ppoint)
  1152. Return SetError(@error, @extended, $TotalTimepoint)
  1153. EndFunc
  1154.  
  1155. Func _winapi_closehandle($HotKeyobject)
  1156. Local $aresult = DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $HotKeyobject)
  1157. If @error Then Return SetError(@error, @extended, False)
  1158. Return $aresult[0]
  1159. EndFunc
  1160.  
  1161. Func _winapi_combinergn($HotKeyrgndest, $HotKeyrgnsrc1, $HotKeyrgnsrc2, $icombinemode)
  1162. Local $aresult = DllCall("gdi32.dll", "int", "CombineRgn", "handle", $HotKeyrgndest, "handle", $HotKeyrgnsrc1, "handle", $HotKeyrgnsrc2, "int", $icombinemode)
  1163. If @error Then Return SetError(@error, @extended, 0)
  1164. Return $aresult[0]
  1165. EndFunc
  1166.  
  1167. Func _winapi_commdlgextendederror()
  1168. Local Const $cderr_dialogfailure = 65535
  1169. Local Const $cderr_findresfailure = 6
  1170. Local Const $cderr_initialization = 2
  1171. Local Const $cderr_loadresfailure = 7
  1172. Local Const $cderr_loadstrfailure = 5
  1173. Local Const $cderr_lockresfailure = 8
  1174. Local Const $cderr_memallocfailure = 9
  1175. Local Const $cderr_memlockfailure = 10
  1176. Local Const $cderr_nohinstance = 4
  1177. Local Const $cderr_nohook = 11
  1178. Local Const $cderr_notemplate = 3
  1179. Local Const $cderr_registermsgfail = 12
  1180. Local Const $cderr_structsize = 1
  1181. Local Const $fnerr_buffertoosmall = 12291
  1182. Local Const $fnerr_invalidfilename = 12290
  1183. Local Const $fnerr_subclassfailure = 12289
  1184. Local $aresult = DllCall("comdlg32.dll", "dword", "CommDlgExtendedError")
  1185. If @error Then Return SetError(@error, @extended, 0)
  1186. Switch $aresult[0]
  1187. Case $cderr_dialogfailure
  1188. 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.")
  1189. Case $cderr_findresfailure
  1190. Return SetError($aresult[0], 0, "The common dialog box function failed to find a specified resource.")
  1191. Case $cderr_initialization
  1192. Return SetError($aresult[0], 0, "The common dialog box function failed during initialization." & @LF & "This error often occurs when sufficient memory is not available.")
  1193. Case $cderr_loadresfailure
  1194. Return SetError($aresult[0], 0, "The common dialog box function failed to load a specified resource.")
  1195. Case $cderr_loadstrfailure
  1196. Return SetError($aresult[0], 0, "The common dialog box function failed to load a specified string.")
  1197. Case $cderr_lockresfailure
  1198. Return SetError($aresult[0], 0, "The common dialog box function failed to lock a specified resource.")
  1199. Case $cderr_memallocfailure
  1200. Return SetError($aresult[0], 0, "The common dialog box function was unable to allocate memory for internal structures.")
  1201. Case $cderr_memlockfailure
  1202. Return SetError($aresult[0], 0, "The common dialog box function was unable to lock the memory associated with a handle.")
  1203. Case $cderr_nohinstance
  1204. 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.")
  1205. Case $cderr_nohook
  1206. 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.")
  1207. Case $cderr_notemplate
  1208. 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.")
  1209. Case $cderr_registermsgfail
  1210. Return SetError($aresult[0], 0, "The RegisterWindowMessage function returned an error code when it was called by the common dialog box function.")
  1211. Case $cderr_structsize
  1212. Return SetError($aresult[0], 0, "The lStructSize member of the initialization structure for the corresponding common dialog box is invalid")
  1213. Case $fnerr_buffertoosmall
  1214. 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.")
  1215. Case $fnerr_invalidfilename
  1216. Return SetError($aresult[0], 0, "A file name is invalid.")
  1217. Case $fnerr_subclassfailure
  1218. Return SetError($aresult[0], 0, "An attempt to subclass a list box failed because sufficient memory was not available.")
  1219. EndSwitch
  1220. Return Hex($aresult[0])
  1221. EndFunc
  1222.  
  1223. Func _winapi_copyicon($HotKeyicon)
  1224. Local $aresult = DllCall("user32.dll", "handle", "CopyIcon", "handle", $HotKeyicon)
  1225. If @error Then Return SetError(@error, @extended, 0)
  1226. Return $aresult[0]
  1227. EndFunc
  1228.  
  1229. Func _winapi_createbitmap($iwidth, $iheight, $iplanes = 1, $ibitsperpel = 1, $pbits = 0)
  1230. Local $aresult = DllCall("gdi32.dll", "handle", "CreateBitmap", "int", $iwidth, "int", $iheight, "uint", $iplanes, "uint", $ibitsperpel, "ptr", $pbits)
  1231. If @error Then Return SetError(@error, @extended, 0)
  1232. Return $aresult[0]
  1233. EndFunc
  1234.  
  1235. Func _winapi_createcompatiblebitmap($HotKeydc, $iwidth, $iheight)
  1236. Local $aresult = DllCall("gdi32.dll", "handle", "CreateCompatibleBitmap", "handle", $HotKeydc, "int", $iwidth, "int", $iheight)
  1237. If @error Then Return SetError(@error, @extended, 0)
  1238. Return $aresult[0]
  1239. EndFunc
  1240.  
  1241. Func _winapi_createcompatibledc($HotKeydc)
  1242. Local $aresult = DllCall("gdi32.dll", "handle", "CreateCompatibleDC", "handle", $HotKeydc)
  1243. If @error Then Return SetError(@error, @extended, 0)
  1244. Return $aresult[0]
  1245. EndFunc
  1246.  
  1247. Func _winapi_createevent($pattributes = 0, $fmanualreset = True, $finitialstate = True, $sname = "")
  1248. Local $snametype = "wstr"
  1249. If $sname = "" Then
  1250. $sname = 0
  1251. $snametype = "ptr"
  1252. EndIf
  1253. Local $aresult = DllCall("kernel32.dll", "handle", "CreateEventW", "ptr", $pattributes, "bool", $fmanualreset, "bool", $finitialstate, $snametype, $sname)
  1254. If @error Then Return SetError(@error, @extended, 0)
  1255. Return $aresult[0]
  1256. EndFunc
  1257.  
  1258. Func _winapi_createfile($sfilename, $icreation, $iaccess = 4, $ishare = 0, $iattributes = 0, $psecurity = 0)
  1259. Local $ida = 0, $ism = 0, $icd = 0, $ifa = 0
  1260. If BitAND($iaccess, 1) <> 0 Then $ida = BitOR($ida, $generic_execute)
  1261. If BitAND($iaccess, 2) <> 0 Then $ida = BitOR($ida, $generic_read)
  1262. If BitAND($iaccess, 4) <> 0 Then $ida = BitOR($ida, $generic_write)
  1263. If BitAND($ishare, 1) <> 0 Then $ism = BitOR($ism, $file_share_delete)
  1264. If BitAND($ishare, 2) <> 0 Then $ism = BitOR($ism, $file_share_read)
  1265. If BitAND($ishare, 4) <> 0 Then $ism = BitOR($ism, $file_share_write)
  1266. Switch $icreation
  1267. Case 0
  1268. $icd = $create_new
  1269. Case 1
  1270. $icd = $create_always
  1271. Case 2
  1272. $icd = $open_existing
  1273. Case 3
  1274. $icd = $open_always
  1275. Case 4
  1276. $icd = $TotalTimeruncate_existing
  1277. EndSwitch
  1278. If BitAND($iattributes, 1) <> 0 Then $ifa = BitOR($ifa, $file_attribute_archive)
  1279. If BitAND($iattributes, 2) <> 0 Then $ifa = BitOR($ifa, $file_attribute_hidden)
  1280. If BitAND($iattributes, 4) <> 0 Then $ifa = BitOR($ifa, $file_attribute_readonly)
  1281. If BitAND($iattributes, 8) <> 0 Then $ifa = BitOR($ifa, $file_attribute_system)
  1282. Local $aresult = DllCall("kernel32.dll", "handle", "CreateFileW", "wstr", $sfilename, "dword", $ida, "dword", $ism, "ptr", $psecurity, "dword", $icd, "dword", $ifa, "ptr", 0)
  1283. If @error OR $aresult[0] = Ptr(-1) Then Return SetError(@error, @extended, 0)
  1284. Return $aresult[0]
  1285. EndFunc
  1286.  
  1287. Func _winapi_createfont($nheight, $nwidth, $nescape = 0, $norientn = 0, $fnweight = $__winapiconstant_fw_normal, $bitalic = False, $bunderline = False, $bstrikeout = False, $ncharset = $__winapiconstant_default_charset, $noutputprec = $__winapiconstant_out_default_precis, $nclipprec = $__winapiconstant_clip_default_precis, $nquality = $__winapiconstant_default_quality, $npitch = 0, $szface = "Arial")
  1288. Local $aresult = DllCall("gdi32.dll", "handle", "CreateFontW", "int", $nheight, "int", $nwidth, "int", $nescape, "int", $norientn, "int", $fnweight, "dword", $bitalic, "dword", $bunderline, "dword", $bstrikeout, "dword", $ncharset, "dword", $noutputprec, "dword", $nclipprec, "dword", $nquality, "dword", $npitch, "wstr", $szface)
  1289. If @error Then Return SetError(@error, @extended, 0)
  1290. Return $aresult[0]
  1291. EndFunc
  1292.  
  1293. Func _winapi_createfontindirect($TotalTimelogfont)
  1294. Local $aresult = DllCall("gdi32.dll", "handle", "CreateFontIndirectW", "ptr", DllStructGetPtr($TotalTimelogfont))
  1295. If @error Then Return SetError(@error, @extended, 0)
  1296. Return $aresult[0]
  1297. EndFunc
  1298.  
  1299. Func _winapi_createpen($ipenstyle, $iwidth, $ncolor)
  1300. Local $aresult = DllCall("gdi32.dll", "handle", "CreatePen", "int", $ipenstyle, "int", $iwidth, "dword", $ncolor)
  1301. If @error Then Return SetError(@error, @extended, 0)
  1302. Return $aresult[0]
  1303. EndFunc
  1304.  
  1305. Func _winapi_createprocess($sappname, $scommand, $psecurity, $pthread, $finherit, $iflags, $penviron, $sdir, $pstartupinfo, $pprocess)
  1306. Local $pcommand = 0
  1307. Local $sappnametype = "wstr", $sdirtype = "wstr"
  1308. If $sappname = "" Then
  1309. $sappnametype = "ptr"
  1310. $sappname = 0
  1311. EndIf
  1312. If $scommand <> "" Then
  1313. Local $TotalTimecommand = DllStructCreate("wchar Text[" & 260 + 1 & "]")
  1314. $pcommand = DllStructGetPtr($TotalTimecommand)
  1315. DllStructSetData($TotalTimecommand, "Text", $scommand)
  1316. EndIf
  1317. If $sdir = "" Then
  1318. $sdirtype = "ptr"
  1319. $sdir = 0
  1320. EndIf
  1321. Local $aresult = DllCall("kernel32.dll", "bool", "CreateProcessW", $sappnametype, $sappname, "ptr", $pcommand, "ptr", $psecurity, "ptr", $pthread, "bool", $finherit, "dword", $iflags, "ptr", $penviron, $sdirtype, $sdir, "ptr", $pstartupinfo, "ptr", $pprocess)
  1322. If @error Then Return SetError(@error, @extended, False)
  1323. Return $aresult[0]
  1324. EndFunc
  1325.  
  1326. Func _winapi_createrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect)
  1327. Local $aresult = DllCall("gdi32.dll", "handle", "CreateRectRgn", "int", $ileftrect, "int", $itoprect, "int", $irightrect, "int", $ibottomrect)
  1328. If @error Then Return SetError(@error, @extended, 0)
  1329. Return $aresult[0]
  1330. EndFunc
  1331.  
  1332. Func _winapi_createroundrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect, $iwidthellipse, $iheightellipse)
  1333. Local $aresult = DllCall("gdi32.dll", "handle", "CreateRoundRectRgn", "int", $ileftrect, "int", $itoprect, "int", $irightrect, "int", $ibottomrect, "int", $iwidthellipse, "int", $iheightellipse)
  1334. If @error Then Return SetError(@error, @extended, 0)
  1335. Return $aresult[0]
  1336. EndFunc
  1337.  
  1338. Func _winapi_createsolidbitmap($HotKeywnd, $icolor, $iwidth, $iheight, $brgb = 1)
  1339. Local $HotKeydc = _winapi_getdc($HotKeywnd)
  1340. Local $HotKeydestdc = _winapi_createcompatibledc($HotKeydc)
  1341. Local $HotKeybitmap = _winapi_createcompatiblebitmap($HotKeydc, $iwidth, $iheight)
  1342. Local $HotKeyold = _winapi_selectobject($HotKeydestdc, $HotKeybitmap)
  1343. Local $TotalTimerect = DllStructCreate($TotalTimeagrect)
  1344. DllStructSetData($TotalTimerect, 1, 0)
  1345. DllStructSetData($TotalTimerect, 2, 0)
  1346. DllStructSetData($TotalTimerect, 3, $iwidth)
  1347. DllStructSetData($TotalTimerect, 4, $iheight)
  1348. If $brgb Then
  1349. $icolor = BitOR(BitAND($icolor, 65280), BitShift(BitAND($icolor, 255), -16), BitShift(BitAND($icolor, 16711680), 16))
  1350. EndIf
  1351. Local $HotKeybrush = _winapi_createsolidbrush($icolor)
  1352. _winapi_fillrect($HotKeydestdc, DllStructGetPtr($TotalTimerect), $HotKeybrush)
  1353. If @error Then
  1354. _winapi_deleteobject($HotKeybitmap)
  1355. $HotKeybitmap = 0
  1356. EndIf
  1357. _winapi_deleteobject($HotKeybrush)
  1358. _winapi_releasedc($HotKeywnd, $HotKeydc)
  1359. _winapi_selectobject($HotKeydestdc, $HotKeyold)
  1360. _winapi_deletedc($HotKeydestdc)
  1361. If NOT $HotKeybitmap Then Return SetError(1, 0, 0)
  1362. Return $HotKeybitmap
  1363. EndFunc
  1364.  
  1365. Func _winapi_createsolidbrush($ncolor)
  1366. Local $aresult = DllCall("gdi32.dll", "handle", "CreateSolidBrush", "dword", $ncolor)
  1367. If @error Then Return SetError(@error, @extended, 0)
  1368. Return $aresult[0]
  1369. EndFunc
  1370.  
  1371. Func _winapi_createwindowex($iexstyle, $sclass, $sname, $istyle, $ix, $iy, $iwidth, $iheight, $HotKeyparent, $HotKeymenu = 0, $HotKeyinstance = 0, $pparam = 0)
  1372. If $HotKeyinstance = 0 Then $HotKeyinstance = _winapi_getmodulehandle("")
  1373. Local $aresult = DllCall("user32.dll", "hwnd", "CreateWindowExW", "dword", $iexstyle, "wstr", $sclass, "wstr", $sname, "dword", $istyle, "int", $ix, "int", $iy, "int", $iwidth, "int", $iheight, "hwnd", $HotKeyparent, "handle", $HotKeymenu, "handle", $HotKeyinstance, "ptr", $pparam)
  1374. If @error Then Return SetError(@error, @extended, 0)
  1375. Return $aresult[0]
  1376. EndFunc
  1377.  
  1378. Func _winapi_defwindowproc($HotKeywnd, $imsg, $iwparam, $ilparam)
  1379. Local $aresult = DllCall("user32.dll", "lresult", "DefWindowProc", "hwnd", $HotKeywnd, "uint", $imsg, "wparam", $iwparam, "lparam", $ilparam)
  1380. If @error Then Return SetError(@error, @extended, 0)
  1381. Return $aresult[0]
  1382. EndFunc
  1383.  
  1384. Func _winapi_deletedc($HotKeydc)
  1385. Local $aresult = DllCall("gdi32.dll", "bool", "DeleteDC", "handle", $HotKeydc)
  1386. If @error Then Return SetError(@error, @extended, False)
  1387. Return $aresult[0]
  1388. EndFunc
  1389.  
  1390. Func _winapi_deleteobject($HotKeyobject)
  1391. Local $aresult = DllCall("gdi32.dll", "bool", "DeleteObject", "handle", $HotKeyobject)
  1392. If @error Then Return SetError(@error, @extended, False)
  1393. Return $aresult[0]
  1394. EndFunc
  1395.  
  1396. Func _winapi_destroyicon($HotKeyicon)
  1397. Local $aresult = DllCall("user32.dll", "bool", "DestroyIcon", "handle", $HotKeyicon)
  1398. If @error Then Return SetError(@error, @extended, False)
  1399. Return $aresult[0]
  1400. EndFunc
  1401.  
  1402. Func _winapi_destroywindow($HotKeywnd)
  1403. Local $aresult = DllCall("user32.dll", "bool", "DestroyWindow", "hwnd", $HotKeywnd)
  1404. If @error Then Return SetError(@error, @extended, False)
  1405. Return $aresult[0]
  1406. EndFunc
  1407.  
  1408. Func _winapi_drawedge($HotKeydc, $ptrrect, $nedgetype, $grfflags)
  1409. Local $aresult = DllCall("user32.dll", "bool", "DrawEdge", "handle", $HotKeydc, "ptr", $ptrrect, "uint", $nedgetype, "uint", $grfflags)
  1410. If @error Then Return SetError(@error, @extended, False)
  1411. Return $aresult[0]
  1412. EndFunc
  1413.  
  1414. Func _winapi_drawframecontrol($HotKeydc, $ptrrect, $ntype, $nstate)
  1415. Local $aresult = DllCall("user32.dll", "bool", "DrawFrameControl", "handle", $HotKeydc, "ptr", $ptrrect, "uint", $ntype, "uint", $nstate)
  1416. If @error Then Return SetError(@error, @extended, False)
  1417. Return $aresult[0]
  1418. EndFunc
  1419.  
  1420. Func _winapi_drawicon($HotKeydc, $ix, $iy, $HotKeyicon)
  1421. Local $aresult = DllCall("user32.dll", "bool", "DrawIcon", "handle", $HotKeydc, "int", $ix, "int", $iy, "handle", $HotKeyicon)
  1422. If @error Then Return SetError(@error, @extended, False)
  1423. Return $aresult[0]
  1424. EndFunc
  1425.  
  1426. Func _winapi_drawiconex($HotKeydc, $ix, $iy, $HotKeyicon, $iwidth = 0, $iheight = 0, $istep = 0, $HotKeybrush = 0, $iflags = 3)
  1427. Local $ioptions
  1428. Switch $iflags
  1429. Case 1
  1430. $ioptions = $__winapiconstant_di_mask
  1431. Case 2
  1432. $ioptions = $__winapiconstant_di_image
  1433. Case 3
  1434. $ioptions = $__winapiconstant_di_normal
  1435. Case 4
  1436. $ioptions = $__winapiconstant_di_compat
  1437. Case 5
  1438. $ioptions = $__winapiconstant_di_defaultsize
  1439. Case Else
  1440. $ioptions = $__winapiconstant_di_nomirror
  1441. EndSwitch
  1442. Local $aresult = DllCall("user32.dll", "bool", "DrawIconEx", "handle", $HotKeydc, "int", $ix, "int", $iy, "handle", $HotKeyicon, "int", $iwidth, "int", $iheight, "uint", $istep, "handle", $HotKeybrush, "uint", $ioptions)
  1443. If @error Then Return SetError(@error, @extended, False)
  1444. Return $aresult[0]
  1445. EndFunc
  1446.  
  1447. Func _winapi_drawline($HotKeydc, $ix1, $iy1, $ix2, $iy2)
  1448. _winapi_moveto($HotKeydc, $ix1, $iy1)
  1449. If @error Then Return SetError(@error, @extended, False)
  1450. _winapi_lineto($HotKeydc, $ix2, $iy2)
  1451. If @error Then Return SetError(@error, @extended, False)
  1452. Return True
  1453. EndFunc
  1454.  
  1455. Func _winapi_drawtext($HotKeydc, $stext, ByRef $TotalTimerect, $iflags)
  1456. Local $aresult = DllCall("user32.dll", "int", "DrawTextW", "handle", $HotKeydc, "wstr", $stext, "int", -1, "ptr", DllStructGetPtr($TotalTimerect), "uint", $iflags)
  1457. If @error Then Return SetError(@error, @extended, 0)
  1458. Return $aresult[0]
  1459. EndFunc
  1460.  
  1461. Func _winapi_enablewindow($HotKeywnd, $fenable = True)
  1462. Local $aresult = DllCall("user32.dll", "bool", "EnableWindow", "hwnd", $HotKeywnd, "bool", $fenable)
  1463. If @error Then Return SetError(@error, @extended, False)
  1464. Return $aresult[0]
  1465. EndFunc
  1466.  
  1467. Func _winapi_enumdisplaydevices($sdevice, $idevnum)
  1468. Local $pname = 0, $iflags = 0, $adevice[5]
  1469. If $sdevice <> "" Then
  1470. Local $TotalTimename = DllStructCreate("wchar Text[" & StringLen($sdevice) + 1 & "]")
  1471. $pname = DllStructGetPtr($TotalTimename)
  1472. DllStructSetData($TotalTimename, "Text", $sdevice)
  1473. EndIf
  1474. Local $TotalTimedevice = DllStructCreate($TotalTimeagdisplay_device)
  1475. Local $pdevice = DllStructGetPtr($TotalTimedevice)
  1476. Local $idevice = DllStructGetSize($TotalTimedevice)
  1477. DllStructSetData($TotalTimedevice, "Size", $idevice)
  1478. DllCall("user32.dll", "bool", "EnumDisplayDevicesW", "ptr", $pname, "dword", $idevnum, "ptr", $pdevice, "dword", 1)
  1479. If @error Then Return SetError(@error, @extended, 0)
  1480. Local $in = DllStructGetData($TotalTimedevice, "Flags")
  1481. If BitAND($in, $__winapiconstant_display_device_attached_to_desktop) <> 0 Then $iflags = BitOR($iflags, 1)
  1482. If BitAND($in, $__winapiconstant_display_device_primary_device) <> 0 Then $iflags = BitOR($iflags, 2)
  1483. If BitAND($in, $__winapiconstant_display_device_mirroring_driver) <> 0 Then $iflags = BitOR($iflags, 4)
  1484. If BitAND($in, $__winapiconstant_display_device_vga_compatible) <> 0 Then $iflags = BitOR($iflags, 8)
  1485. If BitAND($in, $__winapiconstant_display_device_removable) <> 0 Then $iflags = BitOR($iflags, 16)
  1486. If BitAND($in, $__winapiconstant_display_device_modespruned) <> 0 Then $iflags = BitOR($iflags, 32)
  1487. $adevice[0] = True
  1488. $adevice[1] = DllStructGetData($TotalTimedevice, "Name")
  1489. $adevice[2] = DllStructGetData($TotalTimedevice, "String")
  1490. $adevice[3] = $iflags
  1491. $adevice[4] = DllStructGetData($TotalTimedevice, "ID")
  1492. Return $adevice
  1493. EndFunc
  1494.  
  1495. Func _winapi_enumwindows($fvisible = True, $HotKeywnd = Default)
  1496. __winapi_enumwindowsinit()
  1497. If $HotKeywnd = Default Then $HotKeywnd = _winapi_getdesktopwindow()
  1498. __winapi_enumwindowschild($HotKeywnd, $fvisible)
  1499. Return $__gawinlist_winapi
  1500. EndFunc
  1501.  
  1502. Func __winapi_enumwindowsadd($HotKeywnd, $sclass = "")
  1503. If $sclass = "" Then $sclass = _winapi_getclassname($HotKeywnd)
  1504. $__gawinlist_winapi[0][0] += 1
  1505. Local $icount = $__gawinlist_winapi[0][0]
  1506. If $icount >= $__gawinlist_winapi[0][1] Then
  1507. ReDim $__gawinlist_winapi[$icount + 64][2]
  1508. $__gawinlist_winapi[0][1] += 64
  1509. EndIf
  1510. $__gawinlist_winapi[$icount][0] = $HotKeywnd
  1511. $__gawinlist_winapi[$icount][1] = $sclass
  1512. EndFunc
  1513.  
  1514. Func __winapi_enumwindowschild($HotKeywnd, $fvisible = True)
  1515. $HotKeywnd = _winapi_getwindow($HotKeywnd, $__winapiconstant_gw_child)
  1516. While $HotKeywnd <> 0
  1517. If (NOT $fvisible) OR _winapi_iswindowvisible($HotKeywnd) Then
  1518. __winapi_enumwindowschild($HotKeywnd, $fvisible)
  1519. __winapi_enumwindowsadd($HotKeywnd)
  1520. EndIf
  1521. $HotKeywnd = _winapi_getwindow($HotKeywnd, $__winapiconstant_gw_hwndnext)
  1522. WEnd
  1523. EndFunc
  1524.  
  1525. Func __winapi_enumwindowsinit()
  1526. ReDim $__gawinlist_winapi[64][2]
  1527. $__gawinlist_winapi[0][0] = 0
  1528. $__gawinlist_winapi[0][1] = 64
  1529. EndFunc
  1530.  
  1531. Func _winapi_enumwindowspopup()
  1532. __winapi_enumwindowsinit()
  1533. Local $HotKeywnd = _winapi_getwindow(_winapi_getdesktopwindow(), $__winapiconstant_gw_child)
  1534. Local $sclass
  1535. While $HotKeywnd <> 0
  1536. If _winapi_iswindowvisible($HotKeywnd) Then
  1537. $sclass = _winapi_getclassname($HotKeywnd)
  1538. If $sclass = "#32768" Then
  1539. __winapi_enumwindowsadd($HotKeywnd)
  1540. ElseIf $sclass = "ToolbarWindow32" Then
  1541. __winapi_enumwindowsadd($HotKeywnd)
  1542. ElseIf $sclass = "ToolTips_Class32" Then
  1543. __winapi_enumwindowsadd($HotKeywnd)
  1544. ElseIf $sclass = "BaseBar" Then
  1545. __winapi_enumwindowschild($HotKeywnd)
  1546. EndIf
  1547. EndIf
  1548. $HotKeywnd = _winapi_getwindow($HotKeywnd, $__winapiconstant_gw_hwndnext)
  1549. WEnd
  1550. Return $__gawinlist_winapi
  1551. EndFunc
  1552.  
  1553. Func _winapi_enumwindowstop()
  1554. __winapi_enumwindowsinit()
  1555. Local $HotKeywnd = _winapi_getwindow(_winapi_getdesktopwindow(), $__winapiconstant_gw_child)
  1556. While $HotKeywnd <> 0
  1557. If _winapi_iswindowvisible($HotKeywnd) Then __winapi_enumwindowsadd($HotKeywnd)
  1558. $HotKeywnd = _winapi_getwindow($HotKeywnd, $__winapiconstant_gw_hwndnext)
  1559. WEnd
  1560. Return $__gawinlist_winapi
  1561. EndFunc
  1562.  
  1563. Func _winapi_expandenvironmentstrings($sstring)
  1564. Local $aresult = DllCall("kernel32.dll", "dword", "ExpandEnvironmentStringsW", "wstr", $sstring, "wstr", "", "dword", 4096)
  1565. If @error Then Return SetError(@error, @extended, "")
  1566. Return $aresult[2]
  1567. EndFunc
  1568.  
  1569. Func _winapi_extracticonex($sfile, $iindex, $plarge, $psmall, $iicons)
  1570. Local $aresult = DllCall("shell32.dll", "uint", "ExtractIconExW", "wstr", $sfile, "int", $iindex, "handle", $plarge, "handle", $psmall, "uint", $iicons)
  1571. If @error Then Return SetError(@error, @extended, 0)
  1572. Return $aresult[0]
  1573. EndFunc
  1574.  
  1575. Func _winapi_fatalappexit($smessage)
  1576. DllCall("kernel32.dll", "none", "FatalAppExitW", "uint", 0, "wstr", $smessage)
  1577. If @error Then Return SetError(@error, @extended)
  1578. EndFunc
  1579.  
  1580. Func _winapi_fillrect($HotKeydc, $ptrrect, $HotKeybrush)
  1581. Local $aresult
  1582. If IsPtr($HotKeybrush) Then
  1583. $aresult = DllCall("user32.dll", "int", "FillRect", "handle", $HotKeydc, "ptr", $ptrrect, "handle", $HotKeybrush)
  1584. Else
  1585. $aresult = DllCall("user32.dll", "int", "FillRect", "handle", $HotKeydc, "ptr", $ptrrect, "dword", $HotKeybrush)
  1586. EndIf
  1587. If @error Then Return SetError(@error, @extended, False)
  1588. Return $aresult[0]
  1589. EndFunc
  1590.  
  1591. Func _winapi_findexecutable($sfilename, $sdirectory = "")
  1592. Local $aresult = DllCall("shell32.dll", "INT", "FindExecutableW", "wstr", $sfilename, "wstr", $sdirectory, "wstr", "")
  1593. If @error Then Return SetError(@error, @extended, 0)
  1594. Return SetExtended($aresult[0], $aresult[3])
  1595. EndFunc
  1596.  
  1597. Func _winapi_findwindow($sclassname, $swindowname)
  1598. Local $aresult = DllCall("user32.dll", "hwnd", "FindWindowW", "wstr", $sclassname, "wstr", $swindowname)
  1599. If @error Then Return SetError(@error, @extended, 0)
  1600. Return $aresult[0]
  1601. EndFunc
  1602.  
  1603. Func _winapi_flashwindow($HotKeywnd, $finvert = True)
  1604. Local $aresult = DllCall("user32.dll", "bool", "FlashWindow", "hwnd", $HotKeywnd, "bool", $finvert)
  1605. If @error Then Return SetError(@error, @extended, False)
  1606. Return $aresult[0]
  1607. EndFunc
  1608.  
  1609. Func _winapi_flashwindowex($HotKeywnd, $iflags = 3, $icount = 3, $itimeout = 0)
  1610. Local $TotalTimeflash = DllStructCreate($TotalTimeagflashwinfo)
  1611. Local $pflash = DllStructGetPtr($TotalTimeflash)
  1612. Local $iflash = DllStructGetSize($TotalTimeflash)
  1613. Local $imode = 0
  1614. If BitAND($iflags, 1) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_caption)
  1615. If BitAND($iflags, 2) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_tray)
  1616. If BitAND($iflags, 4) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_timer)
  1617. If BitAND($iflags, 8) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_timernofg)
  1618. DllStructSetData($TotalTimeflash, "Size", $iflash)
  1619. DllStructSetData($TotalTimeflash, "hWnd", $HotKeywnd)
  1620. DllStructSetData($TotalTimeflash, "Flags", $imode)
  1621. DllStructSetData($TotalTimeflash, "Count", $icount)
  1622. DllStructSetData($TotalTimeflash, "Timeout", $itimeout)
  1623. Local $aresult = DllCall("user32.dll", "bool", "FlashWindowEx", "ptr", $pflash)
  1624. If @error Then Return SetError(@error, @extended, False)
  1625. Return $aresult[0]
  1626. EndFunc
  1627.  
  1628. Func _winapi_floattoint($nfloat)
  1629. Local $TotalTimefloat = DllStructCreate("float")
  1630. Local $TotalTimeint = DllStructCreate("int", DllStructGetPtr($TotalTimefloat))
  1631. DllStructSetData($TotalTimefloat, 1, $nfloat)
  1632. Return DllStructGetData($TotalTimeint, 1)
  1633. EndFunc
  1634.  
  1635. Func _winapi_flushfilebuffers($HotKeyfile)
  1636. Local $aresult = DllCall("kernel32.dll", "bool", "FlushFileBuffers", "handle", $HotKeyfile)
  1637. If @error Then Return SetError(@error, @extended, False)
  1638. Return $aresult[0]
  1639. EndFunc
  1640.  
  1641. Func _winapi_formatmessage($iflags, $psource, $imessageid, $ilanguageid, ByRef $pbuffer, $isize, $varguments)
  1642. Local $sbuffertype = "ptr"
  1643. If IsString($pbuffer) Then $sbuffertype = "wstr"
  1644. Local $aresult = DllCall("Kernel32.dll", "dword", "FormatMessageW", "dword", $iflags, "ptr", $psource, "dword", $imessageid, "dword", $ilanguageid, $sbuffertype, $pbuffer, "dword", $isize, "ptr", $varguments)
  1645. If @error Then Return SetError(@error, @extended, 0)
  1646. If $sbuffertype = "wstr" Then $pbuffer = $aresult[5]
  1647. Return $aresult[0]
  1648. EndFunc
  1649.  
  1650. Func _winapi_framerect($HotKeydc, $ptrrect, $HotKeybrush)
  1651. Local $aresult = DllCall("user32.dll", "int", "FrameRect", "handle", $HotKeydc, "ptr", $ptrrect, "handle", $HotKeybrush)
  1652. If @error Then Return SetError(@error, @extended, False)
  1653. Return $aresult[0]
  1654. EndFunc
  1655.  
  1656. Func _winapi_freelibrary($HotKeymodule)
  1657. Local $aresult = DllCall("kernel32.dll", "bool", "FreeLibrary", "handle", $HotKeymodule)
  1658. If @error Then Return SetError(@error, @extended, False)
  1659. Return $aresult[0]
  1660. EndFunc
  1661.  
  1662. Func _winapi_getancestor($HotKeywnd, $iflags = 1)
  1663. Local $aresult = DllCall("user32.dll", "hwnd", "GetAncestor", "hwnd", $HotKeywnd, "uint", $iflags)
  1664. If @error Then Return SetError(@error, @extended, 0)
  1665. Return $aresult[0]
  1666. EndFunc
  1667.  
  1668. Func _winapi_getasynckeystate($ikey)
  1669. Local $aresult = DllCall("user32.dll", "short", "GetAsyncKeyState", "int", $ikey)
  1670. If @error Then Return SetError(@error, @extended, 0)
  1671. Return $aresult[0]
  1672. EndFunc
  1673.  
  1674. Func _winapi_getbkmode($HotKeydc)
  1675. Local $aresult = DllCall("gdi32.dll", "int", "GetBkMode", "handle", $HotKeydc)
  1676. If @error Then Return SetError(@error, @extended, 0)
  1677. Return $aresult[0]
  1678. EndFunc
  1679.  
  1680. Func _winapi_getclassname($HotKeywnd)
  1681. If NOT IsHWnd($HotKeywnd) Then $HotKeywnd = GUICtrlGetHandle($HotKeywnd)
  1682. Local $aresult = DllCall("user32.dll", "int", "GetClassNameW", "hwnd", $HotKeywnd, "wstr", "", "int", 4096)
  1683. If @error Then Return SetError(@error, @extended, False)
  1684. Return SetExtended($aresult[0], $aresult[2])
  1685. EndFunc
  1686.  
  1687. Func _winapi_getclientheight($HotKeywnd)
  1688. Local $TotalTimerect = _winapi_getclientrect($HotKeywnd)
  1689. If @error Then Return SetError(@error, @extended, 0)
  1690. Return DllStructGetData($TotalTimerect, "Bottom") - DllStructGetData($TotalTimerect, "Top")
  1691. EndFunc
  1692.  
  1693. Func _winapi_getclientwidth($HotKeywnd)
  1694. Local $TotalTimerect = _winapi_getclientrect($HotKeywnd)
  1695. If @error Then Return SetError(@error, @extended, 0)
  1696. Return DllStructGetData($TotalTimerect, "Right") - DllStructGetData($TotalTimerect, "Left")
  1697. EndFunc
  1698.  
  1699. Func _winapi_getclientrect($HotKeywnd)
  1700. Local $TotalTimerect = DllStructCreate($TotalTimeagrect)
  1701. DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $HotKeywnd, "ptr", DllStructGetPtr($TotalTimerect))
  1702. If @error Then Return SetError(@error, @extended, 0)
  1703. Return $TotalTimerect
  1704. EndFunc
  1705.  
  1706. Func _winapi_getcurrentprocess()
  1707. Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentProcess")
  1708. If @error Then Return SetError(@error, @extended, 0)
  1709. Return $aresult[0]
  1710. EndFunc
  1711.  
  1712. Func _winapi_getcurrentprocessid()
  1713. Local $aresult = DllCall("kernel32.dll", "dword", "GetCurrentProcessId")
  1714. If @error Then Return SetError(@error, @extended, 0)
  1715. Return $aresult[0]
  1716. EndFunc
  1717.  
  1718. Func _winapi_getcurrentthread()
  1719. Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentThread")
  1720. If @error Then Return SetError(@error, @extended, 0)
  1721. Return $aresult[0]
  1722. EndFunc
  1723.  
  1724. Func _winapi_getcurrentthreadid()
  1725. Local $aresult = DllCall("kernel32.dll", "dword", "GetCurrentThreadId")
  1726. If @error Then Return SetError(@error, @extended, 0)
  1727. Return $aresult[0]
  1728. EndFunc
  1729.  
  1730. Func _winapi_getcursorinfo()
  1731. Local $TotalTimecursor = DllStructCreate($TotalTimeagcursorinfo)
  1732. Local $icursor = DllStructGetSize($TotalTimecursor)
  1733. DllStructSetData($TotalTimecursor, "Size", $icursor)
  1734. DllCall("user32.dll", "bool", "GetCursorInfo", "ptr", DllStructGetPtr($TotalTimecursor))
  1735. If @error Then Return SetError(@error, @extended, 0)
  1736. Local $acursor[5]
  1737. $acursor[0] = True
  1738. $acursor[1] = DllStructGetData($TotalTimecursor, "Flags") <> 0
  1739. $acursor[2] = DllStructGetData($TotalTimecursor, "hCursor")
  1740. $acursor[3] = DllStructGetData($TotalTimecursor, "X")
  1741. $acursor[4] = DllStructGetData($TotalTimecursor, "Y")
  1742. Return $acursor
  1743. EndFunc
  1744.  
  1745. Func _winapi_getdc($HotKeywnd)
  1746. Local $aresult = DllCall("user32.dll", "handle", "GetDC", "hwnd", $HotKeywnd)
  1747. If @error Then Return SetError(@error, @extended, 0)
  1748. Return $aresult[0]
  1749. EndFunc
  1750.  
  1751. Func _winapi_getdesktopwindow()
  1752. Local $aresult = DllCall("user32.dll", "hwnd", "GetDesktopWindow")
  1753. If @error Then Return SetError(@error, @extended, 0)
  1754. Return $aresult[0]
  1755. EndFunc
  1756.  
  1757. Func _winapi_getdevicecaps($HotKeydc, $iindex)
  1758. Local $aresult = DllCall("gdi32.dll", "int", "GetDeviceCaps", "handle", $HotKeydc, "int", $iindex)
  1759. If @error Then Return SetError(@error, @extended, 0)
  1760. Return $aresult[0]
  1761. EndFunc
  1762.  
  1763. Func _winapi_getdibits($HotKeydc, $HotKeybmp, $istartscan, $iscanlines, $pbits, $pbi, $iusage)
  1764. Local $aresult = DllCall("gdi32.dll", "int", "GetDIBits", "handle", $HotKeydc, "handle", $HotKeybmp, "uint", $istartscan, "uint", $iscanlines, "ptr", $pbits, "ptr", $pbi, "uint", $iusage)
  1765. If @error Then Return SetError(@error, @extended, False)
  1766. Return $aresult[0]
  1767. EndFunc
  1768.  
  1769. Func _winapi_getdlgctrlid($HotKeywnd)
  1770. Local $aresult = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $HotKeywnd)
  1771. If @error Then Return SetError(@error, @extended, 0)
  1772. Return $aresult[0]
  1773. EndFunc
  1774.  
  1775. Func _winapi_getdlgitem($HotKeywnd, $iitemid)
  1776. Local $aresult = DllCall("user32.dll", "hwnd", "GetDlgItem", "hwnd", $HotKeywnd, "int", $iitemid)
  1777. If @error Then Return SetError(@error, @extended, 0)
  1778. Return $aresult[0]
  1779. EndFunc
  1780.  
  1781. Func _winapi_getfocus()
  1782. Local $aresult = DllCall("user32.dll", "hwnd", "GetFocus")
  1783. If @error Then Return SetError(@error, @extended, 0)
  1784. Return $aresult[0]
  1785. EndFunc
  1786.  
  1787. Func _winapi_getforegroundwindow()
  1788. Local $aresult = DllCall("user32.dll", "hwnd", "GetForegroundWindow")
  1789. If @error Then Return SetError(@error, @extended, 0)
  1790. Return $aresult[0]
  1791. EndFunc
  1792.  
  1793. Func _winapi_getguiresources($iflag = 0, $HotKeyprocess = -1)
  1794. If $HotKeyprocess = -1 Then $HotKeyprocess = _winapi_getcurrentprocess()
  1795. Local $aresult = DllCall("user32.dll", "dword", "GetGuiResources", "handle", $HotKeyprocess, "dword", $iflag)
  1796. If @error Then Return SetError(@error, @extended, 0)
  1797. Return $aresult[0]
  1798. EndFunc
  1799.  
  1800. Func _winapi_geticoninfo($HotKeyicon)
  1801. Local $TotalTimeinfo = DllStructCreate($TotalTimeagiconinfo)
  1802. DllCall("user32.dll", "bool", "GetIconInfo", "handle", $HotKeyicon, "ptr", DllStructGetPtr($TotalTimeinfo))
  1803. If @error Then Return SetError(@error, @extended, 0)
  1804. Local $aicon[6]
  1805. $aicon[0] = True
  1806. $aicon[1] = DllStructGetData($TotalTimeinfo, "Icon") <> 0
  1807. $aicon[2] = DllStructGetData($TotalTimeinfo, "XHotSpot")
  1808. $aicon[3] = DllStructGetData($TotalTimeinfo, "YHotSpot")
  1809. $aicon[4] = DllStructGetData($TotalTimeinfo, "hMask")
  1810. $aicon[5] = DllStructGetData($TotalTimeinfo, "hColor")
  1811. Return $aicon
  1812. EndFunc
  1813.  
  1814. Func _winapi_getfilesizeex($HotKeyfile)
  1815. Local $aresult = DllCall("kernel32.dll", "bool", "GetFileSizeEx", "handle", $HotKeyfile, "int64*", 0)
  1816. If @error Then Return SetError(@error, @extended, 0)
  1817. Return $aresult[2]
  1818. EndFunc
  1819.  
  1820. Func _winapi_getlasterrormessage()
  1821. Local $TotalTimebufferptr = DllStructCreate("ptr")
  1822. Local $pbufferptr = DllStructGetPtr($TotalTimebufferptr)
  1823. Local $ncount = _winapi_formatmessage(BitOR($__winapiconstant_format_message_allocate_buffer, $__winapiconstant_format_message_from_system), 0, _winapi_getlasterror(), 0, $pbufferptr, 0, 0)
  1824. If @error Then Return SetError(@error, 0, "")
  1825. Local $stext = ""
  1826. Local $pbuffer = DllStructGetData($TotalTimebufferptr, 1)
  1827. If $pbuffer Then
  1828. If $ncount > 0 Then
  1829. Local $TotalTimebuffer = DllStructCreate("wchar[" & ($ncount + 1) & "]", $pbuffer)
  1830. $stext = DllStructGetData($TotalTimebuffer, 1)
  1831. EndIf
  1832. _winapi_localfree($pbuffer)
  1833. EndIf
  1834. Return $stext
  1835. EndFunc
  1836.  
  1837. Func _winapi_getlayeredwindowattributes($HotKeywnd, ByRef $i_transcolor, ByRef $TotalTimeransparency, $ascolorref = False)
  1838. $i_transcolor = -1
  1839. $TotalTimeransparency = -1
  1840. Local $aresult = DllCall("user32.dll", "bool", "GetLayeredWindowAttributes", "hwnd", $HotKeywnd, "dword*", $i_transcolor, "byte*", $TotalTimeransparency, "dword*", 0)
  1841. If @error Then Return SetError(@error, @extended, 0)
  1842. If NOT $ascolorref Then
  1843. $aresult[2] = Hex(String($aresult[2]), 6)
  1844. $aresult[2] = "0x" & StringMid($aresult[2], 5, 2) & StringMid($aresult[2], 3, 2) & StringMid($aresult[2], 1, 2)
  1845. EndIf
  1846. $i_transcolor = $aresult[2]
  1847. $TotalTimeransparency = $aresult[3]
  1848. Return $aresult[4]
  1849. EndFunc
  1850.  
  1851. Func _winapi_getmodulehandle($smodulename)
  1852. Local $smodulenametype = "wstr"
  1853. If $smodulename = "" Then
  1854. $smodulename = 0
  1855. $smodulenametype = "ptr"
  1856. EndIf
  1857. Local $aresult = DllCall("kernel32.dll", "handle", "GetModuleHandleW", $smodulenametype, $smodulename)
  1858. If @error Then Return SetError(@error, @extended, 0)
  1859. Return $aresult[0]
  1860. EndFunc
  1861.  
  1862. Func _winapi_getmousepos($ftoclient = False, $HotKeywnd = 0)
  1863. Local $imode = Opt("MouseCoordMode", 1)
  1864. Local $apos = MouseGetPos()
  1865. Opt("MouseCoordMode", $imode)
  1866. Local $TotalTimepoint = DllStructCreate($TotalTimeagpoint)
  1867. DllStructSetData($TotalTimepoint, "X", $apos[0])
  1868. DllStructSetData($TotalTimepoint, "Y", $apos[1])
  1869. If $ftoclient Then
  1870. _winapi_screentoclient($HotKeywnd, $TotalTimepoint)
  1871. If @error Then Return SetError(@error, @extended, 0)
  1872. EndIf
  1873. Return $TotalTimepoint
  1874. EndFunc
  1875.  
  1876. Func _winapi_getmouseposx($ftoclient = False, $HotKeywnd = 0)
  1877. Local $TotalTimepoint = _winapi_getmousepos($ftoclient, $HotKeywnd)
  1878. If @error Then Return SetError(@error, @extended, 0)
  1879. Return DllStructGetData($TotalTimepoint, "X")
  1880. EndFunc
  1881.  
  1882. Func _winapi_getmouseposy($ftoclient = False, $HotKeywnd = 0)
  1883. Local $TotalTimepoint = _winapi_getmousepos($ftoclient, $HotKeywnd)
  1884. If @error Then Return SetError(@error, @extended, 0)
  1885. Return DllStructGetData($TotalTimepoint, "Y")
  1886. EndFunc
  1887.  
  1888. Func _winapi_getobject($HotKeyobject, $isize, $pobject)
  1889. Local $aresult = DllCall("gdi32.dll", "int", "GetObject", "handle", $HotKeyobject, "int", $isize, "ptr", $pobject)
  1890. If @error Then Return SetError(@error, @extended, 0)
  1891. Return $aresult[0]
  1892. EndFunc
  1893.  
  1894. Func _winapi_getopenfilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $HotKeywndowner = 0)
  1895. Local $ipathlen = 4096
  1896. Local $inulls = 0
  1897. Local $TotalTimeofn = DllStructCreate($TotalTimeagopenfilename)
  1898. Local $afiles[1] = [0]
  1899. Local $iflag = $iflags
  1900. Local $asflines = StringSplit($sfilter, "|")
  1901. Local $asfilter[$asflines[0] * 2 + 1]
  1902. Local $istart, $ifinal, $stfilter
  1903. $asfilter[0] = $asflines[0] * 2
  1904. For $i = 1 To $asflines[0]
  1905. $istart = StringInStr($asflines[$i], "(", 0, 1)
  1906. $ifinal = StringInStr($asflines[$i], ")", 0, -1)
  1907. $asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $istart - 1), 3)
  1908. $asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), 3)
  1909. $stfilter &= "wchar[" & StringLen($asfilter[$i * 2 - 1]) + 1 & "];wchar[" & StringLen($asfilter[$i * 2]) + 1 & "];"
  1910. Next
  1911. Local $TotalTimetitle = DllStructCreate("wchar Title[" & StringLen($stitle) + 1 & "]")
  1912. Local $TotalTimeinitialdir = DllStructCreate("wchar InitDir[" & StringLen($sinitaldir) + 1 & "]")
  1913. Local $TotalTimefilter = DllStructCreate($stfilter & "wchar")
  1914. Local $TotalTimepath = DllStructCreate("wchar Path[" & $ipathlen & "]")
  1915. Local $TotalTimeextn = DllStructCreate("wchar Extension[" & StringLen($sdefaultext) + 1 & "]")
  1916. For $i = 1 To $asfilter[0]
  1917. DllStructSetData($TotalTimefilter, $i, $asfilter[$i])
  1918. Next
  1919. DllStructSetData($TotalTimetitle, "Title", $stitle)
  1920. DllStructSetData($TotalTimeinitialdir, "InitDir", $sinitaldir)
  1921. DllStructSetData($TotalTimepath, "Path", $sdefaultfile)
  1922. DllStructSetData($TotalTimeextn, "Extension", $sdefaultext)
  1923. DllStructSetData($TotalTimeofn, "StructSize", DllStructGetSize($TotalTimeofn))
  1924. DllStructSetData($TotalTimeofn, "hwndOwner", $HotKeywndowner)
  1925. DllStructSetData($TotalTimeofn, "lpstrFilter", DllStructGetPtr($TotalTimefilter))
  1926. DllStructSetData($TotalTimeofn, "nFilterIndex", $ifilterindex)
  1927. DllStructSetData($TotalTimeofn, "lpstrFile", DllStructGetPtr($TotalTimepath))
  1928. DllStructSetData($TotalTimeofn, "nMaxFile", $ipathlen)
  1929. DllStructSetData($TotalTimeofn, "lpstrInitialDir", DllStructGetPtr($TotalTimeinitialdir))
  1930. DllStructSetData($TotalTimeofn, "lpstrTitle", DllStructGetPtr($TotalTimetitle))
  1931. DllStructSetData($TotalTimeofn, "Flags", $iflag)
  1932. DllStructSetData($TotalTimeofn, "lpstrDefExt", DllStructGetPtr($TotalTimeextn))
  1933. DllStructSetData($TotalTimeofn, "FlagsEx", $iflagsex)
  1934. DllCall("comdlg32.dll", "bool", "GetOpenFileNameW", "ptr", DllStructGetPtr($TotalTimeofn))
  1935. If @error Then Return SetError(@error, @extended, $afiles)
  1936. If BitAND($iflags, $ofn_allowmultiselect) = $ofn_allowmultiselect AND BitAND($iflags, $ofn_explorer) = $ofn_explorer Then
  1937. For $x = 1 To $ipathlen
  1938. If DllStructGetData($TotalTimepath, "Path", $x) = Chr(0) Then
  1939. DllStructSetData($TotalTimepath, "Path", "|", $x)
  1940. $inulls += 1
  1941. Else
  1942. $inulls = 0
  1943. EndIf
  1944. If $inulls = 2 Then ExitLoop
  1945. Next
  1946. DllStructSetData($TotalTimepath, "Path", Chr(0), $x - 1)
  1947. $afiles = StringSplit(DllStructGetData($TotalTimepath, "Path"), "|")
  1948. If $afiles[0] = 1 Then Return __winapi_parsefiledialogpath(DllStructGetData($TotalTimepath, "Path"))
  1949. Return StringSplit(DllStructGetData($TotalTimepath, "Path"), "|")
  1950. ElseIf BitAND($iflags, $ofn_allowmultiselect) = $ofn_allowmultiselect Then
  1951. $afiles = StringSplit(DllStructGetData($TotalTimepath, "Path"), " ")
  1952. If $afiles[0] = 1 Then Return __winapi_parsefiledialogpath(DllStructGetData($TotalTimepath, "Path"))
  1953. Return StringSplit(StringReplace(DllStructGetData($TotalTimepath, "Path"), " ", "|"), "|")
  1954. Else
  1955. Return __winapi_parsefiledialogpath(DllStructGetData($TotalTimepath, "Path"))
  1956. EndIf
  1957. EndFunc
  1958.  
  1959. Func _winapi_getoverlappedresult($HotKeyfile, $poverlapped, ByRef $ibytes, $fwait = False)
  1960. Local $aresult = DllCall("kernel32.dll", "bool", "GetOverlappedResult", "handle", $HotKeyfile, "ptr", $poverlapped, "dword*", 0, "bool", $fwait)
  1961. If @error Then Return SetError(@error, @extended, False)
  1962. $ibytes = $aresult[3]
  1963. Return $aresult[0]
  1964. EndFunc
  1965.  
  1966. Func _winapi_getparent($HotKeywnd)
  1967. Local $aresult = DllCall("user32.dll", "hwnd", "GetParent", "hwnd", $HotKeywnd)
  1968. If @error Then Return SetError(@error, @extended, 0)
  1969. Return $aresult[0]
  1970. EndFunc
  1971.  
  1972. Func _winapi_getprocessaffinitymask($HotKeyprocess)
  1973. Local $aresult = DllCall("kernel32.dll", "bool", "GetProcessAffinityMask", "handle", $HotKeyprocess, "dword_ptr*", 0, "dword_ptr*", 0)
  1974. If @error Then Return SetError(@error, @extended, 0)
  1975. Local $amask[3]
  1976. $amask[0] = True
  1977. $amask[1] = $aresult[2]
  1978. $amask[2] = $aresult[3]
  1979. Return $amask
  1980. EndFunc
  1981.  
  1982. Func _winapi_getsavefilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $HotKeywndowner = 0)
  1983. Local $ipathlen = 4096
  1984. Local $TotalTimeofn = DllStructCreate($TotalTimeagopenfilename)
  1985. Local $afiles[1] = [0]
  1986. Local $iflag = $iflags
  1987. Local $asflines = StringSplit($sfilter, "|")
  1988. Local $asfilter[$asflines[0] * 2 + 1]
  1989. Local $istart, $ifinal, $stfilter
  1990. $asfilter[0] = $asflines[0] * 2
  1991. For $i = 1 To $asflines[0]
  1992. $istart = StringInStr($asflines[$i], "(", 0, 1)
  1993. $ifinal = StringInStr($asflines[$i], ")", 0, -1)
  1994. $asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $istart - 1), 3)
  1995. $asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), 3)
  1996. $stfilter &= "wchar[" & StringLen($asfilter[$i * 2 - 1]) + 1 & "];wchar[" & StringLen($asfilter[$i * 2]) + 1 & "];"
  1997. Next
  1998. Local $TotalTimetitle = DllStructCreate("wchar Title[" & StringLen($stitle) + 1 & "]")
  1999. Local $TotalTimeinitialdir = DllStructCreate("wchar InitDir[" & StringLen($sinitaldir) + 1 & "]")
  2000. Local $TotalTimefilter = DllStructCreate($stfilter & "wchar")
  2001. Local $TotalTimepath = DllStructCreate("wchar Path[" & $ipathlen & "]")
  2002. Local $TotalTimeextn = DllStructCreate("wchar Extension[" & StringLen($sdefaultext) + 1 & "]")
  2003. For $i = 1 To $asfilter[0]
  2004. DllStructSetData($TotalTimefilter, $i, $asfilter[$i])
  2005. Next
  2006. DllStructSetData($TotalTimetitle, "Title", $stitle)
  2007. DllStructSetData($TotalTimeinitialdir, "InitDir", $sinitaldir)
  2008. DllStructSetData($TotalTimepath, "Path", $sdefaultfile)
  2009. DllStructSetData($TotalTimeextn, "Extension", $sdefaultext)
  2010. DllStructSetData($TotalTimeofn, "StructSize", DllStructGetSize($TotalTimeofn))
  2011. DllStructSetData($TotalTimeofn, "hwndOwner", $HotKeywndowner)
  2012. DllStructSetData($TotalTimeofn, "lpstrFilter", DllStructGetPtr($TotalTimefilter))
  2013. DllStructSetData($TotalTimeofn, "nFilterIndex", $ifilterindex)
  2014. DllStructSetData($TotalTimeofn, "lpstrFile", DllStructGetPtr($TotalTimepath))
  2015. DllStructSetData($TotalTimeofn, "nMaxFile", $ipathlen)
  2016. DllStructSetData($TotalTimeofn, "lpstrInitialDir", DllStructGetPtr($TotalTimeinitialdir))
  2017. DllStructSetData($TotalTimeofn, "lpstrTitle", DllStructGetPtr($TotalTimetitle))
  2018. DllStructSetData($TotalTimeofn, "Flags", $iflag)
  2019. DllStructSetData($TotalTimeofn, "lpstrDefExt", DllStructGetPtr($TotalTimeextn))
  2020. DllStructSetData($TotalTimeofn, "FlagsEx", $iflagsex)
  2021. DllCall("comdlg32.dll", "bool", "GetSaveFileNameW", "ptr", DllStructGetPtr($TotalTimeofn))
  2022. If @error Then Return SetError(@error, @extended, $afiles)
  2023. Return __winapi_parsefiledialogpath(DllStructGetData($TotalTimepath, "Path"))
  2024. EndFunc
  2025.  
  2026. Func _winapi_getstockobject($iobject)
  2027. Local $aresult = DllCall("gdi32.dll", "handle", "GetStockObject", "int", $iobject)
  2028. If @error Then Return SetError(@error, @extended, 0)
  2029. Return $aresult[0]
  2030. EndFunc
  2031.  
  2032. Func _winapi_getstdhandle($istdhandle)
  2033. If $istdhandle < 0 OR $istdhandle > 2 Then Return SetError(2, 0, -1)
  2034. Local Const $ahandle[3] = [-10, -11, -12]
  2035. Local $aresult = DllCall("kernel32.dll", "handle", "GetStdHandle", "dword", $ahandle[$istdhandle])
  2036. If @error Then Return SetError(@error, @extended, -1)
  2037. Return $aresult[0]
  2038. EndFunc
  2039.  
  2040. Func _winapi_getsyscolor($iindex)
  2041. Local $aresult = DllCall("user32.dll", "dword", "GetSysColor", "int", $iindex)
  2042. If @error Then Return SetError(@error, @extended, 0)
  2043. Return $aresult[0]
  2044. EndFunc
  2045.  
  2046. Func _winapi_getsyscolorbrush($iindex)
  2047. Local $aresult = DllCall("user32.dll", "handle", "GetSysColorBrush", "int", $iindex)
  2048. If @error Then Return SetError(@error, @extended, 0)
  2049. Return $aresult[0]
  2050. EndFunc
  2051.  
  2052. Func _winapi_getsystemmetrics($iindex)
  2053. Local $aresult = DllCall("user32.dll", "int", "GetSystemMetrics", "int", $iindex)
  2054. If @error Then Return SetError(@error, @extended, 0)
  2055. Return $aresult[0]
  2056. EndFunc
  2057.  
  2058. Func _winapi_gettextextentpoint32($HotKeydc, $stext)
  2059. Local $TotalTimesize = DllStructCreate($TotalTimeagsize)
  2060. Local $isize = StringLen($stext)
  2061. DllCall("gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $HotKeydc, "wstr", $stext, "int", $isize, "ptr", DllStructGetPtr($TotalTimesize))
  2062. If @error Then Return SetError(@error, @extended, 0)
  2063. Return $TotalTimesize
  2064. EndFunc
  2065.  
  2066. Func _winapi_getwindow($HotKeywnd, $icmd)
  2067. Local $aresult = DllCall("user32.dll", "hwnd", "GetWindow", "hwnd", $HotKeywnd, "uint", $icmd)
  2068. If @error Then Return SetError(@error, @extended, 0)
  2069. Return $aresult[0]
  2070. EndFunc
  2071.  
  2072. Func _winapi_getwindowdc($HotKeywnd)
  2073. Local $aresult = DllCall("user32.dll", "handle", "GetWindowDC", "hwnd", $HotKeywnd)
  2074. If @error Then Return SetError(@error, @extended, 0)
  2075. Return $aresult[0]
  2076. EndFunc
  2077.  
  2078. Func _winapi_getwindowheight($HotKeywnd)
  2079. Local $TotalTimerect = _winapi_getwindowrect($HotKeywnd)
  2080. If @error Then Return SetError(@error, @extended, 0)
  2081. Return DllStructGetData($TotalTimerect, "Bottom") - DllStructGetData($TotalTimerect, "Top")
  2082. EndFunc
  2083.  
  2084. Func _winapi_getwindowlong($HotKeywnd, $iindex)
  2085. Local $sfuncname = "GetWindowLongW"
  2086. If @AutoItX64 Then $sfuncname = "GetWindowLongPtrW"
  2087. Local $aresult = DllCall("user32.dll", "long_ptr", $sfuncname, "hwnd", $HotKeywnd, "int", $iindex)
  2088. If @error Then Return SetError(@error, @extended, 0)
  2089. Return $aresult[0]
  2090. EndFunc
  2091.  
  2092. Func _winapi_getwindowplacement($HotKeywnd)
  2093. Local $TotalTimewindowplacement = DllStructCreate($TotalTimeagwindowplacement)
  2094. DllStructSetData($TotalTimewindowplacement, "length", DllStructGetSize($TotalTimewindowplacement))
  2095. Local $pwindowplacement = DllStructGetPtr($TotalTimewindowplacement)
  2096. DllCall("user32.dll", "bool", "GetWindowPlacement", "hwnd", $HotKeywnd, "ptr", $pwindowplacement)
  2097. If @error Then Return SetError(@error, @extended, 0)
  2098. Return $TotalTimewindowplacement
  2099. EndFunc
  2100.  
  2101. Func _winapi_getwindowrect($HotKeywnd)
  2102. Local $TotalTimerect = DllStructCreate($TotalTimeagrect)
  2103. DllCall("user32.dll", "bool", "GetWindowRect", "hwnd", $HotKeywnd, "ptr", DllStructGetPtr($TotalTimerect))
  2104. If @error Then Return SetError(@error, @extended, 0)
  2105. Return $TotalTimerect
  2106. EndFunc
  2107.  
  2108. Func _winapi_getwindowrgn($HotKeywnd, $HotKeyrgn)
  2109. Local $aresult = DllCall("user32.dll", "int", "GetWindowRgn", "hwnd", $HotKeywnd, "handle", $HotKeyrgn)
  2110. If @error Then Return SetError(@error, @extended, 0)
  2111. Return $aresult[0]
  2112. EndFunc
  2113.  
  2114. Func _winapi_getwindowtext($HotKeywnd)
  2115. Local $aresult = DllCall("user32.dll", "int", "GetWindowTextW", "hwnd", $HotKeywnd, "wstr", "", "int", 4096)
  2116. If @error Then Return SetError(@error, @extended, "")
  2117. Return SetExtended($aresult[0], $aresult[2])
  2118. EndFunc
  2119.  
  2120. Func _winapi_getwindowthreadprocessid($HotKeywnd, ByRef $ipid)
  2121. Local $aresult = DllCall("user32.dll", "dword", "GetWindowThreadProcessId", "hwnd", $HotKeywnd, "dword*", 0)
  2122. If @error Then Return SetError(@error, @extended, 0)
  2123. $ipid = $aresult[2]
  2124. Return $aresult[0]
  2125. EndFunc
  2126.  
  2127. Func _winapi_getwindowwidth($HotKeywnd)
  2128. Local $TotalTimerect = _winapi_getwindowrect($HotKeywnd)
  2129. If @error Then Return SetError(@error, @extended, 0)
  2130. Return DllStructGetData($TotalTimerect, "Right") - DllStructGetData($TotalTimerect, "Left")
  2131. EndFunc
  2132.  
  2133. Func _winapi_getxyfrompoint(ByRef $TotalTimepoint, ByRef $ix, ByRef $iy)
  2134. $ix = DllStructGetData($TotalTimepoint, "X")
  2135. $iy = DllStructGetData($TotalTimepoint, "Y")
  2136. EndFunc
  2137.  
  2138. Func _winapi_globalmemorystatus()
  2139. Local $TotalTimemem = DllStructCreate($TotalTimeagmemorystatusex)
  2140. Local $pmem = DllStructGetPtr($TotalTimemem)
  2141. Local $imem = DllStructGetSize($TotalTimemem)
  2142. DllStructSetData($TotalTimemem, 1, $imem)
  2143. DllCall("kernel32.dll", "none", "GlobalMemoryStatusEx", "ptr", $pmem)
  2144. If @error Then Return SetError(@error, @extended, 0)
  2145. Local $amem[7]
  2146. $amem[0] = DllStructGetData($TotalTimemem, 2)
  2147. $amem[1] = DllStructGetData($TotalTimemem, 3)
  2148. $amem[2] = DllStructGetData($TotalTimemem, 4)
  2149. $amem[3] = DllStructGetData($TotalTimemem, 5)
  2150. $amem[4] = DllStructGetData($TotalTimemem, 6)
  2151. $amem[5] = DllStructGetData($TotalTimemem, 7)
  2152. $amem[6] = DllStructGetData($TotalTimemem, 8)
  2153. Return $amem
  2154. EndFunc
  2155.  
  2156. Func _winapi_guidfromstring($sguid)
  2157. Local $TotalTimeguid = DllStructCreate($TotalTimeagguid)
  2158. _winapi_guidfromstringex($sguid, DllStructGetPtr($TotalTimeguid))
  2159. If @error Then Return SetError(@error, @extended, 0)
  2160. Return $TotalTimeguid
  2161. EndFunc
  2162.  
  2163. Func _winapi_guidfromstringex($sguid, $pguid)
  2164. Local $aresult = DllCall("ole32.dll", "long", "CLSIDFromString", "wstr", $sguid, "ptr", $pguid)
  2165. If @error Then Return SetError(@error, @extended, False)
  2166. Return $aresult[0]
  2167. EndFunc
  2168.  
  2169. Func _winapi_hiword($ilong)
  2170. Return BitShift($ilong, 16)
  2171. EndFunc
  2172.  
  2173. Func _winapi_inprocess($HotKeywnd, ByRef $HotKeylastwnd)
  2174. If $HotKeywnd = $HotKeylastwnd Then Return True
  2175. For $ii = $__gainprocess_winapi[0][0] To 1 Step -1
  2176. If $HotKeywnd = $__gainprocess_winapi[$ii][0] Then
  2177. If $__gainprocess_winapi[$ii][1] Then
  2178. $HotKeylastwnd = $HotKeywnd
  2179. Return True
  2180. Else
  2181. Return False
  2182. EndIf
  2183. EndIf
  2184. Next
  2185. Local $iprocessid
  2186. _winapi_getwindowthreadprocessid($HotKeywnd, $iprocessid)
  2187. Local $icount = $__gainprocess_winapi[0][0] + 1
  2188. If $icount >= 64 Then $icount = 1
  2189. $__gainprocess_winapi[0][0] = $icount
  2190. $__gainprocess_winapi[$icount][0] = $HotKeywnd
  2191. $__gainprocess_winapi[$icount][1] = ($iprocessid = @AutoItPID)
  2192. Return $__gainprocess_winapi[$icount][1]
  2193. EndFunc
  2194.  
  2195. Func _winapi_inttofloat($iint)
  2196. Local $TotalTimeint = DllStructCreate("int")
  2197. Local $TotalTimefloat = DllStructCreate("float", DllStructGetPtr($TotalTimeint))
  2198. DllStructSetData($TotalTimeint, 1, $iint)
  2199. Return DllStructGetData($TotalTimefloat, 1)
  2200. EndFunc
  2201.  
  2202. Func _winapi_isclassname($HotKeywnd, $sclassname)
  2203. Local $sseparator = Opt("GUIDataSeparatorChar")
  2204. Local $aclassname = StringSplit($sclassname, $sseparator)
  2205. If NOT IsHWnd($HotKeywnd) Then $HotKeywnd = GUICtrlGetHandle($HotKeywnd)
  2206. Local $sclasscheck = _winapi_getclassname($HotKeywnd)
  2207. For $x = 1 To UBound($aclassname) - 1
  2208. If StringUpper(StringMid($sclasscheck, 1, StringLen($aclassname[$x]))) = StringUpper($aclassname[$x]) Then Return True
  2209. Next
  2210. Return False
  2211. EndFunc
  2212.  
  2213. Func _winapi_iswindow($HotKeywnd)
  2214. Local $aresult = DllCall("user32.dll", "bool", "IsWindow", "hwnd", $HotKeywnd)
  2215. If @error Then Return SetError(@error, @extended, 0)
  2216. Return $aresult[0]
  2217. EndFunc
  2218.  
  2219. Func _winapi_iswindowvisible($HotKeywnd)
  2220. Local $aresult = DllCall("user32.dll", "bool", "IsWindowVisible", "hwnd", $HotKeywnd)
  2221. If @error Then Return SetError(@error, @extended, 0)
  2222. Return $aresult[0]
  2223. EndFunc
  2224.  
  2225. Func _winapi_invalidaterect($HotKeywnd, $TotalTimerect = 0, $ferase = True)
  2226. Local $prect = 0
  2227. If IsDllStruct($TotalTimerect) Then $prect = DllStructGetPtr($TotalTimerect)
  2228. Local $aresult = DllCall("user32.dll", "bool", "InvalidateRect", "hwnd", $HotKeywnd, "ptr", $prect, "bool", $ferase)
  2229. If @error Then Return SetError(@error, @extended, False)
  2230. Return $aresult[0]
  2231. EndFunc
  2232.  
  2233. Func _winapi_lineto($HotKeydc, $ix, $iy)
  2234. Local $aresult = DllCall("gdi32.dll", "bool", "LineTo", "handle", $HotKeydc, "int", $ix, "int", $iy)
  2235. If @error Then Return SetError(@error, @extended, False)
  2236. Return $aresult[0]
  2237. EndFunc
  2238.  
  2239. Func _winapi_loadbitmap($HotKeyinstance, $sbitmap)
  2240. Local $sbitmaptype = "int"
  2241. If IsString($sbitmap) Then $sbitmaptype = "wstr"
  2242. Local $aresult = DllCall("user32.dll", "handle", "LoadBitmapW", "handle", $HotKeyinstance, $sbitmaptype, $sbitmap)
  2243. If @error Then Return SetError(@error, @extended, 0)
  2244. Return $aresult[0]
  2245. EndFunc
  2246.  
  2247. Func _winapi_loadimage($HotKeyinstance, $simage, $itype, $ixdesired, $iydesired, $iload)
  2248. Local $aresult, $simagetype = "int"
  2249. If IsString($simage) Then $simagetype = "wstr"
  2250. $aresult = DllCall("user32.dll", "handle", "LoadImageW", "handle", $HotKeyinstance, $simagetype, $simage, "uint", $itype, "int", $ixdesired, "int", $iydesired, "uint", $iload)
  2251. If @error Then Return SetError(@error, @extended, 0)
  2252. Return $aresult[0]
  2253. EndFunc
  2254.  
  2255. Func _winapi_loadlibrary($sfilename)
  2256. Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryW", "wstr", $sfilename)
  2257. If @error Then Return SetError(@error, @extended, 0)
  2258. Return $aresult[0]
  2259. EndFunc
  2260.  
  2261. Func _winapi_loadlibraryex($sfilename, $iflags = 0)
  2262. Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryExW", "wstr", $sfilename, "ptr", 0, "dword", $iflags)
  2263. If @error Then Return SetError(@error, @extended, 0)
  2264. Return $aresult[0]
  2265. EndFunc
  2266.  
  2267. Func _winapi_loadshell32icon($iiconid)
  2268. Local $TotalTimeicons = DllStructCreate("ptr Data")
  2269. Local $picons = DllStructGetPtr($TotalTimeicons)
  2270. Local $iicons = _winapi_extracticonex("shell32.dll", $iiconid, 0, $picons, 1)
  2271. If @error Then Return SetError(@error, @extended, 0)
  2272. If $iicons <= 0 Then Return SetError(1, 0, 0)
  2273. Return DllStructGetData($TotalTimeicons, "Data")
  2274. EndFunc
  2275.  
  2276. Func _winapi_loadstring($HotKeyinstance, $istringid)
  2277. Local $aresult = DllCall("user32.dll", "int", "LoadStringW", "handle", $HotKeyinstance, "uint", $istringid, "wstr", "", "int", 4096)
  2278. If @error Then Return SetError(@error, @extended, "")
  2279. Return SetExtended($aresult[0], $aresult[3])
  2280. EndFunc
  2281.  
  2282. Func _winapi_localfree($HotKeymem)
  2283. Local $aresult = DllCall("kernel32.dll", "handle", "LocalFree", "handle", $HotKeymem)
  2284. If @error Then Return SetError(@error, @extended, False)
  2285. Return $aresult[0]
  2286. EndFunc
  2287.  
  2288. Func _winapi_loword($ilong)
  2289. Return BitAND($ilong, 65535)
  2290. EndFunc
  2291.  
  2292. Func _winapi_makelangid($lgidprimary, $lgidsub)
  2293. Return BitOR(BitShift($lgidsub, -10), $lgidprimary)
  2294. EndFunc
  2295.  
  2296. Func _winapi_makelcid($lgid, $srtid)
  2297. Return BitOR(BitShift($srtid, -16), $lgid)
  2298. EndFunc
  2299.  
  2300. Func _winapi_makelong($ilo, $ihi)
  2301. Return BitOR(BitShift($ihi, -16), BitAND($ilo, 65535))
  2302. EndFunc
  2303.  
  2304. Func _winapi_makeqword($lodword, $HotKeyidword)
  2305. Local $TotalTimeint64 = DllStructCreate("uint64")
  2306. Local $TotalTimedwords = DllStructCreate("dword;dword", DllStructGetPtr($TotalTimeint64))
  2307. DllStructSetData($TotalTimedwords, 1, $lodword)
  2308. DllStructSetData($TotalTimedwords, 2, $HotKeyidword)
  2309. Return DllStructGetData($TotalTimeint64, 1)
  2310. EndFunc
  2311.  
  2312. Func _winapi_messagebeep($itype = 1)
  2313. Local $isound
  2314. Switch $itype
  2315. Case 1
  2316. $isound = 0
  2317. Case 2
  2318. $isound = 16
  2319. Case 3
  2320. $isound = 32
  2321. Case 4
  2322. $isound = 48
  2323. Case 5
  2324. $isound = 64
  2325. Case Else
  2326. $isound = -1
  2327. EndSwitch
  2328. Local $aresult = DllCall("user32.dll", "bool", "MessageBeep", "uint", $isound)
  2329. If @error Then Return SetError(@error, @extended, False)
  2330. Return $aresult[0]
  2331. EndFunc
  2332.  
  2333. Func _winapi_msgbox($iflags, $stitle, $stext)
  2334. BlockInput(0)
  2335. MsgBox($iflags, $stitle, $stext & " ")
  2336. EndFunc
  2337.  
  2338. Func _winapi_mouse_event($iflags, $ix = 0, $iy = 0, $idata = 0, $iextrainfo = 0)
  2339. DllCall("user32.dll", "none", "mouse_event", "dword", $iflags, "dword", $ix, "dword", $iy, "dword", $idata, "ulong_ptr", $iextrainfo)
  2340. If @error Then Return SetError(@error, @extended)
  2341. EndFunc
  2342.  
  2343. Func _winapi_moveto($HotKeydc, $ix, $iy)
  2344. Local $aresult = DllCall("gdi32.dll", "bool", "MoveToEx", "handle", $HotKeydc, "int", $ix, "int", $iy, "ptr", 0)
  2345. If @error Then Return SetError(@error, @extended, False)
  2346. Return $aresult[0]
  2347. EndFunc
  2348.  
  2349. Func _winapi_movewindow($HotKeywnd, $ix, $iy, $iwidth, $iheight, $frepaint = True)
  2350. Local $aresult = DllCall("user32.dll", "bool", "MoveWindow", "hwnd", $HotKeywnd, "int", $ix, "int", $iy, "int", $iwidth, "int", $iheight, "bool", $frepaint)
  2351. If @error Then Return SetError(@error, @extended, False)
  2352. Return $aresult[0]
  2353. EndFunc
  2354.  
  2355. Func _winapi_muldiv($inumber, $inumerator, $idenominator)
  2356. Local $aresult = DllCall("kernel32.dll", "int", "MulDiv", "int", $inumber, "int", $inumerator, "int", $idenominator)
  2357. If @error Then Return SetError(@error, @extended, -1)
  2358. Return $aresult[0]
  2359. EndFunc
  2360.  
  2361. Func _winapi_multibytetowidechar($stext, $icodepage = 0, $iflags = 0, $bretstring = False)
  2362. Local $stexttype = "ptr", $ptext = $stext
  2363. If IsDllStruct($stext) Then
  2364. $ptext = DllStructGetPtr($stext)
  2365. Else
  2366. If NOT IsPtr($stext) Then $stexttype = "STR"
  2367. EndIf
  2368. Local $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $ptext, "int", -1, "ptr", 0, "int", 0)
  2369. If @error Then Return SetError(@error, @extended, 0)
  2370. Local $iout = $aresult[0]
  2371. Local $TotalTimeout = DllStructCreate("wchar[" & $iout & "]")
  2372. Local $pout = DllStructGetPtr($TotalTimeout)
  2373. $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $ptext, "int", -1, "ptr", $pout, "int", $iout)
  2374. If @error Then Return SetError(@error, @extended, 0)
  2375. If $bretstring Then Return DllStructGetData($TotalTimeout, 1)
  2376. Return $TotalTimeout
  2377. EndFunc
  2378.  
  2379. Func _winapi_multibytetowidecharex($stext, $ptext, $icodepage = 0, $iflags = 0)
  2380. Local $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, "STR", $stext, "int", -1, "ptr", $ptext, "int", (StringLen($stext) + 1) * 2)
  2381. If @error Then Return SetError(@error, @extended, False)
  2382. Return $aresult[0]
  2383. EndFunc
  2384.  
  2385. Func _winapi_openprocess($iaccess, $finherit, $iprocessid, $fdebugpriv = False)
  2386. Local $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $finherit, "dword", $iprocessid)
  2387. If @error Then Return SetError(@error, @extended, 0)
  2388. If $aresult[0] Then Return $aresult[0]
  2389. If NOT $fdebugpriv Then Return 0
  2390. Local $HotKeytoken = _security__openthreadtokenex(BitOR($TotalTimeoken_adjust_privileges, $TotalTimeoken_query))
  2391. If @error Then Return SetError(@error, @extended, 0)
  2392. _security__setprivilege($HotKeytoken, "SeDebugPrivilege", True)
  2393. Local $ierror = @error
  2394. Local $ilasterror = @extended
  2395. Local $iret = 0
  2396. If NOT @error Then
  2397. $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $finherit, "dword", $iprocessid)
  2398. $ierror = @error
  2399. $ilasterror = @extended
  2400. If $aresult[0] Then $iret = $aresult[0]
  2401. _security__setprivilege($HotKeytoken, "SeDebugPrivilege", False)
  2402. If @error Then
  2403. $ierror = @error
  2404. $ilasterror = @extended
  2405. EndIf
  2406. EndIf
  2407. _winapi_closehandle($HotKeytoken)
  2408. Return SetError($ierror, $ilasterror, $iret)
  2409. EndFunc
  2410.  
  2411. Func __winapi_parsefiledialogpath($spath)
  2412. Local $afiles[3]
  2413. $afiles[0] = 2
  2414. Local $stemp = StringMid($spath, 1, StringInStr($spath, "\", 0, -1) - 1)
  2415. $afiles[1] = $stemp
  2416. $afiles[2] = StringMid($spath, StringInStr($spath, "\", 0, -1) + 1)
  2417. Return $afiles
  2418. EndFunc
  2419.  
  2420. Func _winapi_pathfindonpath(Const $szfile, $aextrapaths = "", Const $szpathdelimiter = @LF)
  2421. Local $iextracount = 0
  2422. If IsString($aextrapaths) Then
  2423. If StringLen($aextrapaths) Then
  2424. $aextrapaths = StringSplit($aextrapaths, $szpathdelimiter, 1 + 2)
  2425. $iextracount = UBound($aextrapaths, 1)
  2426. EndIf
  2427. ElseIf IsArray($aextrapaths) Then
  2428. $iextracount = UBound($aextrapaths)
  2429. EndIf
  2430. Local $TotalTimepaths, $TotalTimepathptrs
  2431. If $iextracount Then
  2432. Local $szstruct = ""
  2433. For $path In $aextrapaths
  2434. $szstruct &= "wchar[" & StringLen($path) + 1 & "];"
  2435. Next
  2436. $TotalTimepaths = DllStructCreate($szstruct)
  2437. $TotalTimepathptrs = DllStructCreate("ptr[" & $iextracount + 1 & "]")
  2438. For $i = 1 To $iextracount
  2439. DllStructSetData($TotalTimepaths, $i, $aextrapaths[$i - 1])
  2440. DllStructSetData($TotalTimepathptrs, 1, DllStructGetPtr($TotalTimepaths, $i), $i)
  2441. Next
  2442. DllStructSetData($TotalTimepathptrs, 1, Ptr(0), $iextracount + 1)
  2443. EndIf
  2444. Local $aresult = DllCall("shlwapi.dll", "bool", "PathFindOnPathW", "wstr", $szfile, "ptr", DllStructGetPtr($TotalTimepathptrs))
  2445. If @error Then Return SetError(@error, @extended, False)
  2446. If $aresult[0] = 0 Then Return SetError(1, 0, $szfile)
  2447. Return $aresult[1]
  2448. EndFunc
  2449.  
  2450. Func _winapi_pointfromrect(ByRef $TotalTimerect, $fcenter = True)
  2451. Local $ix1 = DllStructGetData($TotalTimerect, "Left")
  2452. Local $iy1 = DllStructGetData($TotalTimerect, "Top")
  2453. Local $ix2 = DllStructGetData($TotalTimerect, "Right")
  2454. Local $iy2 = DllStructGetData($TotalTimerect, "Bottom")
  2455. If $fcenter Then
  2456. $ix1 = $ix1 + (($ix2 - $ix1) / 2)
  2457. $iy1 = $iy1 + (($iy2 - $iy1) / 2)
  2458. EndIf
  2459. Local $TotalTimepoint = DllStructCreate($TotalTimeagpoint)
  2460. DllStructSetData($TotalTimepoint, "X", $ix1)
  2461. DllStructSetData($TotalTimepoint, "Y", $iy1)
  2462. Return $TotalTimepoint
  2463. EndFunc
  2464.  
  2465. Func _winapi_postmessage($HotKeywnd, $imsg, $iwparam, $ilparam)
  2466. Local $aresult = DllCall("user32.dll", "bool", "PostMessage", "hwnd", $HotKeywnd, "uint", $imsg, "wparam", $iwparam, "lparam", $ilparam)
  2467. If @error Then Return SetError(@error, @extended, False)
  2468. Return $aresult[0]
  2469. EndFunc
  2470.  
  2471. Func _winapi_primarylangid($lgid)
  2472. Return BitAND($lgid, 1023)
  2473. EndFunc
  2474.  
  2475. Func _winapi_ptinrect(ByRef $TotalTimerect, ByRef $TotalTimepoint)
  2476. Local $ix = DllStructGetData($TotalTimepoint, "X")
  2477. Local $iy = DllStructGetData($TotalTimepoint, "Y")
  2478. Local $aresult = DllCall("user32.dll", "bool", "PtInRect", "ptr", DllStructGetPtr($TotalTimerect), "long", $ix, "long", $iy)
  2479. If @error Then Return SetError(@error, @extended, False)
  2480. Return $aresult[0]
  2481. EndFunc
  2482.  
  2483. Func _winapi_readfile($HotKeyfile, $pbuffer, $itoread, ByRef $iread, $poverlapped = 0)
  2484. Local $aresult = DllCall("kernel32.dll", "bool", "ReadFile", "handle", $HotKeyfile, "ptr", $pbuffer, "dword", $itoread, "dword*", 0, "ptr", $poverlapped)
  2485. If @error Then Return SetError(@error, @extended, False)
  2486. $iread = $aresult[4]
  2487. Return $aresult[0]
  2488. EndFunc
  2489.  
  2490. Func _winapi_readprocessmemory($HotKeyprocess, $pbaseaddress, $pbuffer, $isize, ByRef $iread)
  2491. Local $aresult = DllCall("kernel32.dll", "bool", "ReadProcessMemory", "handle", $HotKeyprocess, "ptr", $pbaseaddress, "ptr", $pbuffer, "ulong_ptr", $isize, "ulong_ptr*", 0)
  2492. If @error Then Return SetError(@error, @extended, False)
  2493. $iread = $aresult[5]
  2494. Return $aresult[0]
  2495. EndFunc
  2496.  
  2497. Func _winapi_rectisempty(ByRef $TotalTimerect)
  2498. Return (DllStructGetData($TotalTimerect, "Left") = 0) AND (DllStructGetData($TotalTimerect, "Top") = 0) AND (DllStructGetData($TotalTimerect, "Right") = 0) AND (DllStructGetData($TotalTimerect, "Bottom") = 0)
  2499. EndFunc
  2500.  
  2501. Func _winapi_redrawwindow($HotKeywnd, $TotalTimerect = 0, $HotKeyregion = 0, $iflags = 5)
  2502. Local $prect = 0
  2503. If $TotalTimerect <> 0 Then $prect = DllStructGetPtr($TotalTimerect)
  2504. Local $aresult = DllCall("user32.dll", "bool", "RedrawWindow", "hwnd", $HotKeywnd, "ptr", $prect, "handle", $HotKeyregion, "uint", $iflags)
  2505. If @error Then Return SetError(@error, @extended, False)
  2506. Return $aresult[0]
  2507. EndFunc
  2508.  
  2509. Func _winapi_registerwindowmessage($smessage)
  2510. Local $aresult = DllCall("user32.dll", "uint", "RegisterWindowMessageW", "wstr", $smessage)
  2511. If @error Then Return SetError(@error, @extended, 0)
  2512. Return $aresult[0]
  2513. EndFunc
  2514.  
  2515. Func _winapi_releasecapture()
  2516. Local $aresult = DllCall("user32.dll", "bool", "ReleaseCapture")
  2517. If @error Then Return SetError(@error, @extended, False)
  2518. Return $aresult[0]
  2519. EndFunc
  2520.  
  2521. Func _winapi_releasedc($HotKeywnd, $HotKeydc)
  2522. Local $aresult = DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $HotKeywnd, "handle", $HotKeydc)
  2523. If @error Then Return SetError(@error, @extended, False)
  2524. Return $aresult[0]
  2525. EndFunc
  2526.  
  2527. Func _winapi_screentoclient($HotKeywnd, ByRef $TotalTimepoint)
  2528. Local $aresult = DllCall("user32.dll", "bool", "ScreenToClient", "hwnd", $HotKeywnd, "ptr", DllStructGetPtr($TotalTimepoint))
  2529. If @error Then Return SetError(@error, @extended, False)
  2530. Return $aresult[0]
  2531. EndFunc
  2532.  
  2533. Func _winapi_selectobject($HotKeydc, $HotKeygdiobj)
  2534. Local $aresult = DllCall("gdi32.dll", "handle", "SelectObject", "handle", $HotKeydc, "handle", $HotKeygdiobj)
  2535. If @error Then Return SetError(@error, @extended, False)
  2536. Return $aresult[0]
  2537. EndFunc
  2538.  
  2539. Func _winapi_setbkcolor($HotKeydc, $icolor)
  2540. Local $aresult = DllCall("gdi32.dll", "INT", "SetBkColor", "handle", $HotKeydc, "dword", $icolor)
  2541. If @error Then Return SetError(@error, @extended, -1)
  2542. Return $aresult[0]
  2543. EndFunc
  2544.  
  2545. Func _winapi_setbkmode($HotKeydc, $ibkmode)
  2546. Local $aresult = DllCall("gdi32.dll", "int", "SetBkMode", "handle", $HotKeydc, "int", $ibkmode)
  2547. If @error Then Return SetError(@error, @extended, 0)
  2548. Return $aresult[0]
  2549. EndFunc
  2550.  
  2551. Func _winapi_setcapture($HotKeywnd)
  2552. Local $aresult = DllCall("user32.dll", "hwnd", "SetCapture", "hwnd", $HotKeywnd)
  2553. If @error Then Return SetError(@error, @extended, 0)
  2554. Return $aresult[0]
  2555. EndFunc
  2556.  
  2557. Func _winapi_setcursor($HotKeycursor)
  2558. Local $aresult = DllCall("user32.dll", "handle", "SetCursor", "handle", $HotKeycursor)
  2559. If @error Then Return SetError(@error, @extended, 0)
  2560. Return $aresult[0]
  2561. EndFunc
  2562.  
  2563. Func _winapi_setdefaultprinter($sprinter)
  2564. Local $aresult = DllCall("winspool.drv", "bool", "SetDefaultPrinterW", "wstr", $sprinter)
  2565. If @error Then Return SetError(@error, @extended, False)
  2566. Return $aresult[0]
  2567. EndFunc
  2568.  
  2569. Func _winapi_setdibits($HotKeydc, $HotKeybmp, $istartscan, $iscanlines, $pbits, $pbmi, $icoloruse = 0)
  2570. Local $aresult = DllCall("gdi32.dll", "int", "SetDIBits", "handle", $HotKeydc, "handle", $HotKeybmp, "uint", $istartscan, "uint", $iscanlines, "ptr", $pbits, "ptr", $pbmi, "uint", $icoloruse)
  2571. If @error Then Return SetError(@error, @extended, False)
  2572. Return $aresult[0]
  2573. EndFunc
  2574.  
  2575. Func _winapi_setendoffile($HotKeyfile)
  2576. Local $aresult = DllCall("kernel32.dll", "bool", "SetEndOfFile", "handle", $HotKeyfile)
  2577. If @error Then Return SetError(@error, @extended, False)
  2578. Return $aresult[0]
  2579. EndFunc
  2580.  
  2581. Func _winapi_setevent($HotKeyevent)
  2582. Local $aresult = DllCall("kernel32.dll", "bool", "SetEvent", "handle", $HotKeyevent)
  2583. If @error Then Return SetError(@error, @extended, False)
  2584. Return $aresult[0]
  2585. EndFunc
  2586.  
  2587. Func _winapi_setfilepointer($HotKeyfile, $ipos, $imethod = 0)
  2588. Local $aresult = DllCall("kernel32.dll", "INT", "SetFilePointer", "handle", $HotKeyfile, "long", $ipos, "ptr", 0, "long", $imethod)
  2589. If @error Then Return SetError(@error, @extended, -1)
  2590. Return $aresult[0]
  2591. EndFunc
  2592.  
  2593. Func _winapi_setfocus($HotKeywnd)
  2594. Local $aresult = DllCall("user32.dll", "hwnd", "SetFocus", "hwnd", $HotKeywnd)
  2595. If @error Then Return SetError(@error, @extended, 0)
  2596. Return $aresult[0]
  2597. EndFunc
  2598.  
  2599. Func _winapi_setfont($HotKeywnd, $HotKeyfont, $fredraw = True)
  2600. _sendmessage($HotKeywnd, $__winapiconstant_wm_setfont, $HotKeyfont, $fredraw, 0, "hwnd")
  2601. EndFunc
  2602.  
  2603. Func _winapi_sethandleinformation($HotKeyobject, $imask, $iflags)
  2604. Local $aresult = DllCall("kernel32.dll", "bool", "SetHandleInformation", "handle", $HotKeyobject, "dword", $imask, "dword", $iflags)
  2605. If @error Then Return SetError(@error, @extended, False)
  2606. Return $aresult[0]
  2607. EndFunc
  2608.  
  2609. Func _winapi_setlayeredwindowattributes($HotKeywnd, $i_transcolor, $TotalTimeransparency = 255, $dwflags = 3, $iscolorref = False)
  2610. If $dwflags = Default OR $dwflags = "" OR $dwflags < 0 Then $dwflags = 3
  2611. If NOT $iscolorref Then
  2612. $i_transcolor = Hex(String($i_transcolor), 6)
  2613. $i_transcolor = Execute("0x00" & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
  2614. EndIf
  2615. Local $aresult = DllCall("user32.dll", "bool", "SetLayeredWindowAttributes", "hwnd", $HotKeywnd, "dword", $i_transcolor, "byte", $TotalTimeransparency, "dword", $dwflags)
  2616. If @error Then Return SetError(@error, @extended, False)
  2617. Return $aresult[0]
  2618. EndFunc
  2619.  
  2620. Func _winapi_setparent($HotKeywndchild, $HotKeywndparent)
  2621. Local $aresult = DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $HotKeywndchild, "hwnd", $HotKeywndparent)
  2622. If @error Then Return SetError(@error, @extended, 0)
  2623. Return $aresult[0]
  2624. EndFunc
  2625.  
  2626. Func _winapi_setprocessaffinitymask($HotKeyprocess, $imask)
  2627. Local $aresult = DllCall("kernel32.dll", "bool", "SetProcessAffinityMask", "handle", $HotKeyprocess, "ulong_ptr", $imask)
  2628. If @error Then Return SetError(@error, @extended, False)
  2629. Return $aresult[0]
  2630. EndFunc
  2631.  
  2632. Func _winapi_setsyscolors($velements, $vcolors)
  2633. Local $isearray = IsArray($velements), $iscarray = IsArray($vcolors)
  2634. Local $ielementnum
  2635. If NOT $iscarray AND NOT $isearray Then
  2636. $ielementnum = 1
  2637. ElseIf $iscarray OR $isearray Then
  2638. If NOT $iscarray OR NOT $isearray Then Return SetError(-1, -1, False)
  2639. If UBound($velements) <> UBound($vcolors) Then Return SetError(-1, -1, False)
  2640. $ielementnum = UBound($velements)
  2641. EndIf
  2642. Local $TotalTimeelements = DllStructCreate("int Element[" & $ielementnum & "]")
  2643. Local $TotalTimecolors = DllStructCreate("dword NewColor[" & $ielementnum & "]")
  2644. Local $pelements = DllStructGetPtr($TotalTimeelements)
  2645. Local $pcolors = DllStructGetPtr($TotalTimecolors)
  2646. If NOT $isearray Then
  2647. DllStructSetData($TotalTimeelements, "Element", $velements, 1)
  2648. Else
  2649. For $x = 0 To $ielementnum - 1
  2650. DllStructSetData($TotalTimeelements, "Element", $velements[$x], $x + 1)
  2651. Next
  2652. EndIf
  2653. If NOT $iscarray Then
  2654. DllStructSetData($TotalTimecolors, "NewColor", $vcolors, 1)
  2655. Else
  2656. For $x = 0 To $ielementnum - 1
  2657. DllStructSetData($TotalTimecolors, "NewColor", $vcolors[$x], $x + 1)
  2658. Next
  2659. EndIf
  2660. Local $aresult = DllCall("user32.dll", "bool", "SetSysColors", "int", $ielementnum, "ptr", $pelements, "ptr", $pcolors)
  2661. If @error Then Return SetError(@error, @extended, False)
  2662. Return $aresult[0]
  2663. EndFunc
  2664.  
  2665. Func _winapi_settextcolor($HotKeydc, $icolor)
  2666. Local $aresult = DllCall("gdi32.dll", "INT", "SetTextColor", "handle", $HotKeydc, "dword", $icolor)
  2667. If @error Then Return SetError(@error, @extended, -1)
  2668. Return $aresult[0]
  2669. EndFunc
  2670.  
  2671. Func _winapi_setwindowlong($HotKeywnd, $iindex, $ivalue)
  2672. _winapi_setlasterror(0)
  2673. Local $sfuncname = "SetWindowLongW"
  2674. If @AutoItX64 Then $sfuncname = "SetWindowLongPtrW"
  2675. Local $aresult = DllCall("user32.dll", "long_ptr", $sfuncname, "hwnd", $HotKeywnd, "int", $iindex, "long_ptr", $ivalue)
  2676. If @error Then Return SetError(@error, @extended, 0)
  2677. Return $aresult[0]
  2678. EndFunc
  2679.  
  2680. Func _winapi_setwindowplacement($HotKeywnd, $pwindowplacement)
  2681. Local $aresult = DllCall("user32.dll", "bool", "SetWindowPlacement", "hwnd", $HotKeywnd, "ptr", $pwindowplacement)
  2682. If @error Then Return SetError(@error, @extended, False)
  2683. Return $aresult[0]
  2684. EndFunc
  2685.  
  2686. Func _winapi_setwindowpos($HotKeywnd, $HotKeyafter, $ix, $iy, $icx, $icy, $iflags)
  2687. Local $aresult = DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $HotKeywnd, "hwnd", $HotKeyafter, "int", $ix, "int", $iy, "int", $icx, "int", $icy, "uint", $iflags)
  2688. If @error Then Return SetError(@error, @extended, False)
  2689. Return $aresult[0]
  2690. EndFunc
  2691.  
  2692. Func _winapi_setwindowrgn($HotKeywnd, $HotKeyrgn, $bredraw = True)
  2693. Local $aresult = DllCall("user32.dll", "int", "SetWindowRgn", "hwnd", $HotKeywnd, "handle", $HotKeyrgn, "bool", $bredraw)
  2694. If @error Then Return SetError(@error, @extended, False)
  2695. Return $aresult[0]
  2696. EndFunc
  2697.  
  2698. Func _winapi_setwindowshookex($idhook, $lpfn, $HotKeymod, $dwthreadid = 0)
  2699. Local $aresult = DllCall("user32.dll", "handle", "SetWindowsHookEx", "int", $idhook, "ptr", $lpfn, "handle", $HotKeymod, "dword", $dwthreadid)
  2700. If @error Then Return SetError(@error, @extended, 0)
  2701. Return $aresult[0]
  2702. EndFunc
  2703.  
  2704. Func _winapi_setwindowtext($HotKeywnd, $stext)
  2705. Local $aresult = DllCall("user32.dll", "bool", "SetWindowTextW", "hwnd", $HotKeywnd, "wstr", $stext)
  2706. If @error Then Return SetError(@error, @extended, False)
  2707. Return $aresult[0]
  2708. EndFunc
  2709.  
  2710. Func _winapi_showcursor($fshow)
  2711. Local $aresult = DllCall("user32.dll", "int", "ShowCursor", "bool", $fshow)
  2712. If @error Then Return SetError(@error, @extended, 0)
  2713. Return $aresult[0]
  2714. EndFunc
  2715.  
  2716. Func _winapi_showerror($stext, $fexit = True)
  2717. _winapi_msgbox(266256, "Error", $stext)
  2718. If $fexit Then Exit
  2719. EndFunc
  2720.  
  2721. Func _winapi_showmsg($stext)
  2722. _winapi_msgbox(64 + 4096, "Information", $stext)
  2723. EndFunc
  2724.  
  2725. Func _winapi_showwindow($HotKeywnd, $icmdshow = 5)
  2726. Local $aresult = DllCall("user32.dll", "bool", "ShowWindow", "hwnd", $HotKeywnd, "int", $icmdshow)
  2727. If @error Then Return SetError(@error, @extended, False)
  2728. Return $aresult[0]
  2729. EndFunc
  2730.  
  2731. Func _winapi_stringfromguid($pguid)
  2732. Local $aresult = DllCall("ole32.dll", "int", "StringFromGUID2", "ptr", $pguid, "wstr", "", "int", 40)
  2733. If @error Then Return SetError(@error, @extended, "")
  2734. Return SetExtended($aresult[0], $aresult[2])
  2735. EndFunc
  2736.  
  2737. Func _winapi_sublangid($lgid)
  2738. Return BitShift($lgid, 10)
  2739. EndFunc
  2740.  
  2741. Func _winapi_systemparametersinfo($iaction, $iparam = 0, $vparam = 0, $iwinini = 0)
  2742. Local $aresult = DllCall("user32.dll", "bool", "SystemParametersInfoW", "uint", $iaction, "uint", $iparam, "ptr", $vparam, "uint", $iwinini)
  2743. If @error Then Return SetError(@error, @extended, False)
  2744. Return $aresult[0]
  2745. EndFunc
  2746.  
  2747. Func _winapi_twipsperpixelExitNow()
  2748. Local $lngdc, $TotalTimewipsperpixelx
  2749. $lngdc = _winapi_getdc(0)
  2750. $TotalTimewipsperpixelx = 1440 / _winapi_getdevicecaps($lngdc, $__winapiconstant_logpixelsx)
  2751. _winapi_releasedc(0, $lngdc)
  2752. Return $TotalTimewipsperpixelx
  2753. EndFunc
  2754.  
  2755. Func _winapi_twipsperpixely()
  2756. Local $lngdc, $TotalTimewipsperpixely
  2757. $lngdc = _winapi_getdc(0)
  2758. $TotalTimewipsperpixely = 1440 / _winapi_getdevicecaps($lngdc, $__winapiconstant_logpixelsy)
  2759. _winapi_releasedc(0, $lngdc)
  2760. Return $TotalTimewipsperpixely
  2761. EndFunc
  2762.  
  2763. Func _winapi_unhookwindowshookex($HotKeyhk)
  2764. Local $aresult = DllCall("user32.dll", "bool", "UnhookWindowsHookEx", "handle", $HotKeyhk)
  2765. If @error Then Return SetError(@error, @extended, False)
  2766. Return $aresult[0]
  2767. EndFunc
  2768.  
  2769. Func _winapi_updatelayeredwindow($HotKeywnd, $HotKeydcdest, $pptdest, $psize, $HotKeydcsrce, $pptsrce, $irgb, $pblend, $iflags)
  2770. Local $aresult = DllCall("user32.dll", "bool", "UpdateLayeredWindow", "hwnd", $HotKeywnd, "handle", $HotKeydcdest, "ptr", $pptdest, "ptr", $psize, "handle", $HotKeydcsrce, "ptr", $pptsrce, "dword", $irgb, "ptr", $pblend, "dword", $iflags)
  2771. If @error Then Return SetError(@error, @extended, False)
  2772. Return $aresult[0]
  2773. EndFunc
  2774.  
  2775. Func _winapi_updatewindow($HotKeywnd)
  2776. Local $aresult = DllCall("user32.dll", "bool", "UpdateWindow", "hwnd", $HotKeywnd)
  2777. If @error Then Return SetError(@error, @extended, False)
  2778. Return $aresult[0]
  2779. EndFunc
  2780.  
  2781. Func _winapi_waitforinputidle($HotKeyprocess, $itimeout = -1)
  2782. Local $aresult = DllCall("user32.dll", "dword", "WaitForInputIdle", "handle", $HotKeyprocess, "dword", $itimeout)
  2783. If @error Then Return SetError(@error, @extended, False)
  2784. Return $aresult[0]
  2785. EndFunc
  2786.  
  2787. Func _winapi_waitformultipleobjects($icount, $phandles, $fwaitall = False, $itimeout = -1)
  2788. Local $aresult = DllCall("kernel32.dll", "INT", "WaitForMultipleObjects", "dword", $icount, "ptr", $phandles, "bool", $fwaitall, "dword", $itimeout)
  2789. If @error Then Return SetError(@error, @extended, -1)
  2790. Return $aresult[0]
  2791. EndFunc
  2792.  
  2793. Func _winapi_waitforsingleobject($HotKeyhandle, $itimeout = -1)
  2794. Local $aresult = DllCall("kernel32.dll", "INT", "WaitForSingleObject", "handle", $HotKeyhandle, "dword", $itimeout)
  2795. If @error Then Return SetError(@error, @extended, -1)
  2796. Return $aresult[0]
  2797. EndFunc
  2798.  
  2799. Func _winapi_widechartomultibyte($punicode, $icodepage = 0, $bretstring = True)
  2800. Local $sunicodetype = "ptr"
  2801. If IsDllStruct($punicode) Then
  2802. $punicode = DllStructGetPtr($punicode)
  2803. Else
  2804. If NOT IsPtr($punicode) Then $sunicodetype = "wstr"
  2805. EndIf
  2806. Local $aresult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "uint", $icodepage, "dword", 0, $sunicodetype, $punicode, "int", -1, "ptr", 0, "int", 0, "ptr", 0, "ptr", 0)
  2807. If @error Then Return SetError(@error, @extended, "")
  2808. Local $TotalTimemultibyte = DllStructCreate("char[" & $aresult[0] & "]")
  2809. Local $pmultibyte = DllStructGetPtr($TotalTimemultibyte)
  2810. $aresult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "uint", $icodepage, "dword", 0, $sunicodetype, $punicode, "int", -1, "ptr", $pmultibyte, "int", $aresult[0], "ptr", 0, "ptr", 0)
  2811. If @error Then Return SetError(@error, @extended, "")
  2812. If $bretstring Then Return DllStructGetData($TotalTimemultibyte, 1)
  2813. Return $TotalTimemultibyte
  2814. EndFunc
  2815.  
  2816. Func _winapi_windowfrompoint(ByRef $TotalTimepoint)
  2817. Local $TotalTimepointcast = DllStructCreate("int64", DllStructGetPtr($TotalTimepoint))
  2818. Local $aresult = DllCall("user32.dll", "hwnd", "WindowFromPoint", "int64", DllStructGetData($TotalTimepointcast, 1))
  2819. If @error Then Return SetError(@error, @extended, 0)
  2820. Return $aresult[0]
  2821. EndFunc
  2822.  
  2823. Func _winapi_writeconsole($HotKeyconsole, $stext)
  2824. Local $aresult = DllCall("kernel32.dll", "bool", "WriteConsoleW", "handle", $HotKeyconsole, "wstr", $stext, "dword", StringLen($stext), "dword*", 0, "ptr", 0)
  2825. If @error Then Return SetError(@error, @extended, False)
  2826. Return $aresult[0]
  2827. EndFunc
  2828.  
  2829. Func _winapi_writefile($HotKeyfile, $pbuffer, $itowrite, ByRef $iwritten, $poverlapped = 0)
  2830. Local $aresult = DllCall("kernel32.dll", "bool", "WriteFile", "handle", $HotKeyfile, "ptr", $pbuffer, "dword", $itowrite, "dword*", 0, "ptr", $poverlapped)
  2831. If @error Then Return SetError(@error, @extended, False)
  2832. $iwritten = $aresult[4]
  2833. Return $aresult[0]
  2834. EndFunc
  2835.  
  2836. Func _winapi_writeprocessmemory($HotKeyprocess, $pbaseaddress, $pbuffer, $isize, ByRef $iwritten, $sbuffer = "ptr")
  2837. Local $aresult = DllCall("kernel32.dll", "bool", "WriteProcessMemory", "handle", $HotKeyprocess, "ptr", $pbaseaddress, $sbuffer, $pbuffer, "ulong_ptr", $isize, "ulong_ptr*", 0)
  2838. If @error Then Return SetError(@error, @extended, False)
  2839. $iwritten = $aresult[5]
  2840. Return $aresult[0]
  2841. EndFunc
  2842.  
  2843. Global Const $_udf_globalids_offset = 2
  2844. Global Const $_udf_globalid_max_win = 16
  2845. Global Const $_udf_startid = 10000
  2846. Global Const $_udf_globalid_max_ids = 55535
  2847. Global Const $__udfguiconstant_ws_visible = 268435456
  2848. Global Const $__udfguiconstant_ws_child = 1073741824
  2849. Global $_udf_globalids_used[$_udf_globalid_max_win][$_udf_globalid_max_ids + $_udf_globalids_offset + 1]
  2850.  
  2851. Func __udf_getnextglobalid($HotKeywnd)
  2852. Local $nctrlid, $iusedindex = -1, $fallused = True
  2853. If NOT WinExists($HotKeywnd) Then Return SetError(-1, -1, 0)
  2854. For $iindex = 0 To $_udf_globalid_max_win - 1
  2855. If $_udf_globalids_used[$iindex][0] <> 0 Then
  2856. If NOT WinExists($_udf_globalids_used[$iindex][0]) Then
  2857. For $x = 0 To UBound($_udf_globalids_used, 2) - 1
  2858. $_udf_globalids_used[$iindex][$x] = 0
  2859. Next
  2860. $_udf_globalids_used[$iindex][1] = $_udf_startid
  2861. $fallused = False
  2862. EndIf
  2863. EndIf
  2864. Next
  2865. For $iindex = 0 To $_udf_globalid_max_win - 1
  2866. If $_udf_globalids_used[$iindex][0] = $HotKeywnd Then
  2867. $iusedindex = $iindex
  2868. ExitLoop
  2869. EndIf
  2870. Next
  2871. If $iusedindex = -1 Then
  2872. For $iindex = 0 To $_udf_globalid_max_win - 1
  2873. If $_udf_globalids_used[$iindex][0] = 0 Then
  2874. $_udf_globalids_used[$iindex][0] = $HotKeywnd
  2875. $_udf_globalids_used[$iindex][1] = $_udf_startid
  2876. $fallused = False
  2877. $iusedindex = $iindex
  2878. ExitLoop
  2879. EndIf
  2880. Next
  2881. EndIf
  2882. If $iusedindex = -1 AND $fallused Then Return SetError(16, 0, 0)
  2883. If $_udf_globalids_used[$iusedindex][1] = $_udf_startid + $_udf_globalid_max_ids Then
  2884. For $iidindex = $_udf_globalids_offset To UBound($_udf_globalids_used, 2) - 1
  2885. If $_udf_globalids_used[$iusedindex][$iidindex] = 0 Then
  2886. $nctrlid = ($iidindex - $_udf_globalids_offset) + 10000
  2887. $_udf_globalids_used[$iusedindex][$iidindex] = $nctrlid
  2888. Return $nctrlid
  2889. EndIf
  2890. Next
  2891. Return SetError(-1, $_udf_globalid_max_ids, 0)
  2892. EndIf
  2893. $nctrlid = $_udf_globalids_used[$iusedindex][1]
  2894. $_udf_globalids_used[$iusedindex][1] += 1
  2895. $_udf_globalids_used[$iusedindex][($nctrlid - 10000) + $_udf_globalids_offset] = $nctrlid
  2896. Return $nctrlid
  2897. EndFunc
  2898.  
  2899. Func __udf_freeglobalid($HotKeywnd, $iglobalid)
  2900. If $iglobalid - $_udf_startid < 0 OR $iglobalid - $_udf_startid > $_udf_globalid_max_ids Then Return SetError(-1, 0, False)
  2901. For $iindex = 0 To $_udf_globalid_max_win - 1
  2902. If $_udf_globalids_used[$iindex][0] = $HotKeywnd Then
  2903. For $x = $_udf_globalids_offset To UBound($_udf_globalids_used, 2) - 1
  2904. If $_udf_globalids_used[$iindex][$x] = $iglobalid Then
  2905. $_udf_globalids_used[$iindex][$x] = 0
  2906. Return True
  2907. EndIf
  2908. Next
  2909. Return SetError(-3, 0, False)
  2910. EndIf
  2911. Next
  2912. Return SetError(-2, 0, False)
  2913. EndFunc
  2914.  
  2915. Func __udf_debugprint($stext, $iline = @ScriptLineNumber, $err = @error, $ext = @extended)
  2916. ConsoleWrite("!===========================================================" & @CRLF & "+======================================================" & @CRLF & "-->Line(" & StringFormat("%04d", $iline) & "):" & @TAB & $stext & @CRLF & "+======================================================" & @CRLF)
  2917. Return SetError($err, $ext, 1)
  2918. EndFunc
  2919.  
  2920. Func __udf_validateclassname($HotKeywnd, $sclassnames)
  2921. __udf_debugprint("This is for debugging only, set the debug variable to false before submitting")
  2922. If _winapi_isclassname($HotKeywnd, $sclassnames) Then Return True
  2923. Local $sseparator = Opt("GUIDataSeparatorChar")
  2924. $sclassnames = StringReplace($sclassnames, $sseparator, ",")
  2925. __udf_debugprint("Invalid Class Type(s):" & @LF & @TAB & "Expecting Type(s): " & $sclassnames & @LF & @TAB & "Received Type : " & _winapi_getclassname($HotKeywnd))
  2926. Exit
  2927. EndFunc
  2928.  
  2929. Global Const $__hotkeyconstant_classname = "msctls_hotkey32"
  2930. Global $debug_hk
  2931. Global Const $HotKeykm_sethotkey = $wm_user + 1
  2932. Global Const $HotKeykm_gethotkey = $wm_user + 2
  2933. Global Const $HotKeykm_setrules = $wm_user + 3
  2934. Global Const $HotKeyotkeyf_shift = 1
  2935. Global Const $HotKeyotkeyf_control = 2
  2936. Global Const $HotKeyotkeyf_alt = 4
  2937. Global Const $HotKeyotkeyf_ext = 8
  2938. Global Const $HotKeykcomb_none = 1
  2939. Global Const $HotKeykcomb_s = 2
  2940. Global Const $HotKeykcomb_c = 4
  2941. Global Const $HotKeykcomb_a = 8
  2942. Global Const $HotKeykcomb_sc = 16
  2943. Global Const $HotKeykcomb_sa = 32
  2944. Global Const $HotKeykcomb_ca = 64
  2945. Global Const $HotKeykcomb_sca = 128
  2946.  
  2947. Func _guictrlhotkey_create($HotKeywnd, $ix, $iy, $iwidth = -1, $iheight = -1, $istyle = -1, $istyleex = -1)
  2948. If (NOT IsHWnd($HotKeywnd)) OR (NOT WinExists($HotKeywnd)) Then Return SetError(1, 0, 0)
  2949. If $iwidth = -1 Then $iwidth = 200
  2950. If $iheight = -1 Then $iheight = 20
  2951. If $istyle = -1 Then $istyle = $ws_overlapped
  2952. If $istyleex = -1 Then $istyleex = $ws_ex_clientedge
  2953. $istyle = BitOR($istyle, $ws_visible, $ws_child)
  2954. Local $nctrlid = __udf_getnextglobalid($HotKeywnd)
  2955. If @error Then Return SetError(@error, @extended, 0)
  2956. Local $HotKeyret = _winapi_createwindowex($istyleex, $__hotkeyconstant_classname, "", $istyle, $ix, $iy, $iwidth, $iheight, $HotKeywnd, $nctrlid)
  2957. If @error Then Return SetError(@error, @extended, 0)
  2958. Return $HotKeyret
  2959. EndFunc
  2960.  
  2961. Func _guictrlhotkey_delete($HotKeyhotkey)
  2962. If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
  2963. If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
  2964. Local $HotKeyfont = _sendmessage($HotKeyhotkey, $wm_getfont)
  2965. If $HotKeyfont = 0 Then Return SetExtended(1, 1)
  2966. _winapi_deleteobject($HotKeyfont)
  2967. _winapi_destroywindow($HotKeyhotkey)
  2968. If @error Then Return SetError(@error, @extended, 0)
  2969. Return 1
  2970. EndFunc
  2971.  
  2972. Func _guictrlhotkey_gethotkey($HotKeyhotkey)
  2973. If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
  2974. If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
  2975. Local $ihotkey = _guictrlhotkey_gethotkeycode($HotKeyhotkey)
  2976. If $ihotkey = 0 Then Return ""
  2977. Local $sret = ""
  2978. Local $ihibyte = BitShift($ihotkey, 8)
  2979. Local $ilobyte = BitAND($ihotkey, 255)
  2980. If BitAND($ihibyte, $HotKeyotkeyf_control) Then $sret &= "^"
  2981. If BitAND($ihibyte, $HotKeyotkeyf_shift) Then $sret &= "+"
  2982. If BitAND($ihibyte, $HotKeyotkeyf_alt) Then $sret &= "!"
  2983. If BitAND($ihibyte, $HotKeyotkeyf_ext) Then
  2984. Switch $ilobyte
  2985. Case 33
  2986. $sret &= "{PGUP}"
  2987. Case 34
  2988. $sret &= "{PGDN}"
  2989. Case 35
  2990. $sret &= "{END}"
  2991. Case 36
  2992. $sret &= "{HOME}"
  2993. Case 37
  2994. $sret &= "{LEFT}"
  2995. Case 38
  2996. $sret &= "{UP}"
  2997. Case 39
  2998. $sret &= "{RIGHT}"
  2999. Case 40
  3000. $sret &= "{DOWN}"
  3001. Case 45
  3002. $sret &= "{INS}"
  3003. Case 111
  3004. $sret &= "{NUMPADDIV}"
  3005. Case 144
  3006. $sret &= "{NUMLOCK}"
  3007. EndSwitch
  3008. Else
  3009. Switch $ilobyte
  3010. Case 0
  3011. Case 20
  3012. $sret &= "{CAPSLOCK}"
  3013. Case 96 To 105
  3014. $sret &= "{NUMPAD" & ($ilobyte - 96) & "}"
  3015. Case 106
  3016. $sret &= "{NUMPADMULT}"
  3017. Case 107
  3018. $sret &= "{NUMPADADD}"
  3019. Case 109
  3020. $sret &= "{NUMPADSUB}"
  3021. Case 110
  3022. $sret &= "{NUMPADDOT}"
  3023. Case 112 To 123
  3024. $sret &= "{F" & ($ilobyte - 111) & "}"
  3025. Case 145
  3026. $sret &= "{SCROLLLOCK}"
  3027. Case 186
  3028. $sret &= ";"
  3029. Case 187
  3030. $sret &= "="
  3031. Case 128 To 191
  3032. $sret &= Chr($ilobyte - 144)
  3033. Case 192
  3034. $sret &= "`"
  3035. Case 222
  3036. $sret &= "'"
  3037. Case 193 To 255
  3038. $sret &= Chr($ilobyte - 128)
  3039. Case Else
  3040. $sret &= Chr($ilobyte)
  3041. EndSwitch
  3042. EndIf
  3043. Return $sret
  3044. EndFunc
  3045.  
  3046. Func _guictrlhotkey_gethotkeycode($HotKeyhotkey)
  3047. If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
  3048. If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
  3049. Return _sendmessage($HotKeyhotkey, $HotKeykm_gethotkey, 0, 0)
  3050. EndFunc
  3051.  
  3052. Func _guictrlhotkey_gethotkeyname($HotKeyhotkey)
  3053. If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
  3054. If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
  3055. Local $ihotkey = _guictrlhotkey_gethotkeycode($HotKeyhotkey)
  3056. If $ihotkey = 0 Then Return ""
  3057. Local $sret = ""
  3058. Local $ihibyte = BitShift($ihotkey, 8)
  3059. Local $ilobyte = BitAND($ihotkey, 255)
  3060. If BitAND($ihibyte, $HotKeyotkeyf_control) Then $sret &= "CTRL+"
  3061. If BitAND($ihibyte, $HotKeyotkeyf_shift) Then $sret &= "SHIFT+"
  3062. If BitAND($ihibyte, $HotKeyotkeyf_alt) Then $sret &= "ALT+"
  3063. If BitAND($ihibyte, $HotKeyotkeyf_ext) Then
  3064. Switch $ilobyte
  3065. Case 33
  3066. $sret &= "PGUP"
  3067. Case 34
  3068. $sret &= "PGDN"
  3069. Case 35
  3070. $sret &= "END"
  3071. Case 36
  3072. $sret &= "HOME"
  3073. Case 37
  3074. $sret &= "LEFT"
  3075. Case 38
  3076. $sret &= "UP"
  3077. Case 39
  3078. $sret &= "RIGHT"
  3079. Case 40
  3080. $sret &= "DOWN"
  3081. Case 45
  3082. $sret &= "INSERT"
  3083. Case 111
  3084. $sret &= "NUM DIVIDE"
  3085. Case 144
  3086. $sret &= "NUM LOCK"
  3087. EndSwitch
  3088. Else
  3089. Switch $ilobyte
  3090. Case 0
  3091. Case 20
  3092. $sret &= "CAPSLOCK"
  3093. Case 96 To 105
  3094. $sret &= "NUM " & ($ilobyte - 96) & ""
  3095. Case 106
  3096. $sret &= "NUMMULT"
  3097. Case 107
  3098. $sret &= "NUM PLUS"
  3099. Case 109
  3100. $sret &= "NUM SUB"
  3101. Case 110
  3102. $sret &= "NUM DECIMAL"
  3103. Case 112 To 123
  3104. $sret &= "F" & ($ilobyte - 111)
  3105. Case 145
  3106. $sret &= "SCROLL LOCK"
  3107. Case 186
  3108. $sret &= ";"
  3109. Case 187
  3110. $sret &= "="
  3111. Case 128 To 191
  3112. $sret &= Chr($ilobyte - 144)
  3113. Case 192
  3114. $sret &= "`"
  3115. Case 222
  3116. $sret &= "'"
  3117. Case 193 To 255
  3118. $sret &= Chr($ilobyte - 128)
  3119. Case Else
  3120. $sret &= Chr($ilobyte)
  3121. EndSwitch
  3122. EndIf
  3123. Return $sret
  3124. EndFunc
  3125.  
  3126. Func _guictrlhotkey_setfont($HotKeyhotkey, $nsize, $nweight = 400, $nattribute = 0, $sface = "Arial", $nquality = 2)
  3127. If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
  3128. If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
  3129. Local $HotKeydc, $nheight, $fitalic = False, $funderline = False, $fstrikeout = False, $HotKeyfont, $HotKeyfont_old
  3130. $HotKeydc = _winapi_getdc($HotKeyhotkey)
  3131. If @error Then Return SetError(@error, @extended, 0)
  3132. $nheight = _winapi_muldiv($nsize, _winapi_getdevicecaps($HotKeydc, 90), 72)
  3133. _winapi_releasedc($HotKeyhotkey, $HotKeydc)
  3134. If BitAND($nattribute, 2) Then $fitalic = True
  3135. If BitAND($nattribute, 4) Then $funderline = True
  3136. If BitAND($nattribute, 8) Then $fstrikeout = True
  3137. $HotKeyfont_old = _sendmessage($HotKeyhotkey, $wm_getfont)
  3138. $HotKeyfont = _winapi_createfont($nheight, 0, 0, 0, $nweight, $fitalic, $funderline, $fstrikeout, 1, 0, 0, $nquality, 0, $sface)
  3139. If @error Then Return SetError(@error, @extended, 0)
  3140. _winapi_setfont($HotKeyhotkey, $HotKeyfont, True)
  3141. If @error Then
  3142. _winapi_deleteobject($HotKeyfont)
  3143. Return SetError(@error, @extended, 0)
  3144. EndIf
  3145. If $HotKeyfont_old Then _winapi_deleteobject($HotKeyfont_old)
  3146. Return 1
  3147. EndFunc
  3148.  
  3149. Func _guictrlhotkey_sethotkey($HotKeyhotkey, $shotkey)
  3150. If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
  3151. If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
  3152. If $shotkey = "" Then Return _guictrlhotkey_sethotkeycode($HotKeyhotkey, 0)
  3153. Local $ihibyte = 0
  3154. Local $ilobyte = 0
  3155. $shotkey = StringReplace($shotkey, "^", "")
  3156. If @extended Then $ihibyte += $HotKeyotkeyf_control
  3157. $shotkey = StringReplace($shotkey, "+", "")
  3158. If @extended Then $ihibyte += $HotKeyotkeyf_shift
  3159. $shotkey = StringReplace($shotkey, "!", "")
  3160. If @extended Then $ihibyte += $HotKeyotkeyf_alt
  3161. While 1
  3162. Switch $shotkey
  3163. Case "{PGUP}"
  3164. $ilobyte += 33
  3165. Case "{PGDN}"
  3166. $ilobyte += 34
  3167. Case "{END}"
  3168. $ilobyte += 35
  3169. Case "{HOME}"
  3170. $ilobyte += 36
  3171. Case "{LEFT}"
  3172. $ilobyte += 37
  3173. Case "{UP}"
  3174. $ilobyte += 38
  3175. Case "{RIGHT}"
  3176. $ilobyte += 39
  3177. Case "{DOWN}"
  3178. $ilobyte += 40
  3179. Case "{INS}"
  3180. $ilobyte += 45
  3181. Case "{NUMPADDIV}"
  3182. $ilobyte += 111
  3183. Case "{NUMLOCK}"
  3184. $ilobyte += 144
  3185. Case Else
  3186. Switch $shotkey
  3187. Case "{CAPSLOCK}"
  3188. $ilobyte = 20
  3189. Case "{NUMPADMULT}"
  3190. $ilobyte = 106
  3191. Case "{NUMPADADD}"
  3192. $ilobyte = 107
  3193. Case "{NUMPADSUB}"
  3194. $ilobyte = 109
  3195. Case "{NUMPADDOT}"
  3196. $ilobyte = 110
  3197. Case "{SCROLLLOCK}"
  3198. $ilobyte = 145
  3199. Case ";"
  3200. $ilobyte = 186
  3201. Case "="
  3202. $ilobyte = 187
  3203. Case "`"
  3204. $ilobyte = 192
  3205. Case "'"
  3206. $ilobyte = 222
  3207. Case Else
  3208. While 1
  3209. For $i = 16 To 47
  3210. If $shotkey = Chr($i) Then
  3211. $ilobyte = $i + 144
  3212. ExitLoop 2
  3213. EndIf
  3214. Next
  3215. For $i = 65 To 127
  3216. If $shotkey = Chr($i) Then
  3217. $ilobyte = $i
  3218. ExitLoop 2
  3219. EndIf
  3220. Next
  3221. For $i = 0 To 9
  3222. If $shotkey = "{numpad" & $i & "}" Then
  3223. $ilobyte = $i + 96
  3224. ExitLoop 2
  3225. EndIf
  3226. Next
  3227. For $i = 1 To 12
  3228. If $shotkey = "{f" & $i & "}" Then
  3229. $ilobyte = $i + 111
  3230. ExitLoop 2
  3231. EndIf
  3232. Next
  3233. $ilobyte = Asc($shotkey)
  3234. ExitLoop
  3235. WEnd
  3236. EndSwitch
  3237. ExitLoop
  3238. EndSwitch
  3239. $ihibyte += $HotKeyotkeyf_ext
  3240. ExitLoop
  3241. WEnd
  3242. Return _guictrlhotkey_sethotkeycode($HotKeyhotkey, BitShift($ihibyte, -8) + $ilobyte)
  3243. EndFunc
  3244.  
  3245. Func _guictrlhotkey_sethotkeycode($HotKeyhotkey, $ihotkey)
  3246. If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
  3247. If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
  3248. _sendmessage($HotKeyhotkey, $HotKeykm_sethotkey, $ihotkey, 0)
  3249. Return 1
  3250. EndFunc
  3251.  
  3252. Func _guictrlhotkey_sethotkeyname($HotKeyhotkey, $shotkey)
  3253. If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
  3254. If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
  3255. If $shotkey = "" Then Return _guictrlhotkey_sethotkeycode($HotKeyhotkey, 0)
  3256. Local $ihibyte = 0
  3257. Local $ilobyte = 0
  3258. $shotkey = StringStripWS($shotkey, 8)
  3259. $shotkey = StringReplace($shotkey, "CTRL+", "")
  3260. If @extended Then $ihibyte += $HotKeyotkeyf_control
  3261. $shotkey = StringReplace($shotkey, "SHIFT+", "")
  3262. If @extended Then $ihibyte += $HotKeyotkeyf_shift
  3263. $shotkey = StringReplace($shotkey, "ALT+", "")
  3264. If @extended Then $ihibyte += $HotKeyotkeyf_alt
  3265. Switch $shotkey
  3266. Case "CAPSLOCK"
  3267. $ilobyte = 20
  3268. Case "NUMMULT"
  3269. $ilobyte = 106
  3270. Case "NUMPLUS"
  3271. $ilobyte = 107
  3272. Case "NUMSUB"
  3273. $ilobyte = 109
  3274. Case "NUMDECIMAL"
  3275. $ilobyte = 110
  3276. Case "SCROLLLOCK"
  3277. $ilobyte = 145
  3278. Case ";"
  3279. $ilobyte = 186
  3280. Case "="
  3281. $ilobyte = 187
  3282. Case "`"
  3283. $ilobyte = 192
  3284. Case "'"
  3285. $ilobyte = 222
  3286. Case Else
  3287. While 1
  3288. For $i = 16 To 47
  3289. If $shotkey = Chr($i) Then
  3290. $ilobyte = $i + 144
  3291. ExitLoop 2
  3292. EndIf
  3293. Next
  3294. For $i = 65 To 127
  3295. If $shotkey = Chr($i) Then
  3296. $ilobyte = $i
  3297. ExitLoop 2
  3298. EndIf
  3299. Next
  3300. For $i = 0 To 9
  3301. If $shotkey = "NUM" & $i Then
  3302. $ilobyte = $i + 96
  3303. ExitLoop 2
  3304. EndIf
  3305. Next
  3306. For $i = 1 To 12
  3307. If $shotkey = "F" & $i Then
  3308. $ilobyte = $i + 111
  3309. ExitLoop 2
  3310. EndIf
  3311. Next
  3312. $ilobyte = Asc($shotkey)
  3313. ExitLoop
  3314. WEnd
  3315. EndSwitch
  3316. Return _guictrlhotkey_sethotkeycode($HotKeyhotkey, BitShift($ihibyte, -8) + $ilobyte)
  3317. EndFunc
  3318.  
  3319. Func _guictrlhotkey_setrules($HotKeyhotkey, $icombinv, $imodinv)
  3320. If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
  3321. If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
  3322. _sendmessage($HotKeyhotkey, $HotKeykm_setrules, $icombinv, $imodinv)
  3323. EndFunc
  3324.  
  3325. Func _IsChecked($idControlID)
  3326. Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
  3327. EndFunc
  3328.  
  3329. #RequireAdmin
  3330. #NoTrayIcon
  3331. $x= @DesktopWidth/2-70
  3332. $y= @DesktopHeight/1.5
  3333. Local $Initialized, $v, $z,$v2
  3334.  
  3335. $Initialized = False
  3336. $BreakLagg = False
  3337.  
  3338. $TotalTime = IniRead("Lag.ini", "Lag7", "Sec", "8")
  3339. $CooldownTotal = IniRead("Lag.ini", "Lag7", "CooldownSec", "5")
  3340. $UseCD = IniRead("Lag.ini", "Lag7", "UseCD", "True")
  3341.  
  3342. $GUI = GUICreate("Lag7", 150, 150)
  3343.  
  3344. GUICtrlCreateLabel("Lagg Time", 12, 5, 60, 20)
  3345. $Slider = GUICtrlCreateSlider(3, 22, 95, 25)
  3346. GUICtrlSetLimit(-1, 20, 1)
  3347. GUICtrlSetData(-1, $TotalTime)
  3348. $Slider1Label = GUICtrlCreateLabel($TotalTime & " Sec.", 102, 27, 60, 20)
  3349.  
  3350. GUICtrlCreateLabel("Cooldown Time", 12, 55, 100, 20)
  3351. $Slider2 = GUICtrlCreateSlider(3, 72, 95, 25)
  3352. GUICtrlSetLimit(-1, 10, 1)
  3353. GUICtrlSetData(-1, $CooldownTotal)
  3354. $Slider2Label = GUICtrlCreateLabel($CooldownTotal & " Sec.", 102, 77, 60, 20)
  3355.  
  3356. $UseCDCheckbox = GUICtrlCreateCheckbox("Use CD",12,95,80,20)
  3357. if $UseCD == "True" then
  3358. GUICtrlSetState (-1, 1)
  3359. Else
  3360. GUICtrlSetState (-1, 4)
  3361. EndIf
  3362.  
  3363. $Button = GUICtrlCreateButton("Set", 100, 120, 40, 22)
  3364. $k = _guictrlhotkey_create($GUI, 10, 121, 80, 20)
  3365. $HotKey = IniRead("Lag.ini", "Lag7", "Key", "{f1}")
  3366. _guictrlhotkey_sethotkey($k, $HotKey)
  3367. $n = Run("netsh", "", @SW_HIDE, 1)
  3368. GUISetState()
  3369. HotKeySet($HotKey, "LaggStart")
  3370. HotKeySet("{f8}", "ExitNow")
  3371.  
  3372. Func LaggStart()
  3373. HotKeySet($HotKey)
  3374. If Not $Initialized Then
  3375. Initialize()
  3376. Else
  3377. StdinWrite($n, "ipsec static set policy lag assign=y" & @CRLF)
  3378. WhileLagg()
  3379. EndIf
  3380. EndFunc
  3381.  
  3382. Func WhileLagg()
  3383. HotKeySet($HotKey, "BreakLagg")
  3384. For $TimeLeft = $TotalTime To 0 Step -1
  3385. $Progressstr=""
  3386. $Proc = $TimeLeft/$TotalTime
  3387. $Proc2 = 20*$Proc
  3388.  
  3389. For $i = 1 To $Proc2 Step 1
  3390. $Progressstr =$Progressstr&"-"
  3391. Next
  3392.  
  3393. ToolTip($Progressstr, $x, $y,"Lag7 Started: " & $TimeLeft & " Sec.",0,4)
  3394. $i2 = TimerInit()
  3395. While TimerDiff($i2) < 1000
  3396. If $BreakLagg Then
  3397. LaggEnd()
  3398. Return
  3399. ElseIf GUIGetMsg() = $gui_event_close Then
  3400. ExitNow()
  3401. EndIf
  3402. Sleep(10)
  3403. WEnd
  3404. Next
  3405. LaggEnd()
  3406. EndFunc
  3407.  
  3408. Func BreakLagg()
  3409. $BreakLagg = True
  3410. EndFunc
  3411.  
  3412. Func LaggEnd()
  3413. $BreakLagg = False
  3414. HotKeySet($HotKey)
  3415. StdinWrite($n, "ipsec static set policy lag assign=n" & @CRLF)
  3416. If $UseCD == "True" Then
  3417. For $TL = $CooldownTotal To 0 Step -1
  3418. $Progressstr=""
  3419. $Proc = $TL/$CooldownTotal
  3420. $Proc2 = 20*$Proc
  3421.  
  3422. For $i = 1 To $Proc2 Step 1
  3423. $Progressstr =$Progressstr&"-"
  3424. Next
  3425.  
  3426. ToolTip($Progressstr, $x, $y,"Lag7 Cooldown: " & $TL & " Sec.",0,4)
  3427. $tim = TimerInit()
  3428. While TimerDiff($tim) < 1000
  3429. Sleep(10)
  3430. WEnd
  3431. Next
  3432. EndIf
  3433. ToolTip("Laggspike finished", $x, $y,"Lag7 Finished" ,0,4)
  3434. HotKeySet($HotKey, "LaggStart")
  3435. Sleep(1000)
  3436. ToolTip("")
  3437. EndFunc
  3438.  
  3439. Func Initialize()
  3440. StdinWrite($n, "ipsec static delete all" & @CRLF & "ipsec static add policy lag" & @CRLF & "ipsec static add filterlist lag" & @CRLF & "ipsec static add filter filterlist=lag srcaddr=any dstaddr=any protocol=tcp dstport=1119" & @CRLF & "ipsec static add filter filterlist=lag srcaddr=any dstaddr=any protocol=tcp dstport=3724" & @CRLF & "ipsec static add filter filterlist=lag srcaddr=any dstaddr=any protocol=tcp dstport=4000" & @CRLF & "ipsec static add filter filterlist=lag srcaddr=any dstaddr=any protocol=tcp dstport=6112" & @CRLF & "ipsec static add filteraction lag action=block" & @CRLF & "ipsec static add rule name=lag policy=lag filterlist=lag filteraction=lag" & @CRLF)
  3441. $Initialized = True
  3442. LaggStart()
  3443. EndFunc
  3444.  
  3445. Func ExitNow()
  3446. $z = 1
  3447. StdinWrite($n, "ipsec static delete all" & @CRLF)
  3448. Exit
  3449. EndFunc
  3450.  
  3451.  
  3452. While 1
  3453. $msg = GUIGetMsg()
  3454. Select
  3455. Case $msg = $gui_event_close
  3456. ExitNow()
  3457. Case $msg = $Button
  3458. HotKeySet($HotKey)
  3459. $HotKey = _guictrlhotkey_gethotkey($k)
  3460. If $HotKey = "" Then
  3461. MsgBox(64, "Error", "No hotkey entered")
  3462. Else
  3463. $HotKey = StringLower($HotKey)
  3464. HotKeySet($HotKey, "LaggStart")
  3465. IniWrite("Lag.ini", "Lag7", "Key", $HotKey)
  3466. EndIf
  3467. Case $msg = $UseCDCheckbox
  3468. If _IsChecked($UseCDCheckbox) Then
  3469. IniWrite("Lag.ini", "Lag7", "UseCD", "True")
  3470. $UseCD = "True"
  3471. Else
  3472. IniWrite("Lag.ini", "Lag7", "UseCD", "False")
  3473. $UseCD = "False"
  3474. EndIf
  3475. Case Else
  3476. $TotalTime = GUICtrlRead($Slider)
  3477. If $v <> $TotalTime Then
  3478. $v = $TotalTime
  3479. GUICtrlSetData($Slider1Label, $TotalTime & " Sec.")
  3480. IniWrite("Lag.ini", "Lag7", "Sec", $TotalTime)
  3481. EndIf
  3482.  
  3483. $CooldownTotal = GUICtrlRead($Slider2)
  3484. If $v2 <> $CooldownTotal Then
  3485. $v2 = $CooldownTotal
  3486. GUICtrlSetData($Slider2Label, $CooldownTotal & " Sec.")
  3487. IniWrite("Lag.ini", "Lag7", "CooldownSec", $CooldownTotal)
  3488. EndIf
  3489. EndSelect
  3490. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement