Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RequireAdmin
- Global Const $gui_event_close = -3
- Global Const $gui_event_minimize = -4
- Global Const $gui_event_restore = -5
- Global Const $gui_event_maximize = -6
- Global Const $gui_event_primarydown = -7
- Global Const $gui_event_primaryup = -8
- Global Const $gui_event_secondarydown = -9
- Global Const $gui_event_secondaryup = -10
- Global Const $gui_event_mousemove = -11
- Global Const $gui_event_resized = -12
- Global Const $gui_event_dropped = -13
- Global Const $gui_rundefmsg = "GUI_RUNDEFMSG"
- Global Const $gui_avistop = 0
- Global Const $gui_avistart = 1
- Global Const $gui_aviclose = 2
- Global Const $gui_checked = 1
- Global Const $gui_indeterminate = 2
- Global Const $gui_unchecked = 4
- Global Const $gui_dropaccepted = 8
- Global Const $gui_nodropaccepted = 4096
- Global Const $gui_acceptfiles = $gui_dropaccepted
- Global Const $gui_show = 16
- Global Const $gui_hide = 32
- Global Const $gui_enable = 64
- Global Const $gui_disable = 128
- Global Const $gui_focus = 256
- Global Const $gui_nofocus = 8192
- Global Const $gui_defbutton = 512
- Global Const $gui_expand = 1024
- Global Const $gui_ontop = 2048
- Global Const $gui_fontitalic = 2
- Global Const $gui_fontunder = 4
- Global Const $gui_fontstrike = 8
- Global Const $gui_dockauto = 1
- Global Const $gui_dockleft = 2
- Global Const $gui_dockright = 4
- Global Const $gui_dockhcenter = 8
- Global Const $gui_docktop = 32
- Global Const $gui_dockbottom = 64
- Global Const $gui_dockvcenter = 128
- Global Const $gui_dockwidth = 256
- Global Const $gui_dockheight = 512
- Global Const $gui_docksize = 768
- Global Const $gui_dockmenubar = 544
- Global Const $gui_dockstatebar = 576
- Global Const $gui_dockall = 802
- Global Const $gui_dockborders = 102
- Global Const $gui_gr_close = 1
- Global Const $gui_gr_line = 2
- Global Const $gui_gr_bezier = 4
- Global Const $gui_gr_move = 6
- Global Const $gui_gr_color = 8
- Global Const $gui_gr_rect = 10
- Global Const $gui_gr_ellipse = 12
- Global Const $gui_gr_pie = 14
- Global Const $gui_gr_dot = 16
- Global Const $gui_gr_pixel = 18
- Global Const $gui_gr_hint = 20
- Global Const $gui_gr_refresh = 22
- Global Const $gui_gr_pensize = 24
- Global Const $gui_gr_nobkcolor = -2
- Global Const $gui_bkcolor_default = -1
- Global Const $gui_bkcolor_transparent = -2
- Global Const $gui_bkcolor_lv_alternate = -33554432
- Global Const $gui_ws_ex_parentdrag = 1048576
- Global Const $ws_tiled = 0
- Global Const $ws_overlapped = 0
- Global Const $ws_maximizebox = 65536
- Global Const $ws_minimizebox = 131072
- Global Const $ws_tabstop = 65536
- Global Const $ws_group = 131072
- Global Const $ws_sizebox = 262144
- Global Const $ws_thickframe = 262144
- Global Const $ws_sysmenu = 524288
- Global Const $ws_hscroll = 1048576
- Global Const $ws_vscroll = 2097152
- Global Const $ws_dlgframe = 4194304
- Global Const $ws_border = 8388608
- Global Const $ws_caption = 12582912
- Global Const $ws_overlappedwindow = 13565952
- Global Const $ws_tiledwindow = 13565952
- Global Const $ws_maximize = 16777216
- Global Const $ws_clipchildren = 33554432
- Global Const $ws_clipsiblings = 67108864
- Global Const $ws_disabled = 134217728
- Global Const $ws_visible = 268435456
- Global Const $ws_minimize = 536870912
- Global Const $ws_child = 1073741824
- Global Const $ws_popup = -2147483648
- Global Const $ws_popupwindow = -2138570752
- Global Const $ds_modalframe = 128
- Global Const $ds_setforeground = 512
- Global Const $ds_contexthelp = 8192
- Global Const $ws_ex_acceptfiles = 16
- Global Const $ws_ex_mdichild = 64
- Global Const $ws_ex_appwindow = 262144
- Global Const $ws_ex_composited = 33554432
- Global Const $ws_ex_clientedge = 512
- Global Const $ws_ex_contexthelp = 1024
- Global Const $ws_ex_dlgmodalframe = 1
- Global Const $ws_ex_leftscrollbar = 16384
- Global Const $ws_ex_overlappedwindow = 768
- Global Const $ws_ex_right = 4096
- Global Const $ws_ex_staticedge = 131072
- Global Const $ws_ex_toolwindow = 128
- Global Const $ws_ex_topmost = 8
- Global Const $ws_ex_transparent = 32
- Global Const $ws_ex_windowedge = 256
- Global Const $ws_ex_layered = 524288
- Global Const $ws_ex_controlparent = 65536
- Global Const $ws_ex_layoutrtl = 4194304
- Global Const $ws_ex_rtlreading = 8192
- Global Const $wm_gettextlength = 14
- Global Const $wm_gettext = 13
- Global Const $wm_size = 5
- Global Const $wm_sizing = 532
- Global Const $wm_user = 1024
- Global Const $wm_create = 1
- Global Const $wm_destroy = 2
- Global Const $wm_move = 3
- Global Const $wm_activate = 6
- Global Const $wm_setfocus = 7
- Global Const $wm_killfocus = 8
- Global Const $wm_enable = 10
- Global Const $wm_setredraw = 11
- Global Const $wm_settext = 12
- Global Const $wm_paint = 15
- Global Const $wm_close = 16
- Global Const $wm_quit = 18
- Global Const $wm_erasebkgnd = 20
- Global Const $wm_syscolorchange = 21
- Global Const $wm_showwindow = 24
- Global Const $wm_wininichange = 26
- Global Const $wm_devmodechange = 27
- Global Const $wm_activateapp = 28
- Global Const $wm_fontchange = 29
- Global Const $wm_timechange = 30
- Global Const $wm_cancelmode = 31
- Global Const $wm_setcursor = 32
- Global Const $wm_mouseactivate = 33
- Global Const $wm_childactivate = 34
- Global Const $wm_queuesync = 35
- Global Const $wm_getminmaxinfo = 36
- Global Const $wm_painticon = 38
- Global Const $wm_iconerasebkgnd = 39
- Global Const $wm_nextdlgctl = 40
- Global Const $wm_spoolerstatus = 42
- Global Const $wm_drawitem = 43
- Global Const $wm_measureitem = 44
- Global Const $wm_deleteitem = 45
- Global Const $wm_vkeytoitem = 46
- Global Const $wm_chartoitem = 47
- Global Const $wm_setfont = 48
- Global Const $wm_getfont = 49
- Global Const $wm_sethotkey = 50
- Global Const $wm_gethotkey = 51
- Global Const $wm_querydragicon = 55
- Global Const $wm_compareitem = 57
- Global Const $wm_getobject = 61
- Global Const $wm_compacting = 65
- Global Const $wm_commnotify = 68
- Global Const $wm_windowposchanging = 70
- Global Const $wm_windowposchanged = 71
- Global Const $wm_power = 72
- Global Const $wm_notify = 78
- Global Const $wm_copydata = 74
- Global Const $wm_canceljournal = 75
- Global Const $wm_inputlangchangerequest = 80
- Global Const $wm_inputlangchange = 81
- Global Const $wm_tcard = 82
- Global Const $wm_help = 83
- Global Const $wm_userchanged = 84
- Global Const $wm_notifyformat = 85
- Global Const $wm_cut = 768
- Global Const $wm_copy = 769
- Global Const $wm_paste = 770
- Global Const $wm_clear = 771
- Global Const $wm_undo = 772
- Global Const $wm_contextmenu = 123
- Global Const $wm_stylechanging = 124
- Global Const $wm_stylechanged = 125
- Global Const $wm_displaychange = 126
- Global Const $wm_geticon = 127
- Global Const $wm_seticon = 128
- Global Const $wm_nccreate = 129
- Global Const $wm_ncdestroy = 130
- Global Const $wm_nccalcsize = 131
- Global Const $wm_nchittest = 132
- Global Const $wm_ncpaint = 133
- Global Const $wm_ncactivate = 134
- Global Const $wm_getdlgcode = 135
- Global Const $wm_syncpaint = 136
- Global Const $wm_ncmousemove = 160
- Global Const $wm_nclbuttondown = 161
- Global Const $wm_nclbuttonup = 162
- Global Const $wm_nclbuttondblclk = 163
- Global Const $wm_ncrbuttondown = 164
- Global Const $wm_ncrbuttonup = 165
- Global Const $wm_ncrbuttondblclk = 166
- Global Const $wm_ncmbuttondown = 167
- Global Const $wm_ncmbuttonup = 168
- Global Const $wm_ncmbuttondblclk = 169
- Global Const $wm_keydown = 256
- Global Const $wm_keyup = 257
- Global Const $wm_char = 258
- Global Const $wm_deadchar = 259
- Global Const $wm_syskeydown = 260
- Global Const $wm_syskeyup = 261
- Global Const $wm_syschar = 262
- Global Const $wm_sysdeadchar = 263
- Global Const $wm_initdialog = 272
- Global Const $wm_command = 273
- Global Const $wm_syscommand = 274
- Global Const $wm_timer = 275
- Global Const $wm_hscroll = 276
- Global Const $wm_vscroll = 277
- Global Const $wm_initmenu = 278
- Global Const $wm_initmenupopup = 279
- Global Const $wm_menuselect = 287
- Global Const $wm_menuchar = 288
- Global Const $wm_enteridle = 289
- Global Const $wm_menurbuttonup = 290
- Global Const $wm_menudrag = 291
- Global Const $wm_menugetobject = 292
- Global Const $wm_uninitmenupopup = 293
- Global Const $wm_menucommand = 294
- Global Const $wm_changeuistate = 295
- Global Const $wm_updateuistate = 296
- Global Const $wm_queryuistate = 297
- Global Const $wm_ctlcolormsgbox = 306
- Global Const $wm_ctlcoloredit = 307
- Global Const $wm_ctlcolorlistbox = 308
- Global Const $wm_ctlcolorbtn = 309
- Global Const $wm_ctlcolordlg = 310
- Global Const $wm_ctlcolorscrollbar = 311
- Global Const $wm_ctlcolorstatic = 312
- Global Const $wm_ctlcolor = 25
- Global Const $mn_gethmenu = 481
- Global Const $nm_first = 0
- Global Const $nm_outofmemory = $nm_first - 1
- Global Const $nm_click = $nm_first - 2
- Global Const $nm_dblclk = $nm_first - 3
- Global Const $nm_return = $nm_first - 4
- Global Const $nm_rclick = $nm_first - 5
- Global Const $nm_rdblclk = $nm_first - 6
- Global Const $nm_setfocus = $nm_first - 7
- Global Const $nm_killfocus = $nm_first - 8
- Global Const $nm_customdraw = $nm_first - 12
- Global Const $nm_hover = $nm_first - 13
- Global Const $nm_nchittest = $nm_first - 14
- Global Const $nm_keydown = $nm_first - 15
- Global Const $nm_releasedcapture = $nm_first - 16
- Global Const $nm_setcursor = $nm_first - 17
- Global Const $nm_char = $nm_first - 18
- Global Const $nm_tooltipscreated = $nm_first - 19
- Global Const $nm_ldown = $nm_first - 20
- Global Const $nm_rdown = $nm_first - 21
- Global Const $nm_themechanged = $nm_first - 22
- Global Const $wm_mousemove = 512
- Global Const $wm_lbuttondown = 513
- Global Const $wm_lbuttonup = 514
- Global Const $wm_lbuttondblclk = 515
- Global Const $wm_rbuttondown = 516
- Global Const $wm_rbuttonup = 517
- Global Const $wm_rbuttondblck = 518
- Global Const $wm_mbuttondown = 519
- Global Const $wm_mbuttonup = 520
- Global Const $wm_mbuttondblck = 521
- Global Const $wm_mousewheel = 522
- Global Const $wm_xbuttondown = 523
- Global Const $wm_xbuttonup = 524
- Global Const $wm_xbuttondblclk = 525
- Global Const $wm_mousehwheel = 526
- Global Const $ps_solid = 0
- Global Const $ps_dash = 1
- Global Const $ps_dot = 2
- Global Const $ps_dashdot = 3
- Global Const $ps_dashdotdot = 4
- Global Const $ps_null = 5
- Global Const $ps_insideframe = 6
- Global Const $lwa_alpha = 2
- Global Const $lwa_colorkey = 1
- Global Const $rgn_and = 1
- Global Const $rgn_or = 2
- Global Const $rgn_xor = 3
- Global Const $rgn_diff = 4
- Global Const $rgn_copy = 5
- Global Const $errorregion = 0
- Global Const $nullregion = 1
- Global Const $simpleregion = 2
- Global Const $complexregion = 3
- Global Const $TotalTimeransparent = 1
- Global Const $opaque = 2
- Global Const $ccm_first = 8192
- Global Const $ccm_getunicodeformat = ($ccm_first + 6)
- Global Const $ccm_setunicodeformat = ($ccm_first + 5)
- Global Const $ccm_setbkcolor = $ccm_first + 1
- Global Const $ccm_setcolorscheme = $ccm_first + 2
- Global Const $ccm_getcolorscheme = $ccm_first + 3
- Global Const $ccm_getdroptarget = $ccm_first + 4
- Global Const $ccm_setwindowtheme = $ccm_first + 11
- Global Const $ga_parent = 1
- Global Const $ga_root = 2
- Global Const $ga_rootowner = 3
- Global Const $sm_cxscreen = 0
- Global Const $sm_cyscreen = 1
- Global Const $sm_cxvscroll = 2
- Global Const $sm_cyhscroll = 3
- Global Const $sm_cycaption = 4
- Global Const $sm_cxborder = 5
- Global Const $sm_cyborder = 6
- Global Const $sm_cxdlgframe = 7
- Global Const $sm_cydlgframe = 8
- Global Const $sm_cyvthumb = 9
- Global Const $sm_cxhthumb = 10
- Global Const $sm_cxicon = 11
- Global Const $sm_cyicon = 12
- Global Const $sm_cxcursor = 13
- Global Const $sm_cycursor = 14
- Global Const $sm_cymenu = 15
- Global Const $sm_cxfullscreen = 16
- Global Const $sm_cyfullscreen = 17
- Global Const $sm_cykanjiwindow = 18
- Global Const $sm_mousepresent = 19
- Global Const $sm_cyvscroll = 20
- Global Const $sm_cxhscroll = 21
- Global Const $sm_debug = 22
- Global Const $sm_swapbutton = 23
- Global Const $sm_reserved1 = 24
- Global Const $sm_reserved2 = 25
- Global Const $sm_reserved3 = 26
- Global Const $sm_reserved4 = 27
- Global Const $sm_cxmin = 28
- Global Const $sm_cymin = 29
- Global Const $sm_cxsize = 30
- Global Const $sm_cysize = 31
- Global Const $sm_cxframe = 32
- Global Const $sm_cyframe = 33
- Global Const $sm_cxmintrack = 34
- Global Const $sm_cymintrack = 35
- Global Const $sm_cxdoubleclk = 36
- Global Const $sm_cydoubleclk = 37
- Global Const $sm_cxiconspacing = 38
- Global Const $sm_cyiconspacing = 39
- Global Const $sm_menudropalignment = 40
- Global Const $sm_penwindows = 41
- Global Const $sm_dbcsenabled = 42
- Global Const $sm_cmousebuttons = 43
- Global Const $sm_secure = 44
- Global Const $sm_cxedge = 45
- Global Const $sm_cyedge = 46
- Global Const $sm_cxminspacing = 47
- Global Const $sm_cyminspacing = 48
- Global Const $sm_cxsmicon = 49
- Global Const $sm_cysmicon = 50
- Global Const $sm_cysmcaption = 51
- Global Const $sm_cxsmsize = 52
- Global Const $sm_cysmsize = 53
- Global Const $sm_cxmenusize = 54
- Global Const $sm_cymenusize = 55
- Global Const $sm_arrange = 56
- Global Const $sm_cxminimized = 57
- Global Const $sm_cyminimized = 58
- Global Const $sm_cxmaxtrack = 59
- Global Const $sm_cymaxtrack = 60
- Global Const $sm_cxmaximized = 61
- Global Const $sm_cymaximized = 62
- Global Const $sm_network = 63
- Global Const $sm_cleanboot = 67
- Global Const $sm_cxdrag = 68
- Global Const $sm_cydrag = 69
- Global Const $sm_showsounds = 70
- Global Const $sm_cxmenucheck = 71
- Global Const $sm_cymenucheck = 72
- Global Const $sm_slowmachine = 73
- Global Const $sm_mideastenabled = 74
- Global Const $sm_mousewheelpresent = 75
- Global Const $sm_xvirtualscreen = 76
- Global Const $sm_yvirtualscreen = 77
- Global Const $sm_cxvirtualscreen = 78
- Global Const $sm_cyvirtualscreen = 79
- Global Const $sm_cmonitors = 80
- Global Const $sm_samedisplayformat = 81
- Global Const $sm_immenabled = 82
- Global Const $sm_cxfocusborder = 83
- Global Const $sm_cyfocusborder = 84
- Global Const $sm_tabletpc = 86
- Global Const $sm_mediacenter = 87
- Global Const $sm_starter = 88
- Global Const $sm_serverr2 = 89
- Global Const $sm_cmetrics = 90
- Global Const $sm_remotesession = 4096
- Global Const $sm_shuttingdown = 8192
- Global Const $sm_remotecontrol = 8193
- Global Const $sm_caretblinkingenabled = 8194
- Global Const $blackness = 66
- Global Const $captureblt = 1073741824
- Global Const $dstinvert = 5570569
- Global Const $mergecopy = 12583114
- Global Const $mergepaint = 12255782
- Global Const $nomirrorbitmap = -2147483648
- Global Const $notsrccopy = 3342344
- Global Const $notsrcerase = 1114278
- Global Const $patcopy = 15728673
- Global Const $patinvert = 5898313
- Global Const $patpaint = 16452105
- Global Const $srcand = 8913094
- Global Const $srccopy = 13369376
- Global Const $srcerase = 4457256
- Global Const $srcinvert = 6684742
- Global Const $srcpaint = 15597702
- Global Const $whiteness = 16711778
- Global Const $dt_bottom = 8
- Global Const $dt_calcrect = 1024
- Global Const $dt_center = 1
- Global Const $dt_editcontrol = 8192
- Global Const $dt_end_ellipsis = 32768
- Global Const $dt_expandtabs = 64
- Global Const $dt_externalleading = 512
- Global Const $dt_hideprefix = 1048576
- Global Const $dt_internal = 4096
- Global Const $dt_left = 0
- Global Const $dt_modifystring = 65536
- Global Const $dt_noclip = 256
- Global Const $dt_nofullwidthcharbreak = 524288
- Global Const $dt_noprefix = 2048
- Global Const $dt_path_ellipsis = 16384
- Global Const $dt_prefixonly = 2097152
- Global Const $dt_right = 2
- Global Const $dt_rtlreading = 131072
- Global Const $dt_singleline = 32
- Global Const $dt_tabstop = 128
- Global Const $dt_top = 0
- Global Const $dt_vcenter = 4
- Global Const $dt_wordbreak = 16
- Global Const $dt_word_ellipsis = 262144
- Global Const $rdw_erase = 4
- Global Const $rdw_frame = 1024
- Global Const $rdw_internalpaint = 2
- Global Const $rdw_invalidate = 1
- Global Const $rdw_noerase = 32
- Global Const $rdw_noframe = 2048
- Global Const $rdw_nointernalpaint = 16
- Global Const $rdw_validate = 8
- Global Const $rdw_erasenow = 512
- Global Const $rdw_updatenow = 256
- Global Const $rdw_allchildren = 128
- Global Const $rdw_nochildren = 64
- Global Const $wm_renderformat = 773
- Global Const $wm_renderallformats = 774
- Global Const $wm_destroyclipboard = 775
- Global Const $wm_drawclipboard = 776
- Global Const $wm_paintclipboard = 777
- Global Const $wm_vscrollclipboard = 778
- Global Const $wm_sizeclipboard = 779
- Global Const $wm_askcbformatname = 780
- Global Const $wm_changecbchain = 781
- Global Const $wm_hscrollclipboard = 782
- Global Const $HotKeyterror = -2
- Global Const $HotKeyttransparent = -1
- Global Const $HotKeytnowhere = 0
- Global Const $HotKeytclient = 1
- Global Const $HotKeytcaption = 2
- Global Const $HotKeytsysmenu = 3
- Global Const $HotKeytgrowbox = 4
- Global Const $HotKeytsize = $HotKeytgrowbox
- Global Const $HotKeytmenu = 5
- Global Const $HotKeythscroll = 6
- Global Const $HotKeytvscroll = 7
- Global Const $HotKeytminbutton = 8
- Global Const $HotKeytmaxbutton = 9
- Global Const $HotKeytleft = 10
- Global Const $HotKeytright = 11
- Global Const $HotKeyttop = 12
- Global Const $HotKeyttopleft = 13
- Global Const $HotKeyttopright = 14
- Global Const $HotKeytbottom = 15
- Global Const $HotKeytbottomleft = 16
- Global Const $HotKeytbottomright = 17
- Global Const $HotKeytborder = 18
- Global Const $HotKeytreduce = $HotKeytminbutton
- Global Const $HotKeytzoom = $HotKeytmaxbutton
- Global Const $HotKeytsizefirst = $HotKeytleft
- Global Const $HotKeytsizelast = $HotKeytbottomright
- Global Const $HotKeytobject = 19
- Global Const $HotKeytclose = 20
- Global Const $HotKeythelp = 21
- Global Const $color_scrollbar = 0
- Global Const $color_background = 1
- Global Const $color_activecaption = 2
- Global Const $color_inactivecaption = 3
- Global Const $color_menu = 4
- Global Const $color_window = 5
- Global Const $color_windowframe = 6
- Global Const $color_menutext = 7
- Global Const $color_windowtext = 8
- Global Const $color_captiontext = 9
- Global Const $color_activeborder = 10
- Global Const $color_inactiveborder = 11
- Global Const $color_appworkspace = 12
- Global Const $color_highlight = 13
- Global Const $color_highlighttext = 14
- Global Const $color_btnface = 15
- Global Const $color_btnshadow = 16
- Global Const $color_graytext = 17
- Global Const $color_btntext = 18
- Global Const $color_inactivecaptiontext = 19
- Global Const $color_btnhighlight = 20
- Global Const $color_3ddkshadow = 21
- Global Const $color_3dlight = 22
- Global Const $color_infotext = 23
- Global Const $color_infobk = 24
- Global Const $color_hotlight = 26
- Global Const $color_gradientactivecaption = 27
- Global Const $color_gradientinactivecaption = 28
- Global Const $color_menuhilight = 29
- Global Const $color_menubar = 30
- Global Const $color_desktop = 1
- Global Const $color_3dface = 15
- Global Const $color_3dshadow = 16
- Global Const $color_3dhighlight = 20
- Global Const $color_3dhilight = 20
- Global Const $color_btnhilight = 20
- Global Const $HotKeyinst_commctrl = -1
- Global Const $idb_std_small_color = 0
- Global Const $idb_std_large_color = 1
- Global Const $idb_view_small_color = 4
- Global Const $idb_view_large_color = 5
- Global Const $idb_hist_small_color = 8
- Global Const $idb_hist_large_color = 9
- Global Const $startf_forceofffeedback = 128
- Global Const $startf_forceonfeedback = 64
- Global Const $startf_runfullscreen = 32
- Global Const $startf_usecountchars = 8
- Global Const $startf_usefillattribute = 16
- Global Const $startf_usehotkey = 512
- Global Const $startf_useposition = 4
- Global Const $startf_useshowwindow = 1
- Global Const $startf_usesize = 2
- Global Const $startf_usestdhandles = 256
- Global Const $cdds_prepaint = 1
- Global Const $cdds_postpaint = 2
- Global Const $cdds_preerase = 3
- Global Const $cdds_posterase = 4
- Global Const $cdds_item = 65536
- Global Const $cdds_itemprepaint = 65537
- Global Const $cdds_itempostpaint = 65538
- Global Const $cdds_itempreerase = 65539
- Global Const $cdds_itemposterase = 65540
- Global Const $cdds_subitem = 131072
- Global Const $cdis_selected = 1
- Global Const $cdis_grayed = 2
- Global Const $cdis_disabled = 4
- Global Const $cdis_checked = 8
- Global Const $cdis_focus = 16
- Global Const $cdis_default = 32
- Global Const $cdis_hot = 64
- Global Const $cdis_marked = 128
- Global Const $cdis_indeterminate = 256
- Global Const $cdis_showkeyboardcues = 512
- Global Const $cdis_nearhot = 1024
- Global Const $cdis_othersidehot = 2048
- Global Const $cdis_drophilited = 4096
- Global Const $cdrf_dodefault = 0
- Global Const $cdrf_newfont = 2
- Global Const $cdrf_skipdefault = 4
- Global Const $cdrf_notifypostpaint = 16
- Global Const $cdrf_notifyitemdraw = 32
- Global Const $cdrf_notifysubitemdraw = 32
- Global Const $cdrf_notifyposterase = 64
- Global Const $cdrf_doerase = 8
- Global Const $cdrf_skippostpaint = 256
- Global Const $gui_ss_default_gui = BitOR($ws_minimizebox, $ws_caption, $ws_popup, $ws_sysmenu)
- Global Const $TotalTimeagpoint = "long X;long Y"
- Global Const $TotalTimeagrect = "long Left;long Top;long Right;long Bottom"
- Global Const $TotalTimeagsize = "long X;long Y"
- Global Const $TotalTimeagmargins = "int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight"
- Global Const $TotalTimeagfiletime = "dword Lo;dword Hi"
- Global Const $TotalTimeagsystemtime = "word Year;word Month;word Dow;word Day;word Hour;word Minute;word Second;word MSeconds"
- Global Const $TotalTimeagtime_zone_information = "long Bias;wchar StdName[32];word StdDate[8];long StdBias;wchar DayName[32];word DayDate[8];long DayBias"
- Global Const $TotalTimeagnmhdr = "hwnd hWndFrom;uint_ptr IDFrom;INT Code"
- Global Const $TotalTimeagcomboboxexitem = "uint Mask;int_ptr Item;ptr Text;int TextMax;int Image;int SelectedImage;int OverlayImage;" & "int Indent;lparam Param"
- Global Const $TotalTimeagnmcbedragbegin = $TotalTimeagnmhdr & ";int ItemID;ptr szText"
- Global Const $TotalTimeagnmcbeendedit = $TotalTimeagnmhdr & ";bool fChanged;int NewSelection;ptr szText;int Why"
- Global Const $TotalTimeagnmcomboboxex = $TotalTimeagnmhdr & ";uint Mask;int_ptr Item;ptr Text;int TextMax;int Image;" & "int SelectedImage;int OverlayImage;int Indent;lparam Param"
- 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"
- Global Const $TotalTimeagnmdatetimechange = $TotalTimeagnmhdr & ";dword Flag;" & $TotalTimeagsystemtime
- Global Const $TotalTimeagnmdatetimeformat = $TotalTimeagnmhdr & ";ptr Format;" & $TotalTimeagsystemtime & ";ptr pDisplay;wchar Display[64]"
- Global Const $TotalTimeagnmdatetimeformatquery = $TotalTimeagnmhdr & ";ptr Format;long SizeX;long SizeY"
- Global Const $TotalTimeagnmdatetimekeydown = $TotalTimeagnmhdr & ";int VirtKey;ptr Format;" & $TotalTimeagsystemtime
- Global Const $TotalTimeagnmdatetimestring = $TotalTimeagnmhdr & ";ptr UserString;" & $TotalTimeagsystemtime & ";dword Flags"
- 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"
- Global Const $TotalTimeaggdipbitmapdata = "uint Width;uint Height;int Stride;int Format;ptr Scan0;uint_ptr Reserved"
- Global Const $TotalTimeaggdipencoderparam = "byte GUID[16];dword Count;dword Type;ptr Values"
- Global Const $TotalTimeaggdipencoderparams = "dword Count;byte Params[0]"
- Global Const $TotalTimeaggdiprectf = "float X;float Y;float Width;float Height"
- Global Const $TotalTimeaggdipstartupinput = "uint Version;ptr Callback;bool NoThread;bool NoCodecs"
- Global Const $TotalTimeaggdipstartupoutput = "ptr HookProc;ptr UnhookProc"
- 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"
- Global Const $TotalTimeaggdippencoderparams = "dword Count;byte Params[0]"
- 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"
- Global Const $TotalTimeagnmhddispinfo = $TotalTimeagnmhdr & ";int Item;uint Mask;ptr Text;int TextMax;int Image;lparam lParam"
- Global Const $TotalTimeagnmhdfilterbtnclick = $TotalTimeagnmhdr & ";int Item;" & $TotalTimeagrect
- Global Const $TotalTimeagnmheader = $TotalTimeagnmhdr & ";int Item;int Button;ptr pItem"
- Global Const $TotalTimeaggetipaddress = "byte Field4;byte Field3;byte Field2;byte Field1"
- Global Const $TotalTimeagnmipaddress = $TotalTimeagnmhdr & ";int Field;int Value"
- Global Const $TotalTimeaglvfindinfo = "uint Flags;ptr Text;lparam Param;" & $TotalTimeagpoint & ";uint Direction"
- Global Const $TotalTimeaglvhittestinfo = $TotalTimeagpoint & ";uint Flags;int Item;int SubItem"
- 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"
- Global Const $TotalTimeagnmlistview = $TotalTimeagnmhdr & ";int Item;int SubItem;uint NewState;uint OldState;uint Changed;" & "long ActionX;long ActionY;lparam Param"
- 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"
- Global Const $TotalTimeagnmlvdispinfo = $TotalTimeagnmhdr & ";" & $TotalTimeaglvitem
- Global Const $TotalTimeagnmlvfinditem = $TotalTimeagnmhdr & ";" & $TotalTimeaglvfindinfo
- Global Const $TotalTimeagnmlvgetinfotip = $TotalTimeagnmhdr & ";dword Flags;ptr Text;int TextMax;int Item;int SubItem;lparam lParam"
- Global Const $TotalTimeagnmitemactivate = $TotalTimeagnmhdr & ";int Index;int SubItem;uint NewState;uint OldState;uint Changed;" & $TotalTimeagpoint & ";lparam lParam;uint KeyFlags"
- Global Const $TotalTimeagnmlvkeydown = $TotalTimeagnmhdr & ";align 1;word VKey;uint Flags"
- Global Const $TotalTimeagnmlvscroll = $TotalTimeagnmhdr & ";int DX;int DY"
- Global Const $TotalTimeagmchittestinfo = "uint Size;" & $TotalTimeagpoint & ";uint Hit;" & $TotalTimeagsystemtime
- 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"
- 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"
- 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"
- Global Const $TotalTimeagnmdaystate = $TotalTimeagnmhdr & ";" & $TotalTimeagsystemtime & ";int DayState;ptr pDayState"
- 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"
- Global Const $TotalTimeagnmobjectnotify = $TotalTimeagnmhdr & ";int Item;ptr piid;ptr pObject;long Result"
- Global Const $TotalTimeagnmtckeydown = $TotalTimeagnmhdr & ";word VKey;uint Flags"
- Global Const $TotalTimeagtvitem = "uint Mask;handle hItem;uint State;uint StateMask;ptr Text;int TextMax;int Image;int SelectedImage;" & "int Children;lparam Param"
- Global Const $TotalTimeagtvitemex = $TotalTimeagtvitem & ";int Integral"
- 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"
- 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"
- Global Const $TotalTimeagnmtvdispinfo = $TotalTimeagnmhdr & ";" & $TotalTimeagtvitem
- Global Const $TotalTimeagnmtvgetinfotip = $TotalTimeagnmhdr & ";ptr Text;int TextMax;handle hItem;lparam lParam"
- Global Const $TotalTimeagtvhittestinfo = $TotalTimeagpoint & ";uint Flags;handle Item"
- Global Const $TotalTimeagnmtvkeydown = $TotalTimeagnmhdr & ";word VKey;uint Flags"
- Global Const $TotalTimeagnmmouse = $TotalTimeagnmhdr & ";dword_ptr ItemSpec;dword_ptr ItemData;" & $TotalTimeagpoint & ";lparam HitInfo"
- Global Const $TotalTimeagtoken_privileges = "dword Count;int64 LUID;dword Attributes"
- Global Const $TotalTimeagimageinfo = "handle hBitmap;handle hMask;int Unused1;int Unused2;" & $TotalTimeagrect
- Global Const $TotalTimeagmenuinfo = "dword Size;INT Mask;dword Style;uint YMax;handle hBack;dword ContextHelpID;ulong_ptr MenuData"
- 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"
- 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"
- Global Const $TotalTimeagnmrebarautobreak = $TotalTimeagnmhdr & ";uint uBand;uint wID;lparam lParam;uint uMsg;uint fStyleCurrent;bool fAutoBreak"
- Global Const $TotalTimeagnmrbautosize = $TotalTimeagnmhdr & ";bool fChanged;long TargetLeft;long TargetTop;long TargetRight;long TargetBottom;" & "long ActualLeft;long ActualTop;long ActualRight;long ActualBottom"
- Global Const $TotalTimeagnmrebar = $TotalTimeagnmhdr & ";dword dwMask;uint uBand;uint fStyle;uint wID;laram lParam"
- Global Const $TotalTimeagnmrebarchevron = $TotalTimeagnmhdr & ";uint uBand;uint wID;lparam lParam;" & $TotalTimeagrect & ";lparam lParamNM"
- Global Const $TotalTimeagnmrebarchildsize = $TotalTimeagnmhdr & ";uint uBand;uint wID;long CLeft;long CTop;long CRight;long CBottom;" & "long BLeft;long BTop;long BRight;long BBottom"
- Global Const $TotalTimeagcolorscheme = "dword Size;dword BtnHighlight;dword BtnShadow"
- 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
- Global Const $TotalTimeagnmtbhotitem = $TotalTimeagnmhdr & ";int idOld;int idNew;dword dwFlags"
- Global Const $TotalTimeagtbbutton = "int Bitmap;int Command;byte State;byte Style;align;dword_ptr Param;int_ptr String"
- Global Const $TotalTimeagtbbuttoninfo = "uint Size;dword Mask;int Command;int Image;byte State;byte Style;word CX;dword_ptr Param;ptr Text;int TextMax"
- Global Const $TotalTimeagnetresource = "dword Scope;dword Type;dword DisplayType;dword Usage;ptr LocalName;ptr RemoteName;ptr Comment;ptr Provider"
- Global Const $TotalTimeagoverlapped = "ulong_ptr Internal;ulong_ptr InternalHigh;dword Offset;dword OffsetHigh;handle hEvent"
- 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"
- 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"
- Global Const $TotalTimeagblendfunction = "byte Op;byte Flags;byte Alpha;byte Format"
- Global Const $TotalTimeagguid = "dword Data1;word Data2;word Data3;byte Data4[8]"
- Global Const $TotalTimeagwindowplacement = "uint length; uint flags;uint showCmd;long ptMinPosition[2];long ptMaxPosition[2];long rcNormalPosition[4]"
- Global Const $TotalTimeagwindowpos = "hwnd hWnd;hwnd InsertAfter;int X;int Y;int CX;int CY;uint Flags"
- Global Const $TotalTimeagscrollinfo = "uint cbSize;uint fMask;int nMin;int nMax;uint nPage;int nPos;int nTrackPos"
- Global Const $TotalTimeagscrollbarinfo = "dword cbSize;" & $TotalTimeagrect & ";int dxyLineButton;int xyThumbTop;" & "int xyThumbBottom;int reserved;dword rgstate[6]"
- 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]"
- Global Const $TotalTimeagkbdllhookstruct = "dword vkCode;dword scanCode;dword flags;dword time;ulong_ptr dwExtraInfo"
- Global Const $TotalTimeagprocess_information = "handle hProcess;handle hThread;dword ProcessID;dword ThreadID"
- 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"
- Global Const $TotalTimeagsecurity_attributes = "dword Length;ptr Descriptor;bool InheritHandle"
- 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]"
- Global Const $fc_nooverwrite = 0
- Global Const $fc_overwrite = 1
- Global Const $ft_modified = 0
- Global Const $ft_created = 1
- Global Const $ft_accessed = 2
- Global Const $fo_read = 0
- Global Const $fo_append = 1
- Global Const $fo_overwrite = 2
- Global Const $fo_binary = 16
- Global Const $fo_unicode = 32
- Global Const $fo_utf16_le = 32
- Global Const $fo_utf16_be = 64
- Global Const $fo_utf8 = 128
- Global Const $fo_utf8_nobom = 256
- Global Const $eof = -1
- Global Const $fd_filemustexist = 1
- Global Const $fd_pathmustexist = 2
- Global Const $fd_multiselect = 4
- Global Const $fd_promptcreatenew = 8
- Global Const $fd_promptoverwrite = 16
- Global Const $create_new = 1
- Global Const $create_always = 2
- Global Const $open_existing = 3
- Global Const $open_always = 4
- Global Const $TotalTimeruncate_existing = 5
- Global Const $invalid_set_file_pointer = -1
- Global Const $file_begin = 0
- Global Const $file_current = 1
- Global Const $file_end = 2
- Global Const $file_attribute_readonly = 1
- Global Const $file_attribute_hidden = 2
- Global Const $file_attribute_system = 4
- Global Const $file_attribute_directory = 16
- Global Const $file_attribute_archive = 32
- Global Const $file_attribute_device = 64
- Global Const $file_attribute_normal = 128
- Global Const $file_attribute_temporary = 256
- Global Const $file_attribute_sparse_file = 512
- Global Const $file_attribute_reparse_point = 1024
- Global Const $file_attribute_compressed = 2048
- Global Const $file_attribute_offline = 4096
- Global Const $file_attribute_not_content_indexed = 8192
- Global Const $file_attribute_encrypted = 16384
- Global Const $file_share_read = 1
- Global Const $file_share_write = 2
- Global Const $file_share_delete = 4
- Global Const $generic_all = 268435456
- Global Const $generic_execute = 536870912
- Global Const $generic_write = 1073741824
- Global Const $generic_read = -2147483648
- Global Const $error_no_token = 1008
- Global Const $se_assignprimarytoken_name = "SeAssignPrimaryTokenPrivilege"
- Global Const $se_audit_name = "SeAuditPrivilege"
- Global Const $se_backup_name = "SeBackupPrivilege"
- Global Const $se_change_notify_name = "SeChangeNotifyPrivilege"
- Global Const $se_create_global_name = "SeCreateGlobalPrivilege"
- Global Const $se_create_pagefile_name = "SeCreatePagefilePrivilege"
- Global Const $se_create_permanent_name = "SeCreatePermanentPrivilege"
- Global Const $se_create_token_name = "SeCreateTokenPrivilege"
- Global Const $se_debug_name = "SeDebugPrivilege"
- Global Const $se_enable_delegation_name = "SeEnableDelegationPrivilege"
- Global Const $se_impersonate_name = "SeImpersonatePrivilege"
- Global Const $se_inc_base_priority_name = "SeIncreaseBasePriorityPrivilege"
- Global Const $se_increase_quota_name = "SeIncreaseQuotaPrivilege"
- Global Const $se_load_driver_name = "SeLoadDriverPrivilege"
- Global Const $se_lock_memory_name = "SeLockMemoryPrivilege"
- Global Const $se_machine_account_name = "SeMachineAccountPrivilege"
- Global Const $se_manage_volume_name = "SeManageVolumePrivilege"
- Global Const $se_prof_single_process_name = "SeProfileSingleProcessPrivilege"
- Global Const $se_remote_shutdown_name = "SeRemoteShutdownPrivilege"
- Global Const $se_restore_name = "SeRestorePrivilege"
- Global Const $se_security_name = "SeSecurityPrivilege"
- Global Const $se_shutdown_name = "SeShutdownPrivilege"
- Global Const $se_sync_agent_name = "SeSyncAgentPrivilege"
- Global Const $se_system_environment_name = "SeSystemEnvironmentPrivilege"
- Global Const $se_system_profile_name = "SeSystemProfilePrivilege"
- Global Const $se_systemtime_name = "SeSystemtimePrivilege"
- Global Const $se_take_ownership_name = "SeTakeOwnershipPrivilege"
- Global Const $se_tcb_name = "SeTcbPrivilege"
- Global Const $se_unsolicited_input_name = "SeUnsolicitedInputPrivilege"
- Global Const $se_undock_name = "SeUndockPrivilege"
- Global Const $se_privilege_enabled_by_default = 1
- Global Const $se_privilege_enabled = 2
- Global Const $se_privilege_removed = 4
- Global Const $se_privilege_used_for_access = -2147483648
- Global Const $TotalTimeokenuser = 1
- Global Const $TotalTimeokengroups = 2
- Global Const $TotalTimeokenprivileges = 3
- Global Const $TotalTimeokenowner = 4
- Global Const $TotalTimeokenprimarygroup = 5
- Global Const $TotalTimeokendefaultdacl = 6
- Global Const $TotalTimeokensource = 7
- Global Const $TotalTimeokentype = 8
- Global Const $TotalTimeokenimpersonationlevel = 9
- Global Const $TotalTimeokenstatistics = 10
- Global Const $TotalTimeokenrestrictedsids = 11
- Global Const $TotalTimeokensessionid = 12
- Global Const $TotalTimeokengroupsandprivileges = 13
- Global Const $TotalTimeokensessionreference = 14
- Global Const $TotalTimeokensandboxinert = 15
- Global Const $TotalTimeokenauditpolicy = 16
- Global Const $TotalTimeokenorigin = 17
- Global Const $TotalTimeokenelevationtype = 18
- Global Const $TotalTimeokenlinkedtoken = 19
- Global Const $TotalTimeokenelevation = 20
- Global Const $TotalTimeokenhasrestrictions = 21
- Global Const $TotalTimeokenaccessinformation = 22
- Global Const $TotalTimeokenvirtualizationallowed = 23
- Global Const $TotalTimeokenvirtualizationenabled = 24
- Global Const $TotalTimeokenintegritylevel = 25
- Global Const $TotalTimeokenuiaccess = 26
- Global Const $TotalTimeokenmandatorypolicy = 27
- Global Const $TotalTimeokenlogonsid = 28
- Global Const $TotalTimeoken_assign_primary = 1
- Global Const $TotalTimeoken_duplicate = 2
- Global Const $TotalTimeoken_impersonate = 4
- Global Const $TotalTimeoken_query = 8
- Global Const $TotalTimeoken_query_source = 16
- Global Const $TotalTimeoken_adjust_privileges = 32
- Global Const $TotalTimeoken_adjust_groups = 64
- Global Const $TotalTimeoken_adjust_default = 128
- Global Const $TotalTimeoken_adjust_sessionid = 256
- Func _winapi_getlasterror($curerr = @error, $curext = @extended)
- Local $aresult = DllCall("kernel32.dll", "dword", "GetLastError")
- Return SetError($curerr, $curext, $aresult[0])
- EndFunc
- Func _winapi_setlasterror($ierrcode, $curerr = @error, $curext = @extended)
- DllCall("kernel32.dll", "none", "SetLastError", "dword", $ierrcode)
- Return SetError($curerr, $curext)
- EndFunc
- Func _security__adjusttokenprivileges($HotKeytoken, $fdisableall, $pnewstate, $ibufferlen, $pprevstate = 0, $prequired = 0)
- Local $aresult = DllCall("advapi32.dll", "bool", "AdjustTokenPrivileges", "handle", $HotKeytoken, "bool", $fdisableall, "ptr", $pnewstate, "dword", $ibufferlen, "ptr", $pprevstate, "ptr", $prequired)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _security__getaccountsid($saccount, $ssystem = "")
- Local $aacct = _security__lookupaccountname($saccount, $ssystem)
- If @error Then Return SetError(@error, 0, 0)
- Return _security__stringsidtosid($aacct[0])
- EndFunc
- Func _security__getlengthsid($psid)
- If NOT _security__isvalidsid($psid) Then Return SetError(-1, 0, 0)
- Local $aresult = DllCall("advapi32.dll", "dword", "GetLengthSid", "ptr", $psid)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _security__gettokeninformation($HotKeytoken, $iclass)
- Local $aresult = DllCall("advapi32.dll", "bool", "GetTokenInformation", "handle", $HotKeytoken, "int", $iclass, "ptr", 0, "dword", 0, "dword*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- If NOT $aresult[0] Then Return 0
- Local $TotalTimebuffer = DllStructCreate("byte[" & $aresult[5] & "]")
- Local $pbuffer = DllStructGetPtr($TotalTimebuffer)
- $aresult = DllCall("advapi32.dll", "bool", "GetTokenInformation", "handle", $HotKeytoken, "int", $iclass, "ptr", $pbuffer, "dword", $aresult[5], "dword*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- If NOT $aresult[0] Then Return 0
- Return $TotalTimebuffer
- EndFunc
- Func _security__impersonateself($ilevel = 2)
- Local $aresult = DllCall("advapi32.dll", "bool", "ImpersonateSelf", "int", $ilevel)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _security__isvalidsid($psid)
- Local $aresult = DllCall("advapi32.dll", "bool", "IsValidSid", "ptr", $psid)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _security__lookupaccountname($saccount, $ssystem = "")
- Local $TotalTimedata = DllStructCreate("byte SID[256]")
- Local $psid = DllStructGetPtr($TotalTimedata, "SID")
- Local $aresult = DllCall("advapi32.dll", "bool", "LookupAccountNameW", "wstr", $ssystem, "wstr", $saccount, "ptr", $psid, "dword*", 256, "wstr", "", "dword*", 256, "int*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- If NOT $aresult[0] Then Return 0
- Local $aacct[3]
- $aacct[0] = _security__sidtostringsid($psid)
- $aacct[1] = $aresult[5]
- $aacct[2] = $aresult[7]
- Return $aacct
- EndFunc
- Func _security__lookupaccountsid($vsid)
- Local $psid, $aacct[3]
- If IsString($vsid) Then
- Local $TotalTimesid = _security__stringsidtosid($vsid)
- $psid = DllStructGetPtr($TotalTimesid)
- Else
- $psid = $vsid
- EndIf
- If NOT _security__isvalidsid($psid) Then Return SetError(-1, 0, 0)
- Local $aresult = DllCall("advapi32.dll", "bool", "LookupAccountSidW", "ptr", 0, "ptr", $psid, "wstr", "", "dword*", 256, "wstr", "", "dword*", 256, "int*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- If NOT $aresult[0] Then Return 0
- Local $aacct[3]
- $aacct[0] = $aresult[3]
- $aacct[1] = $aresult[5]
- $aacct[2] = $aresult[7]
- Return $aacct
- EndFunc
- Func _security__lookupprivilegevalue($ssystem, $sname)
- Local $aresult = DllCall("advapi32.dll", "int", "LookupPrivilegeValueW", "wstr", $ssystem, "wstr", $sname, "int64*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- Return SetError(0, $aresult[0], $aresult[3])
- EndFunc
- Func _security__openprocesstoken($HotKeyprocess, $iaccess)
- Local $aresult = DllCall("advapi32.dll", "int", "OpenProcessToken", "handle", $HotKeyprocess, "dword", $iaccess, "ptr", 0)
- If @error Then Return SetError(@error, @extended, 0)
- Return SetError(0, $aresult[0], $aresult[3])
- EndFunc
- Func _security__openthreadtoken($iaccess, $HotKeythread = 0, $fopenasself = False)
- If $HotKeythread = 0 Then $HotKeythread = DllCall("kernel32.dll", "handle", "GetCurrentThread")
- If @error Then Return SetError(@error, @extended, 0)
- Local $aresult = DllCall("advapi32.dll", "bool", "OpenThreadToken", "handle", $HotKeythread[0], "dword", $iaccess, "int", $fopenasself, "ptr*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- Return SetError(0, $aresult[0], $aresult[4])
- EndFunc
- Func _security__openthreadtokenex($iaccess, $HotKeythread = 0, $fopenasself = False)
- Local $HotKeytoken = _security__openthreadtoken($iaccess, $HotKeythread, $fopenasself)
- If $HotKeytoken = 0 Then
- If _winapi_getlasterror() <> $error_no_token Then Return SetError(-3, _winapi_getlasterror(), 0)
- If NOT _security__impersonateself() Then Return SetError(-1, _winapi_getlasterror(), 0)
- $HotKeytoken = _security__openthreadtoken($iaccess, $HotKeythread, $fopenasself)
- If $HotKeytoken = 0 Then Return SetError(-2, _winapi_getlasterror(), 0)
- EndIf
- Return $HotKeytoken
- EndFunc
- Func _security__setprivilege($HotKeytoken, $sprivilege, $fenable)
- Local $iluid = _security__lookupprivilegevalue("", $sprivilege)
- If $iluid = 0 Then Return SetError(-1, 0, False)
- Local $TotalTimecurrstate = DllStructCreate($TotalTimeagtoken_privileges)
- Local $pcurrstate = DllStructGetPtr($TotalTimecurrstate)
- Local $icurrstate = DllStructGetSize($TotalTimecurrstate)
- Local $TotalTimeprevstate = DllStructCreate($TotalTimeagtoken_privileges)
- Local $pprevstate = DllStructGetPtr($TotalTimeprevstate)
- Local $iprevstate = DllStructGetSize($TotalTimeprevstate)
- Local $TotalTimerequired = DllStructCreate("int Data")
- Local $prequired = DllStructGetPtr($TotalTimerequired)
- DllStructSetData($TotalTimecurrstate, "Count", 1)
- DllStructSetData($TotalTimecurrstate, "LUID", $iluid)
- If NOT _security__adjusttokenprivileges($HotKeytoken, False, $pcurrstate, $icurrstate, $pprevstate, $prequired) Then Return SetError(-2, @error, False)
- DllStructSetData($TotalTimeprevstate, "Count", 1)
- DllStructSetData($TotalTimeprevstate, "LUID", $iluid)
- Local $iattributes = DllStructGetData($TotalTimeprevstate, "Attributes")
- If $fenable Then
- $iattributes = BitOR($iattributes, $se_privilege_enabled)
- Else
- $iattributes = BitAND($iattributes, BitNOT($se_privilege_enabled))
- EndIf
- DllStructSetData($TotalTimeprevstate, "Attributes", $iattributes)
- If NOT _security__adjusttokenprivileges($HotKeytoken, False, $pprevstate, $iprevstate, $pcurrstate, $prequired) Then Return SetError(-3, @error, False)
- Return True
- EndFunc
- Func _security__sidtostringsid($psid)
- If NOT _security__isvalidsid($psid) Then Return SetError(-1, 0, "")
- Local $aresult = DllCall("advapi32.dll", "int", "ConvertSidToStringSidW", "ptr", $psid, "ptr*", 0)
- If @error Then Return SetError(@error, @extended, "")
- If NOT $aresult[0] Then Return ""
- Local $TotalTimebuffer = DllStructCreate("wchar Text[256]", $aresult[2])
- Local $ssid = DllStructGetData($TotalTimebuffer, "Text")
- DllCall("Kernel32.dll", "ptr", "LocalFree", "ptr", $aresult[2])
- Return $ssid
- EndFunc
- Func _security__sidtypestr($itype)
- Switch $itype
- Case 1
- Return "User"
- Case 2
- Return "Group"
- Case 3
- Return "Domain"
- Case 4
- Return "Alias"
- Case 5
- Return "Well Known Group"
- Case 6
- Return "Deleted Account"
- Case 7
- Return "Invalid"
- Case 8
- Return "Invalid"
- Case 9
- Return "Computer"
- Case Else
- Return "Unknown SID Type"
- EndSwitch
- EndFunc
- Func _security__stringsidtosid($ssid)
- Local $aresult = DllCall("advapi32.dll", "bool", "ConvertStringSidToSidW", "wstr", $ssid, "ptr*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- If NOT $aresult[0] Then Return 0
- Local $isize = _security__getlengthsid($aresult[2])
- Local $TotalTimebuffer = DllStructCreate("byte Data[" & $isize & "]", $aresult[2])
- Local $TotalTimesid = DllStructCreate("byte Data[" & $isize & "]")
- DllStructSetData($TotalTimesid, "Data", DllStructGetData($TotalTimebuffer, "Data"))
- DllCall("kernel32.dll", "ptr", "LocalFree", "ptr", $aresult[2])
- Return $TotalTimesid
- EndFunc
- Func _sendmessage($HotKeywnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
- Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageW", "hwnd", $HotKeywnd, "uint", $imsg, $wparamtype, $wparam, $lparamtype, $lparam)
- If @error Then Return SetError(@error, @extended, "")
- If $ireturn >= 0 AND $ireturn <= 4 Then Return $aresult[$ireturn]
- Return $aresult
- EndFunc
- Func _sendmessagea($HotKeywnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
- Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageA", "hwnd", $HotKeywnd, "uint", $imsg, $wparamtype, $wparam, $lparamtype, $lparam)
- If @error Then Return SetError(@error, @extended, "")
- If $ireturn >= 0 AND $ireturn <= 4 Then Return $aresult[$ireturn]
- Return $aresult
- EndFunc
- Global $__gainprocess_winapi[64][2] = [[0, 0]]
- Global $__gawinlist_winapi[64][2] = [[0, 0]]
- Global Const $__winapiconstant_wm_setfont = 48
- Global Const $__winapiconstant_fw_normal = 400
- Global Const $__winapiconstant_default_charset = 1
- Global Const $__winapiconstant_out_default_precis = 0
- Global Const $__winapiconstant_clip_default_precis = 0
- Global Const $__winapiconstant_default_quality = 0
- Global Const $__winapiconstant_format_message_allocate_buffer = 256
- Global Const $__winapiconstant_format_message_from_system = 4096
- Global Const $__winapiconstant_logpixelsx = 88
- Global Const $__winapiconstant_logpixelsy = 90
- Global Const $HotKeygdi_error = Ptr(-1)
- Global Const $invalid_handle_value = Ptr(-1)
- Global Const $clr_invalid = -1
- Global Const $__winapiconstant_flashw_caption = 1
- Global Const $__winapiconstant_flashw_tray = 2
- Global Const $__winapiconstant_flashw_timer = 4
- Global Const $__winapiconstant_flashw_timernofg = 12
- Global Const $__winapiconstant_gw_hwndnext = 2
- Global Const $__winapiconstant_gw_child = 5
- Global Const $__winapiconstant_di_mask = 1
- Global Const $__winapiconstant_di_image = 2
- Global Const $__winapiconstant_di_normal = 3
- Global Const $__winapiconstant_di_compat = 4
- Global Const $__winapiconstant_di_defaultsize = 8
- Global Const $__winapiconstant_di_nomirror = 16
- Global Const $__winapiconstant_display_device_attached_to_desktop = 1
- Global Const $__winapiconstant_display_device_primary_device = 4
- Global Const $__winapiconstant_display_device_mirroring_driver = 8
- Global Const $__winapiconstant_display_device_vga_compatible = 16
- Global Const $__winapiconstant_display_device_removable = 32
- Global Const $__winapiconstant_display_device_modespruned = 134217728
- Global Const $null_brush = 5
- Global Const $null_pen = 8
- Global Const $black_brush = 4
- Global Const $dkgray_brush = 3
- Global Const $dc_brush = 18
- Global Const $gray_brush = 2
- Global Const $HotKeyollow_brush = $null_brush
- Global Const $ltgray_brush = 1
- Global Const $white_brush = 0
- Global Const $black_pen = 7
- Global Const $dc_pen = 19
- Global Const $white_pen = 6
- Global Const $ansi_fixed_font = 11
- Global Const $ansi_var_font = 12
- Global Const $device_default_font = 14
- Global Const $default_gui_font = 17
- Global Const $oem_fixed_font = 10
- Global Const $system_font = 13
- Global Const $system_fixed_font = 16
- Global Const $default_palette = 15
- Global Const $mb_precomposed = 1
- Global Const $mb_composite = 2
- Global Const $mb_useglyphchars = 4
- Global Const $ulw_alpha = 2
- Global Const $ulw_colorkey = 1
- Global Const $ulw_opaque = 4
- Global Const $wh_callwndproc = 4
- Global Const $wh_callwndprocret = 12
- Global Const $wh_cbt = 5
- Global Const $wh_debug = 9
- Global Const $wh_foregroundidle = 11
- Global Const $wh_getmessage = 3
- Global Const $wh_journalplayback = 1
- Global Const $wh_journalrecord = 0
- Global Const $wh_keyboard = 2
- Global Const $wh_keyboard_ll = 13
- Global Const $wh_mouse = 7
- Global Const $wh_mouse_ll = 14
- Global Const $wh_msgfilter = -1
- Global Const $wh_shell = 10
- Global Const $wh_sysmsgfilter = 6
- Global Const $wpf_asyncwindowplacement = 4
- Global Const $wpf_restoretomaximized = 2
- Global Const $wpf_setminposition = 1
- Global Const $kf_extended = 256
- Global Const $kf_altdown = 8192
- Global Const $kf_up = 32768
- Global Const $llkhf_extended = BitShift($kf_extended, 8)
- Global Const $llkhf_injected = 16
- Global Const $llkhf_altdown = BitShift($kf_altdown, 8)
- Global Const $llkhf_up = BitShift($kf_up, 8)
- Global Const $ofn_allowmultiselect = 512
- Global Const $ofn_createprompt = 8192
- Global Const $ofn_dontaddtorecent = 33554432
- Global Const $ofn_enablehook = 32
- Global Const $ofn_enableincludenotify = 4194304
- Global Const $ofn_enablesizing = 8388608
- Global Const $ofn_enabletemplate = 64
- Global Const $ofn_enabletemplatehandle = 128
- Global Const $ofn_explorer = 524288
- Global Const $ofn_extensiondifferent = 1024
- Global Const $ofn_filemustexist = 4096
- Global Const $ofn_forceshowhidden = 268435456
- Global Const $ofn_hidereadonly = 4
- Global Const $ofn_longnames = 2097152
- Global Const $ofn_nochangedir = 8
- Global Const $ofn_nodereferencelinks = 1048576
- Global Const $ofn_nolongnames = 262144
- Global Const $ofn_nonetworkbutton = 131072
- Global Const $ofn_noreadonlyreturn = 32768
- Global Const $ofn_notestfilecreate = 65536
- Global Const $ofn_novalidate = 256
- Global Const $ofn_overwriteprompt = 2
- Global Const $ofn_pathmustexist = 2048
- Global Const $ofn_readonly = 1
- Global Const $ofn_shareaware = 16384
- Global Const $ofn_showhelp = 16
- Global Const $ofn_ex_noplacesbar = 1
- Global Const $TotalTimeagcursorinfo = "dword Size;dword Flags;handle hCursor;" & $TotalTimeagpoint
- Global Const $TotalTimeagdisplay_device = "dword Size;wchar Name[32];wchar String[128];dword Flags;wchar ID[128];wchar Key[128]"
- Global Const $TotalTimeagflashwinfo = "uint Size;hwnd hWnd;dword Flags;uint Count;dword TimeOut"
- Global Const $TotalTimeagiconinfo = "bool Icon;dword XHotSpot;dword YHotSpot;handle hMask;handle hColor"
- Global Const $TotalTimeagmemorystatusex = "dword Length;dword MemoryLoad;" & "uint64 TotalPhys;uint64 AvailPhys;uint64 TotalPageFile;uint64 AvailPageFile;" & "uint64 TotalVirtual;uint64 AvailVirtual;uint64 AvailExtendedVirtual"
- Func _winapi_attachconsole($iprocessid = -1)
- Local $aresult = DllCall("kernel32.dll", "bool", "AttachConsole", "dword", $iprocessid)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_attachthreadinput($iattach, $iattachto, $fattach)
- Local $aresult = DllCall("user32.dll", "bool", "AttachThreadInput", "dword", $iattach, "dword", $iattachto, "bool", $fattach)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_beep($ifreq = 500, $iduration = 1000)
- Local $aresult = DllCall("kernel32.dll", "bool", "Beep", "dword", $ifreq, "dword", $iduration)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_bitblt($HotKeydestdc, $ixdest, $iydest, $iwidth, $iheight, $HotKeysrcdc, $ixsrc, $iysrc, $irop)
- 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)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_callnexthookex($HotKeyhk, $icode, $wparam, $lparam)
- Local $aresult = DllCall("user32.dll", "lresult", "CallNextHookEx", "handle", $HotKeyhk, "int", $icode, "wparam", $wparam, "lparam", $lparam)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_callwindowproc($lpprevwndfunc, $HotKeywnd, $msg, $wparam, $lparam)
- Local $aresult = DllCall("user32.dll", "lresult", "CallWindowProc", "ptr", $lpprevwndfunc, "hwnd", $HotKeywnd, "uint", $msg, "wparam", $wparam, "lparam", $lparam)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_clienttoscreen($HotKeywnd, ByRef $TotalTimepoint)
- Local $ppoint = DllStructGetPtr($TotalTimepoint)
- DllCall("user32.dll", "bool", "ClientToScreen", "hwnd", $HotKeywnd, "ptr", $ppoint)
- Return SetError(@error, @extended, $TotalTimepoint)
- EndFunc
- Func _winapi_closehandle($HotKeyobject)
- Local $aresult = DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $HotKeyobject)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_combinergn($HotKeyrgndest, $HotKeyrgnsrc1, $HotKeyrgnsrc2, $icombinemode)
- Local $aresult = DllCall("gdi32.dll", "int", "CombineRgn", "handle", $HotKeyrgndest, "handle", $HotKeyrgnsrc1, "handle", $HotKeyrgnsrc2, "int", $icombinemode)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_commdlgextendederror()
- Local Const $cderr_dialogfailure = 65535
- Local Const $cderr_findresfailure = 6
- Local Const $cderr_initialization = 2
- Local Const $cderr_loadresfailure = 7
- Local Const $cderr_loadstrfailure = 5
- Local Const $cderr_lockresfailure = 8
- Local Const $cderr_memallocfailure = 9
- Local Const $cderr_memlockfailure = 10
- Local Const $cderr_nohinstance = 4
- Local Const $cderr_nohook = 11
- Local Const $cderr_notemplate = 3
- Local Const $cderr_registermsgfail = 12
- Local Const $cderr_structsize = 1
- Local Const $fnerr_buffertoosmall = 12291
- Local Const $fnerr_invalidfilename = 12290
- Local Const $fnerr_subclassfailure = 12289
- Local $aresult = DllCall("comdlg32.dll", "dword", "CommDlgExtendedError")
- If @error Then Return SetError(@error, @extended, 0)
- Switch $aresult[0]
- Case $cderr_dialogfailure
- 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.")
- Case $cderr_findresfailure
- Return SetError($aresult[0], 0, "The common dialog box function failed to find a specified resource.")
- Case $cderr_initialization
- Return SetError($aresult[0], 0, "The common dialog box function failed during initialization." & @LF & "This error often occurs when sufficient memory is not available.")
- Case $cderr_loadresfailure
- Return SetError($aresult[0], 0, "The common dialog box function failed to load a specified resource.")
- Case $cderr_loadstrfailure
- Return SetError($aresult[0], 0, "The common dialog box function failed to load a specified string.")
- Case $cderr_lockresfailure
- Return SetError($aresult[0], 0, "The common dialog box function failed to lock a specified resource.")
- Case $cderr_memallocfailure
- Return SetError($aresult[0], 0, "The common dialog box function was unable to allocate memory for internal structures.")
- Case $cderr_memlockfailure
- Return SetError($aresult[0], 0, "The common dialog box function was unable to lock the memory associated with a handle.")
- Case $cderr_nohinstance
- 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.")
- Case $cderr_nohook
- 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.")
- Case $cderr_notemplate
- 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.")
- Case $cderr_registermsgfail
- Return SetError($aresult[0], 0, "The RegisterWindowMessage function returned an error code when it was called by the common dialog box function.")
- Case $cderr_structsize
- Return SetError($aresult[0], 0, "The lStructSize member of the initialization structure for the corresponding common dialog box is invalid")
- Case $fnerr_buffertoosmall
- 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.")
- Case $fnerr_invalidfilename
- Return SetError($aresult[0], 0, "A file name is invalid.")
- Case $fnerr_subclassfailure
- Return SetError($aresult[0], 0, "An attempt to subclass a list box failed because sufficient memory was not available.")
- EndSwitch
- Return Hex($aresult[0])
- EndFunc
- Func _winapi_copyicon($HotKeyicon)
- Local $aresult = DllCall("user32.dll", "handle", "CopyIcon", "handle", $HotKeyicon)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createbitmap($iwidth, $iheight, $iplanes = 1, $ibitsperpel = 1, $pbits = 0)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateBitmap", "int", $iwidth, "int", $iheight, "uint", $iplanes, "uint", $ibitsperpel, "ptr", $pbits)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createcompatiblebitmap($HotKeydc, $iwidth, $iheight)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateCompatibleBitmap", "handle", $HotKeydc, "int", $iwidth, "int", $iheight)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createcompatibledc($HotKeydc)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateCompatibleDC", "handle", $HotKeydc)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createevent($pattributes = 0, $fmanualreset = True, $finitialstate = True, $sname = "")
- Local $snametype = "wstr"
- If $sname = "" Then
- $sname = 0
- $snametype = "ptr"
- EndIf
- Local $aresult = DllCall("kernel32.dll", "handle", "CreateEventW", "ptr", $pattributes, "bool", $fmanualreset, "bool", $finitialstate, $snametype, $sname)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createfile($sfilename, $icreation, $iaccess = 4, $ishare = 0, $iattributes = 0, $psecurity = 0)
- Local $ida = 0, $ism = 0, $icd = 0, $ifa = 0
- If BitAND($iaccess, 1) <> 0 Then $ida = BitOR($ida, $generic_execute)
- If BitAND($iaccess, 2) <> 0 Then $ida = BitOR($ida, $generic_read)
- If BitAND($iaccess, 4) <> 0 Then $ida = BitOR($ida, $generic_write)
- If BitAND($ishare, 1) <> 0 Then $ism = BitOR($ism, $file_share_delete)
- If BitAND($ishare, 2) <> 0 Then $ism = BitOR($ism, $file_share_read)
- If BitAND($ishare, 4) <> 0 Then $ism = BitOR($ism, $file_share_write)
- Switch $icreation
- Case 0
- $icd = $create_new
- Case 1
- $icd = $create_always
- Case 2
- $icd = $open_existing
- Case 3
- $icd = $open_always
- Case 4
- $icd = $TotalTimeruncate_existing
- EndSwitch
- If BitAND($iattributes, 1) <> 0 Then $ifa = BitOR($ifa, $file_attribute_archive)
- If BitAND($iattributes, 2) <> 0 Then $ifa = BitOR($ifa, $file_attribute_hidden)
- If BitAND($iattributes, 4) <> 0 Then $ifa = BitOR($ifa, $file_attribute_readonly)
- If BitAND($iattributes, 8) <> 0 Then $ifa = BitOR($ifa, $file_attribute_system)
- Local $aresult = DllCall("kernel32.dll", "handle", "CreateFileW", "wstr", $sfilename, "dword", $ida, "dword", $ism, "ptr", $psecurity, "dword", $icd, "dword", $ifa, "ptr", 0)
- If @error OR $aresult[0] = Ptr(-1) Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- 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")
- 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)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createfontindirect($TotalTimelogfont)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateFontIndirectW", "ptr", DllStructGetPtr($TotalTimelogfont))
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createpen($ipenstyle, $iwidth, $ncolor)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreatePen", "int", $ipenstyle, "int", $iwidth, "dword", $ncolor)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createprocess($sappname, $scommand, $psecurity, $pthread, $finherit, $iflags, $penviron, $sdir, $pstartupinfo, $pprocess)
- Local $pcommand = 0
- Local $sappnametype = "wstr", $sdirtype = "wstr"
- If $sappname = "" Then
- $sappnametype = "ptr"
- $sappname = 0
- EndIf
- If $scommand <> "" Then
- Local $TotalTimecommand = DllStructCreate("wchar Text[" & 260 + 1 & "]")
- $pcommand = DllStructGetPtr($TotalTimecommand)
- DllStructSetData($TotalTimecommand, "Text", $scommand)
- EndIf
- If $sdir = "" Then
- $sdirtype = "ptr"
- $sdir = 0
- EndIf
- 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)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_createrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateRectRgn", "int", $ileftrect, "int", $itoprect, "int", $irightrect, "int", $ibottomrect)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createroundrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect, $iwidthellipse, $iheightellipse)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateRoundRectRgn", "int", $ileftrect, "int", $itoprect, "int", $irightrect, "int", $ibottomrect, "int", $iwidthellipse, "int", $iheightellipse)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createsolidbitmap($HotKeywnd, $icolor, $iwidth, $iheight, $brgb = 1)
- Local $HotKeydc = _winapi_getdc($HotKeywnd)
- Local $HotKeydestdc = _winapi_createcompatibledc($HotKeydc)
- Local $HotKeybitmap = _winapi_createcompatiblebitmap($HotKeydc, $iwidth, $iheight)
- Local $HotKeyold = _winapi_selectobject($HotKeydestdc, $HotKeybitmap)
- Local $TotalTimerect = DllStructCreate($TotalTimeagrect)
- DllStructSetData($TotalTimerect, 1, 0)
- DllStructSetData($TotalTimerect, 2, 0)
- DllStructSetData($TotalTimerect, 3, $iwidth)
- DllStructSetData($TotalTimerect, 4, $iheight)
- If $brgb Then
- $icolor = BitOR(BitAND($icolor, 65280), BitShift(BitAND($icolor, 255), -16), BitShift(BitAND($icolor, 16711680), 16))
- EndIf
- Local $HotKeybrush = _winapi_createsolidbrush($icolor)
- _winapi_fillrect($HotKeydestdc, DllStructGetPtr($TotalTimerect), $HotKeybrush)
- If @error Then
- _winapi_deleteobject($HotKeybitmap)
- $HotKeybitmap = 0
- EndIf
- _winapi_deleteobject($HotKeybrush)
- _winapi_releasedc($HotKeywnd, $HotKeydc)
- _winapi_selectobject($HotKeydestdc, $HotKeyold)
- _winapi_deletedc($HotKeydestdc)
- If NOT $HotKeybitmap Then Return SetError(1, 0, 0)
- Return $HotKeybitmap
- EndFunc
- Func _winapi_createsolidbrush($ncolor)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateSolidBrush", "dword", $ncolor)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createwindowex($iexstyle, $sclass, $sname, $istyle, $ix, $iy, $iwidth, $iheight, $HotKeyparent, $HotKeymenu = 0, $HotKeyinstance = 0, $pparam = 0)
- If $HotKeyinstance = 0 Then $HotKeyinstance = _winapi_getmodulehandle("")
- 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)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_defwindowproc($HotKeywnd, $imsg, $iwparam, $ilparam)
- Local $aresult = DllCall("user32.dll", "lresult", "DefWindowProc", "hwnd", $HotKeywnd, "uint", $imsg, "wparam", $iwparam, "lparam", $ilparam)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_deletedc($HotKeydc)
- Local $aresult = DllCall("gdi32.dll", "bool", "DeleteDC", "handle", $HotKeydc)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_deleteobject($HotKeyobject)
- Local $aresult = DllCall("gdi32.dll", "bool", "DeleteObject", "handle", $HotKeyobject)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_destroyicon($HotKeyicon)
- Local $aresult = DllCall("user32.dll", "bool", "DestroyIcon", "handle", $HotKeyicon)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_destroywindow($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "bool", "DestroyWindow", "hwnd", $HotKeywnd)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_drawedge($HotKeydc, $ptrrect, $nedgetype, $grfflags)
- Local $aresult = DllCall("user32.dll", "bool", "DrawEdge", "handle", $HotKeydc, "ptr", $ptrrect, "uint", $nedgetype, "uint", $grfflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_drawframecontrol($HotKeydc, $ptrrect, $ntype, $nstate)
- Local $aresult = DllCall("user32.dll", "bool", "DrawFrameControl", "handle", $HotKeydc, "ptr", $ptrrect, "uint", $ntype, "uint", $nstate)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_drawicon($HotKeydc, $ix, $iy, $HotKeyicon)
- Local $aresult = DllCall("user32.dll", "bool", "DrawIcon", "handle", $HotKeydc, "int", $ix, "int", $iy, "handle", $HotKeyicon)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_drawiconex($HotKeydc, $ix, $iy, $HotKeyicon, $iwidth = 0, $iheight = 0, $istep = 0, $HotKeybrush = 0, $iflags = 3)
- Local $ioptions
- Switch $iflags
- Case 1
- $ioptions = $__winapiconstant_di_mask
- Case 2
- $ioptions = $__winapiconstant_di_image
- Case 3
- $ioptions = $__winapiconstant_di_normal
- Case 4
- $ioptions = $__winapiconstant_di_compat
- Case 5
- $ioptions = $__winapiconstant_di_defaultsize
- Case Else
- $ioptions = $__winapiconstant_di_nomirror
- EndSwitch
- 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)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_drawline($HotKeydc, $ix1, $iy1, $ix2, $iy2)
- _winapi_moveto($HotKeydc, $ix1, $iy1)
- If @error Then Return SetError(@error, @extended, False)
- _winapi_lineto($HotKeydc, $ix2, $iy2)
- If @error Then Return SetError(@error, @extended, False)
- Return True
- EndFunc
- Func _winapi_drawtext($HotKeydc, $stext, ByRef $TotalTimerect, $iflags)
- Local $aresult = DllCall("user32.dll", "int", "DrawTextW", "handle", $HotKeydc, "wstr", $stext, "int", -1, "ptr", DllStructGetPtr($TotalTimerect), "uint", $iflags)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_enablewindow($HotKeywnd, $fenable = True)
- Local $aresult = DllCall("user32.dll", "bool", "EnableWindow", "hwnd", $HotKeywnd, "bool", $fenable)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_enumdisplaydevices($sdevice, $idevnum)
- Local $pname = 0, $iflags = 0, $adevice[5]
- If $sdevice <> "" Then
- Local $TotalTimename = DllStructCreate("wchar Text[" & StringLen($sdevice) + 1 & "]")
- $pname = DllStructGetPtr($TotalTimename)
- DllStructSetData($TotalTimename, "Text", $sdevice)
- EndIf
- Local $TotalTimedevice = DllStructCreate($TotalTimeagdisplay_device)
- Local $pdevice = DllStructGetPtr($TotalTimedevice)
- Local $idevice = DllStructGetSize($TotalTimedevice)
- DllStructSetData($TotalTimedevice, "Size", $idevice)
- DllCall("user32.dll", "bool", "EnumDisplayDevicesW", "ptr", $pname, "dword", $idevnum, "ptr", $pdevice, "dword", 1)
- If @error Then Return SetError(@error, @extended, 0)
- Local $in = DllStructGetData($TotalTimedevice, "Flags")
- If BitAND($in, $__winapiconstant_display_device_attached_to_desktop) <> 0 Then $iflags = BitOR($iflags, 1)
- If BitAND($in, $__winapiconstant_display_device_primary_device) <> 0 Then $iflags = BitOR($iflags, 2)
- If BitAND($in, $__winapiconstant_display_device_mirroring_driver) <> 0 Then $iflags = BitOR($iflags, 4)
- If BitAND($in, $__winapiconstant_display_device_vga_compatible) <> 0 Then $iflags = BitOR($iflags, 8)
- If BitAND($in, $__winapiconstant_display_device_removable) <> 0 Then $iflags = BitOR($iflags, 16)
- If BitAND($in, $__winapiconstant_display_device_modespruned) <> 0 Then $iflags = BitOR($iflags, 32)
- $adevice[0] = True
- $adevice[1] = DllStructGetData($TotalTimedevice, "Name")
- $adevice[2] = DllStructGetData($TotalTimedevice, "String")
- $adevice[3] = $iflags
- $adevice[4] = DllStructGetData($TotalTimedevice, "ID")
- Return $adevice
- EndFunc
- Func _winapi_enumwindows($fvisible = True, $HotKeywnd = Default)
- __winapi_enumwindowsinit()
- If $HotKeywnd = Default Then $HotKeywnd = _winapi_getdesktopwindow()
- __winapi_enumwindowschild($HotKeywnd, $fvisible)
- Return $__gawinlist_winapi
- EndFunc
- Func __winapi_enumwindowsadd($HotKeywnd, $sclass = "")
- If $sclass = "" Then $sclass = _winapi_getclassname($HotKeywnd)
- $__gawinlist_winapi[0][0] += 1
- Local $icount = $__gawinlist_winapi[0][0]
- If $icount >= $__gawinlist_winapi[0][1] Then
- ReDim $__gawinlist_winapi[$icount + 64][2]
- $__gawinlist_winapi[0][1] += 64
- EndIf
- $__gawinlist_winapi[$icount][0] = $HotKeywnd
- $__gawinlist_winapi[$icount][1] = $sclass
- EndFunc
- Func __winapi_enumwindowschild($HotKeywnd, $fvisible = True)
- $HotKeywnd = _winapi_getwindow($HotKeywnd, $__winapiconstant_gw_child)
- While $HotKeywnd <> 0
- If (NOT $fvisible) OR _winapi_iswindowvisible($HotKeywnd) Then
- __winapi_enumwindowschild($HotKeywnd, $fvisible)
- __winapi_enumwindowsadd($HotKeywnd)
- EndIf
- $HotKeywnd = _winapi_getwindow($HotKeywnd, $__winapiconstant_gw_hwndnext)
- WEnd
- EndFunc
- Func __winapi_enumwindowsinit()
- ReDim $__gawinlist_winapi[64][2]
- $__gawinlist_winapi[0][0] = 0
- $__gawinlist_winapi[0][1] = 64
- EndFunc
- Func _winapi_enumwindowspopup()
- __winapi_enumwindowsinit()
- Local $HotKeywnd = _winapi_getwindow(_winapi_getdesktopwindow(), $__winapiconstant_gw_child)
- Local $sclass
- While $HotKeywnd <> 0
- If _winapi_iswindowvisible($HotKeywnd) Then
- $sclass = _winapi_getclassname($HotKeywnd)
- If $sclass = "#32768" Then
- __winapi_enumwindowsadd($HotKeywnd)
- ElseIf $sclass = "ToolbarWindow32" Then
- __winapi_enumwindowsadd($HotKeywnd)
- ElseIf $sclass = "ToolTips_Class32" Then
- __winapi_enumwindowsadd($HotKeywnd)
- ElseIf $sclass = "BaseBar" Then
- __winapi_enumwindowschild($HotKeywnd)
- EndIf
- EndIf
- $HotKeywnd = _winapi_getwindow($HotKeywnd, $__winapiconstant_gw_hwndnext)
- WEnd
- Return $__gawinlist_winapi
- EndFunc
- Func _winapi_enumwindowstop()
- __winapi_enumwindowsinit()
- Local $HotKeywnd = _winapi_getwindow(_winapi_getdesktopwindow(), $__winapiconstant_gw_child)
- While $HotKeywnd <> 0
- If _winapi_iswindowvisible($HotKeywnd) Then __winapi_enumwindowsadd($HotKeywnd)
- $HotKeywnd = _winapi_getwindow($HotKeywnd, $__winapiconstant_gw_hwndnext)
- WEnd
- Return $__gawinlist_winapi
- EndFunc
- Func _winapi_expandenvironmentstrings($sstring)
- Local $aresult = DllCall("kernel32.dll", "dword", "ExpandEnvironmentStringsW", "wstr", $sstring, "wstr", "", "dword", 4096)
- If @error Then Return SetError(@error, @extended, "")
- Return $aresult[2]
- EndFunc
- Func _winapi_extracticonex($sfile, $iindex, $plarge, $psmall, $iicons)
- Local $aresult = DllCall("shell32.dll", "uint", "ExtractIconExW", "wstr", $sfile, "int", $iindex, "handle", $plarge, "handle", $psmall, "uint", $iicons)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_fatalappexit($smessage)
- DllCall("kernel32.dll", "none", "FatalAppExitW", "uint", 0, "wstr", $smessage)
- If @error Then Return SetError(@error, @extended)
- EndFunc
- Func _winapi_fillrect($HotKeydc, $ptrrect, $HotKeybrush)
- Local $aresult
- If IsPtr($HotKeybrush) Then
- $aresult = DllCall("user32.dll", "int", "FillRect", "handle", $HotKeydc, "ptr", $ptrrect, "handle", $HotKeybrush)
- Else
- $aresult = DllCall("user32.dll", "int", "FillRect", "handle", $HotKeydc, "ptr", $ptrrect, "dword", $HotKeybrush)
- EndIf
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_findexecutable($sfilename, $sdirectory = "")
- Local $aresult = DllCall("shell32.dll", "INT", "FindExecutableW", "wstr", $sfilename, "wstr", $sdirectory, "wstr", "")
- If @error Then Return SetError(@error, @extended, 0)
- Return SetExtended($aresult[0], $aresult[3])
- EndFunc
- Func _winapi_findwindow($sclassname, $swindowname)
- Local $aresult = DllCall("user32.dll", "hwnd", "FindWindowW", "wstr", $sclassname, "wstr", $swindowname)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_flashwindow($HotKeywnd, $finvert = True)
- Local $aresult = DllCall("user32.dll", "bool", "FlashWindow", "hwnd", $HotKeywnd, "bool", $finvert)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_flashwindowex($HotKeywnd, $iflags = 3, $icount = 3, $itimeout = 0)
- Local $TotalTimeflash = DllStructCreate($TotalTimeagflashwinfo)
- Local $pflash = DllStructGetPtr($TotalTimeflash)
- Local $iflash = DllStructGetSize($TotalTimeflash)
- Local $imode = 0
- If BitAND($iflags, 1) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_caption)
- If BitAND($iflags, 2) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_tray)
- If BitAND($iflags, 4) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_timer)
- If BitAND($iflags, 8) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_timernofg)
- DllStructSetData($TotalTimeflash, "Size", $iflash)
- DllStructSetData($TotalTimeflash, "hWnd", $HotKeywnd)
- DllStructSetData($TotalTimeflash, "Flags", $imode)
- DllStructSetData($TotalTimeflash, "Count", $icount)
- DllStructSetData($TotalTimeflash, "Timeout", $itimeout)
- Local $aresult = DllCall("user32.dll", "bool", "FlashWindowEx", "ptr", $pflash)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_floattoint($nfloat)
- Local $TotalTimefloat = DllStructCreate("float")
- Local $TotalTimeint = DllStructCreate("int", DllStructGetPtr($TotalTimefloat))
- DllStructSetData($TotalTimefloat, 1, $nfloat)
- Return DllStructGetData($TotalTimeint, 1)
- EndFunc
- Func _winapi_flushfilebuffers($HotKeyfile)
- Local $aresult = DllCall("kernel32.dll", "bool", "FlushFileBuffers", "handle", $HotKeyfile)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_formatmessage($iflags, $psource, $imessageid, $ilanguageid, ByRef $pbuffer, $isize, $varguments)
- Local $sbuffertype = "ptr"
- If IsString($pbuffer) Then $sbuffertype = "wstr"
- Local $aresult = DllCall("Kernel32.dll", "dword", "FormatMessageW", "dword", $iflags, "ptr", $psource, "dword", $imessageid, "dword", $ilanguageid, $sbuffertype, $pbuffer, "dword", $isize, "ptr", $varguments)
- If @error Then Return SetError(@error, @extended, 0)
- If $sbuffertype = "wstr" Then $pbuffer = $aresult[5]
- Return $aresult[0]
- EndFunc
- Func _winapi_framerect($HotKeydc, $ptrrect, $HotKeybrush)
- Local $aresult = DllCall("user32.dll", "int", "FrameRect", "handle", $HotKeydc, "ptr", $ptrrect, "handle", $HotKeybrush)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_freelibrary($HotKeymodule)
- Local $aresult = DllCall("kernel32.dll", "bool", "FreeLibrary", "handle", $HotKeymodule)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_getancestor($HotKeywnd, $iflags = 1)
- Local $aresult = DllCall("user32.dll", "hwnd", "GetAncestor", "hwnd", $HotKeywnd, "uint", $iflags)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getasynckeystate($ikey)
- Local $aresult = DllCall("user32.dll", "short", "GetAsyncKeyState", "int", $ikey)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getbkmode($HotKeydc)
- Local $aresult = DllCall("gdi32.dll", "int", "GetBkMode", "handle", $HotKeydc)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getclassname($HotKeywnd)
- If NOT IsHWnd($HotKeywnd) Then $HotKeywnd = GUICtrlGetHandle($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "int", "GetClassNameW", "hwnd", $HotKeywnd, "wstr", "", "int", 4096)
- If @error Then Return SetError(@error, @extended, False)
- Return SetExtended($aresult[0], $aresult[2])
- EndFunc
- Func _winapi_getclientheight($HotKeywnd)
- Local $TotalTimerect = _winapi_getclientrect($HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($TotalTimerect, "Bottom") - DllStructGetData($TotalTimerect, "Top")
- EndFunc
- Func _winapi_getclientwidth($HotKeywnd)
- Local $TotalTimerect = _winapi_getclientrect($HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($TotalTimerect, "Right") - DllStructGetData($TotalTimerect, "Left")
- EndFunc
- Func _winapi_getclientrect($HotKeywnd)
- Local $TotalTimerect = DllStructCreate($TotalTimeagrect)
- DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $HotKeywnd, "ptr", DllStructGetPtr($TotalTimerect))
- If @error Then Return SetError(@error, @extended, 0)
- Return $TotalTimerect
- EndFunc
- Func _winapi_getcurrentprocess()
- Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentProcess")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getcurrentprocessid()
- Local $aresult = DllCall("kernel32.dll", "dword", "GetCurrentProcessId")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getcurrentthread()
- Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentThread")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getcurrentthreadid()
- Local $aresult = DllCall("kernel32.dll", "dword", "GetCurrentThreadId")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getcursorinfo()
- Local $TotalTimecursor = DllStructCreate($TotalTimeagcursorinfo)
- Local $icursor = DllStructGetSize($TotalTimecursor)
- DllStructSetData($TotalTimecursor, "Size", $icursor)
- DllCall("user32.dll", "bool", "GetCursorInfo", "ptr", DllStructGetPtr($TotalTimecursor))
- If @error Then Return SetError(@error, @extended, 0)
- Local $acursor[5]
- $acursor[0] = True
- $acursor[1] = DllStructGetData($TotalTimecursor, "Flags") <> 0
- $acursor[2] = DllStructGetData($TotalTimecursor, "hCursor")
- $acursor[3] = DllStructGetData($TotalTimecursor, "X")
- $acursor[4] = DllStructGetData($TotalTimecursor, "Y")
- Return $acursor
- EndFunc
- Func _winapi_getdc($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "handle", "GetDC", "hwnd", $HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getdesktopwindow()
- Local $aresult = DllCall("user32.dll", "hwnd", "GetDesktopWindow")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getdevicecaps($HotKeydc, $iindex)
- Local $aresult = DllCall("gdi32.dll", "int", "GetDeviceCaps", "handle", $HotKeydc, "int", $iindex)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getdibits($HotKeydc, $HotKeybmp, $istartscan, $iscanlines, $pbits, $pbi, $iusage)
- Local $aresult = DllCall("gdi32.dll", "int", "GetDIBits", "handle", $HotKeydc, "handle", $HotKeybmp, "uint", $istartscan, "uint", $iscanlines, "ptr", $pbits, "ptr", $pbi, "uint", $iusage)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_getdlgctrlid($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getdlgitem($HotKeywnd, $iitemid)
- Local $aresult = DllCall("user32.dll", "hwnd", "GetDlgItem", "hwnd", $HotKeywnd, "int", $iitemid)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getfocus()
- Local $aresult = DllCall("user32.dll", "hwnd", "GetFocus")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getforegroundwindow()
- Local $aresult = DllCall("user32.dll", "hwnd", "GetForegroundWindow")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getguiresources($iflag = 0, $HotKeyprocess = -1)
- If $HotKeyprocess = -1 Then $HotKeyprocess = _winapi_getcurrentprocess()
- Local $aresult = DllCall("user32.dll", "dword", "GetGuiResources", "handle", $HotKeyprocess, "dword", $iflag)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_geticoninfo($HotKeyicon)
- Local $TotalTimeinfo = DllStructCreate($TotalTimeagiconinfo)
- DllCall("user32.dll", "bool", "GetIconInfo", "handle", $HotKeyicon, "ptr", DllStructGetPtr($TotalTimeinfo))
- If @error Then Return SetError(@error, @extended, 0)
- Local $aicon[6]
- $aicon[0] = True
- $aicon[1] = DllStructGetData($TotalTimeinfo, "Icon") <> 0
- $aicon[2] = DllStructGetData($TotalTimeinfo, "XHotSpot")
- $aicon[3] = DllStructGetData($TotalTimeinfo, "YHotSpot")
- $aicon[4] = DllStructGetData($TotalTimeinfo, "hMask")
- $aicon[5] = DllStructGetData($TotalTimeinfo, "hColor")
- Return $aicon
- EndFunc
- Func _winapi_getfilesizeex($HotKeyfile)
- Local $aresult = DllCall("kernel32.dll", "bool", "GetFileSizeEx", "handle", $HotKeyfile, "int64*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[2]
- EndFunc
- Func _winapi_getlasterrormessage()
- Local $TotalTimebufferptr = DllStructCreate("ptr")
- Local $pbufferptr = DllStructGetPtr($TotalTimebufferptr)
- Local $ncount = _winapi_formatmessage(BitOR($__winapiconstant_format_message_allocate_buffer, $__winapiconstant_format_message_from_system), 0, _winapi_getlasterror(), 0, $pbufferptr, 0, 0)
- If @error Then Return SetError(@error, 0, "")
- Local $stext = ""
- Local $pbuffer = DllStructGetData($TotalTimebufferptr, 1)
- If $pbuffer Then
- If $ncount > 0 Then
- Local $TotalTimebuffer = DllStructCreate("wchar[" & ($ncount + 1) & "]", $pbuffer)
- $stext = DllStructGetData($TotalTimebuffer, 1)
- EndIf
- _winapi_localfree($pbuffer)
- EndIf
- Return $stext
- EndFunc
- Func _winapi_getlayeredwindowattributes($HotKeywnd, ByRef $i_transcolor, ByRef $TotalTimeransparency, $ascolorref = False)
- $i_transcolor = -1
- $TotalTimeransparency = -1
- Local $aresult = DllCall("user32.dll", "bool", "GetLayeredWindowAttributes", "hwnd", $HotKeywnd, "dword*", $i_transcolor, "byte*", $TotalTimeransparency, "dword*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- If NOT $ascolorref Then
- $aresult[2] = Hex(String($aresult[2]), 6)
- $aresult[2] = "0x" & StringMid($aresult[2], 5, 2) & StringMid($aresult[2], 3, 2) & StringMid($aresult[2], 1, 2)
- EndIf
- $i_transcolor = $aresult[2]
- $TotalTimeransparency = $aresult[3]
- Return $aresult[4]
- EndFunc
- Func _winapi_getmodulehandle($smodulename)
- Local $smodulenametype = "wstr"
- If $smodulename = "" Then
- $smodulename = 0
- $smodulenametype = "ptr"
- EndIf
- Local $aresult = DllCall("kernel32.dll", "handle", "GetModuleHandleW", $smodulenametype, $smodulename)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getmousepos($ftoclient = False, $HotKeywnd = 0)
- Local $imode = Opt("MouseCoordMode", 1)
- Local $apos = MouseGetPos()
- Opt("MouseCoordMode", $imode)
- Local $TotalTimepoint = DllStructCreate($TotalTimeagpoint)
- DllStructSetData($TotalTimepoint, "X", $apos[0])
- DllStructSetData($TotalTimepoint, "Y", $apos[1])
- If $ftoclient Then
- _winapi_screentoclient($HotKeywnd, $TotalTimepoint)
- If @error Then Return SetError(@error, @extended, 0)
- EndIf
- Return $TotalTimepoint
- EndFunc
- Func _winapi_getmouseposx($ftoclient = False, $HotKeywnd = 0)
- Local $TotalTimepoint = _winapi_getmousepos($ftoclient, $HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($TotalTimepoint, "X")
- EndFunc
- Func _winapi_getmouseposy($ftoclient = False, $HotKeywnd = 0)
- Local $TotalTimepoint = _winapi_getmousepos($ftoclient, $HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($TotalTimepoint, "Y")
- EndFunc
- Func _winapi_getobject($HotKeyobject, $isize, $pobject)
- Local $aresult = DllCall("gdi32.dll", "int", "GetObject", "handle", $HotKeyobject, "int", $isize, "ptr", $pobject)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getopenfilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $HotKeywndowner = 0)
- Local $ipathlen = 4096
- Local $inulls = 0
- Local $TotalTimeofn = DllStructCreate($TotalTimeagopenfilename)
- Local $afiles[1] = [0]
- Local $iflag = $iflags
- Local $asflines = StringSplit($sfilter, "|")
- Local $asfilter[$asflines[0] * 2 + 1]
- Local $istart, $ifinal, $stfilter
- $asfilter[0] = $asflines[0] * 2
- For $i = 1 To $asflines[0]
- $istart = StringInStr($asflines[$i], "(", 0, 1)
- $ifinal = StringInStr($asflines[$i], ")", 0, -1)
- $asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $istart - 1), 3)
- $asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), 3)
- $stfilter &= "wchar[" & StringLen($asfilter[$i * 2 - 1]) + 1 & "];wchar[" & StringLen($asfilter[$i * 2]) + 1 & "];"
- Next
- Local $TotalTimetitle = DllStructCreate("wchar Title[" & StringLen($stitle) + 1 & "]")
- Local $TotalTimeinitialdir = DllStructCreate("wchar InitDir[" & StringLen($sinitaldir) + 1 & "]")
- Local $TotalTimefilter = DllStructCreate($stfilter & "wchar")
- Local $TotalTimepath = DllStructCreate("wchar Path[" & $ipathlen & "]")
- Local $TotalTimeextn = DllStructCreate("wchar Extension[" & StringLen($sdefaultext) + 1 & "]")
- For $i = 1 To $asfilter[0]
- DllStructSetData($TotalTimefilter, $i, $asfilter[$i])
- Next
- DllStructSetData($TotalTimetitle, "Title", $stitle)
- DllStructSetData($TotalTimeinitialdir, "InitDir", $sinitaldir)
- DllStructSetData($TotalTimepath, "Path", $sdefaultfile)
- DllStructSetData($TotalTimeextn, "Extension", $sdefaultext)
- DllStructSetData($TotalTimeofn, "StructSize", DllStructGetSize($TotalTimeofn))
- DllStructSetData($TotalTimeofn, "hwndOwner", $HotKeywndowner)
- DllStructSetData($TotalTimeofn, "lpstrFilter", DllStructGetPtr($TotalTimefilter))
- DllStructSetData($TotalTimeofn, "nFilterIndex", $ifilterindex)
- DllStructSetData($TotalTimeofn, "lpstrFile", DllStructGetPtr($TotalTimepath))
- DllStructSetData($TotalTimeofn, "nMaxFile", $ipathlen)
- DllStructSetData($TotalTimeofn, "lpstrInitialDir", DllStructGetPtr($TotalTimeinitialdir))
- DllStructSetData($TotalTimeofn, "lpstrTitle", DllStructGetPtr($TotalTimetitle))
- DllStructSetData($TotalTimeofn, "Flags", $iflag)
- DllStructSetData($TotalTimeofn, "lpstrDefExt", DllStructGetPtr($TotalTimeextn))
- DllStructSetData($TotalTimeofn, "FlagsEx", $iflagsex)
- DllCall("comdlg32.dll", "bool", "GetOpenFileNameW", "ptr", DllStructGetPtr($TotalTimeofn))
- If @error Then Return SetError(@error, @extended, $afiles)
- If BitAND($iflags, $ofn_allowmultiselect) = $ofn_allowmultiselect AND BitAND($iflags, $ofn_explorer) = $ofn_explorer Then
- For $x = 1 To $ipathlen
- If DllStructGetData($TotalTimepath, "Path", $x) = Chr(0) Then
- DllStructSetData($TotalTimepath, "Path", "|", $x)
- $inulls += 1
- Else
- $inulls = 0
- EndIf
- If $inulls = 2 Then ExitLoop
- Next
- DllStructSetData($TotalTimepath, "Path", Chr(0), $x - 1)
- $afiles = StringSplit(DllStructGetData($TotalTimepath, "Path"), "|")
- If $afiles[0] = 1 Then Return __winapi_parsefiledialogpath(DllStructGetData($TotalTimepath, "Path"))
- Return StringSplit(DllStructGetData($TotalTimepath, "Path"), "|")
- ElseIf BitAND($iflags, $ofn_allowmultiselect) = $ofn_allowmultiselect Then
- $afiles = StringSplit(DllStructGetData($TotalTimepath, "Path"), " ")
- If $afiles[0] = 1 Then Return __winapi_parsefiledialogpath(DllStructGetData($TotalTimepath, "Path"))
- Return StringSplit(StringReplace(DllStructGetData($TotalTimepath, "Path"), " ", "|"), "|")
- Else
- Return __winapi_parsefiledialogpath(DllStructGetData($TotalTimepath, "Path"))
- EndIf
- EndFunc
- Func _winapi_getoverlappedresult($HotKeyfile, $poverlapped, ByRef $ibytes, $fwait = False)
- Local $aresult = DllCall("kernel32.dll", "bool", "GetOverlappedResult", "handle", $HotKeyfile, "ptr", $poverlapped, "dword*", 0, "bool", $fwait)
- If @error Then Return SetError(@error, @extended, False)
- $ibytes = $aresult[3]
- Return $aresult[0]
- EndFunc
- Func _winapi_getparent($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "hwnd", "GetParent", "hwnd", $HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getprocessaffinitymask($HotKeyprocess)
- Local $aresult = DllCall("kernel32.dll", "bool", "GetProcessAffinityMask", "handle", $HotKeyprocess, "dword_ptr*", 0, "dword_ptr*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- Local $amask[3]
- $amask[0] = True
- $amask[1] = $aresult[2]
- $amask[2] = $aresult[3]
- Return $amask
- EndFunc
- Func _winapi_getsavefilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $HotKeywndowner = 0)
- Local $ipathlen = 4096
- Local $TotalTimeofn = DllStructCreate($TotalTimeagopenfilename)
- Local $afiles[1] = [0]
- Local $iflag = $iflags
- Local $asflines = StringSplit($sfilter, "|")
- Local $asfilter[$asflines[0] * 2 + 1]
- Local $istart, $ifinal, $stfilter
- $asfilter[0] = $asflines[0] * 2
- For $i = 1 To $asflines[0]
- $istart = StringInStr($asflines[$i], "(", 0, 1)
- $ifinal = StringInStr($asflines[$i], ")", 0, -1)
- $asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $istart - 1), 3)
- $asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), 3)
- $stfilter &= "wchar[" & StringLen($asfilter[$i * 2 - 1]) + 1 & "];wchar[" & StringLen($asfilter[$i * 2]) + 1 & "];"
- Next
- Local $TotalTimetitle = DllStructCreate("wchar Title[" & StringLen($stitle) + 1 & "]")
- Local $TotalTimeinitialdir = DllStructCreate("wchar InitDir[" & StringLen($sinitaldir) + 1 & "]")
- Local $TotalTimefilter = DllStructCreate($stfilter & "wchar")
- Local $TotalTimepath = DllStructCreate("wchar Path[" & $ipathlen & "]")
- Local $TotalTimeextn = DllStructCreate("wchar Extension[" & StringLen($sdefaultext) + 1 & "]")
- For $i = 1 To $asfilter[0]
- DllStructSetData($TotalTimefilter, $i, $asfilter[$i])
- Next
- DllStructSetData($TotalTimetitle, "Title", $stitle)
- DllStructSetData($TotalTimeinitialdir, "InitDir", $sinitaldir)
- DllStructSetData($TotalTimepath, "Path", $sdefaultfile)
- DllStructSetData($TotalTimeextn, "Extension", $sdefaultext)
- DllStructSetData($TotalTimeofn, "StructSize", DllStructGetSize($TotalTimeofn))
- DllStructSetData($TotalTimeofn, "hwndOwner", $HotKeywndowner)
- DllStructSetData($TotalTimeofn, "lpstrFilter", DllStructGetPtr($TotalTimefilter))
- DllStructSetData($TotalTimeofn, "nFilterIndex", $ifilterindex)
- DllStructSetData($TotalTimeofn, "lpstrFile", DllStructGetPtr($TotalTimepath))
- DllStructSetData($TotalTimeofn, "nMaxFile", $ipathlen)
- DllStructSetData($TotalTimeofn, "lpstrInitialDir", DllStructGetPtr($TotalTimeinitialdir))
- DllStructSetData($TotalTimeofn, "lpstrTitle", DllStructGetPtr($TotalTimetitle))
- DllStructSetData($TotalTimeofn, "Flags", $iflag)
- DllStructSetData($TotalTimeofn, "lpstrDefExt", DllStructGetPtr($TotalTimeextn))
- DllStructSetData($TotalTimeofn, "FlagsEx", $iflagsex)
- DllCall("comdlg32.dll", "bool", "GetSaveFileNameW", "ptr", DllStructGetPtr($TotalTimeofn))
- If @error Then Return SetError(@error, @extended, $afiles)
- Return __winapi_parsefiledialogpath(DllStructGetData($TotalTimepath, "Path"))
- EndFunc
- Func _winapi_getstockobject($iobject)
- Local $aresult = DllCall("gdi32.dll", "handle", "GetStockObject", "int", $iobject)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getstdhandle($istdhandle)
- If $istdhandle < 0 OR $istdhandle > 2 Then Return SetError(2, 0, -1)
- Local Const $ahandle[3] = [-10, -11, -12]
- Local $aresult = DllCall("kernel32.dll", "handle", "GetStdHandle", "dword", $ahandle[$istdhandle])
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_getsyscolor($iindex)
- Local $aresult = DllCall("user32.dll", "dword", "GetSysColor", "int", $iindex)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getsyscolorbrush($iindex)
- Local $aresult = DllCall("user32.dll", "handle", "GetSysColorBrush", "int", $iindex)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getsystemmetrics($iindex)
- Local $aresult = DllCall("user32.dll", "int", "GetSystemMetrics", "int", $iindex)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_gettextextentpoint32($HotKeydc, $stext)
- Local $TotalTimesize = DllStructCreate($TotalTimeagsize)
- Local $isize = StringLen($stext)
- DllCall("gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $HotKeydc, "wstr", $stext, "int", $isize, "ptr", DllStructGetPtr($TotalTimesize))
- If @error Then Return SetError(@error, @extended, 0)
- Return $TotalTimesize
- EndFunc
- Func _winapi_getwindow($HotKeywnd, $icmd)
- Local $aresult = DllCall("user32.dll", "hwnd", "GetWindow", "hwnd", $HotKeywnd, "uint", $icmd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getwindowdc($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "handle", "GetWindowDC", "hwnd", $HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getwindowheight($HotKeywnd)
- Local $TotalTimerect = _winapi_getwindowrect($HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($TotalTimerect, "Bottom") - DllStructGetData($TotalTimerect, "Top")
- EndFunc
- Func _winapi_getwindowlong($HotKeywnd, $iindex)
- Local $sfuncname = "GetWindowLongW"
- If @AutoItX64 Then $sfuncname = "GetWindowLongPtrW"
- Local $aresult = DllCall("user32.dll", "long_ptr", $sfuncname, "hwnd", $HotKeywnd, "int", $iindex)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getwindowplacement($HotKeywnd)
- Local $TotalTimewindowplacement = DllStructCreate($TotalTimeagwindowplacement)
- DllStructSetData($TotalTimewindowplacement, "length", DllStructGetSize($TotalTimewindowplacement))
- Local $pwindowplacement = DllStructGetPtr($TotalTimewindowplacement)
- DllCall("user32.dll", "bool", "GetWindowPlacement", "hwnd", $HotKeywnd, "ptr", $pwindowplacement)
- If @error Then Return SetError(@error, @extended, 0)
- Return $TotalTimewindowplacement
- EndFunc
- Func _winapi_getwindowrect($HotKeywnd)
- Local $TotalTimerect = DllStructCreate($TotalTimeagrect)
- DllCall("user32.dll", "bool", "GetWindowRect", "hwnd", $HotKeywnd, "ptr", DllStructGetPtr($TotalTimerect))
- If @error Then Return SetError(@error, @extended, 0)
- Return $TotalTimerect
- EndFunc
- Func _winapi_getwindowrgn($HotKeywnd, $HotKeyrgn)
- Local $aresult = DllCall("user32.dll", "int", "GetWindowRgn", "hwnd", $HotKeywnd, "handle", $HotKeyrgn)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getwindowtext($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "int", "GetWindowTextW", "hwnd", $HotKeywnd, "wstr", "", "int", 4096)
- If @error Then Return SetError(@error, @extended, "")
- Return SetExtended($aresult[0], $aresult[2])
- EndFunc
- Func _winapi_getwindowthreadprocessid($HotKeywnd, ByRef $ipid)
- Local $aresult = DllCall("user32.dll", "dword", "GetWindowThreadProcessId", "hwnd", $HotKeywnd, "dword*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- $ipid = $aresult[2]
- Return $aresult[0]
- EndFunc
- Func _winapi_getwindowwidth($HotKeywnd)
- Local $TotalTimerect = _winapi_getwindowrect($HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($TotalTimerect, "Right") - DllStructGetData($TotalTimerect, "Left")
- EndFunc
- Func _winapi_getxyfrompoint(ByRef $TotalTimepoint, ByRef $ix, ByRef $iy)
- $ix = DllStructGetData($TotalTimepoint, "X")
- $iy = DllStructGetData($TotalTimepoint, "Y")
- EndFunc
- Func _winapi_globalmemorystatus()
- Local $TotalTimemem = DllStructCreate($TotalTimeagmemorystatusex)
- Local $pmem = DllStructGetPtr($TotalTimemem)
- Local $imem = DllStructGetSize($TotalTimemem)
- DllStructSetData($TotalTimemem, 1, $imem)
- DllCall("kernel32.dll", "none", "GlobalMemoryStatusEx", "ptr", $pmem)
- If @error Then Return SetError(@error, @extended, 0)
- Local $amem[7]
- $amem[0] = DllStructGetData($TotalTimemem, 2)
- $amem[1] = DllStructGetData($TotalTimemem, 3)
- $amem[2] = DllStructGetData($TotalTimemem, 4)
- $amem[3] = DllStructGetData($TotalTimemem, 5)
- $amem[4] = DllStructGetData($TotalTimemem, 6)
- $amem[5] = DllStructGetData($TotalTimemem, 7)
- $amem[6] = DllStructGetData($TotalTimemem, 8)
- Return $amem
- EndFunc
- Func _winapi_guidfromstring($sguid)
- Local $TotalTimeguid = DllStructCreate($TotalTimeagguid)
- _winapi_guidfromstringex($sguid, DllStructGetPtr($TotalTimeguid))
- If @error Then Return SetError(@error, @extended, 0)
- Return $TotalTimeguid
- EndFunc
- Func _winapi_guidfromstringex($sguid, $pguid)
- Local $aresult = DllCall("ole32.dll", "long", "CLSIDFromString", "wstr", $sguid, "ptr", $pguid)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_hiword($ilong)
- Return BitShift($ilong, 16)
- EndFunc
- Func _winapi_inprocess($HotKeywnd, ByRef $HotKeylastwnd)
- If $HotKeywnd = $HotKeylastwnd Then Return True
- For $ii = $__gainprocess_winapi[0][0] To 1 Step -1
- If $HotKeywnd = $__gainprocess_winapi[$ii][0] Then
- If $__gainprocess_winapi[$ii][1] Then
- $HotKeylastwnd = $HotKeywnd
- Return True
- Else
- Return False
- EndIf
- EndIf
- Next
- Local $iprocessid
- _winapi_getwindowthreadprocessid($HotKeywnd, $iprocessid)
- Local $icount = $__gainprocess_winapi[0][0] + 1
- If $icount >= 64 Then $icount = 1
- $__gainprocess_winapi[0][0] = $icount
- $__gainprocess_winapi[$icount][0] = $HotKeywnd
- $__gainprocess_winapi[$icount][1] = ($iprocessid = @AutoItPID)
- Return $__gainprocess_winapi[$icount][1]
- EndFunc
- Func _winapi_inttofloat($iint)
- Local $TotalTimeint = DllStructCreate("int")
- Local $TotalTimefloat = DllStructCreate("float", DllStructGetPtr($TotalTimeint))
- DllStructSetData($TotalTimeint, 1, $iint)
- Return DllStructGetData($TotalTimefloat, 1)
- EndFunc
- Func _winapi_isclassname($HotKeywnd, $sclassname)
- Local $sseparator = Opt("GUIDataSeparatorChar")
- Local $aclassname = StringSplit($sclassname, $sseparator)
- If NOT IsHWnd($HotKeywnd) Then $HotKeywnd = GUICtrlGetHandle($HotKeywnd)
- Local $sclasscheck = _winapi_getclassname($HotKeywnd)
- For $x = 1 To UBound($aclassname) - 1
- If StringUpper(StringMid($sclasscheck, 1, StringLen($aclassname[$x]))) = StringUpper($aclassname[$x]) Then Return True
- Next
- Return False
- EndFunc
- Func _winapi_iswindow($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "bool", "IsWindow", "hwnd", $HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_iswindowvisible($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "bool", "IsWindowVisible", "hwnd", $HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_invalidaterect($HotKeywnd, $TotalTimerect = 0, $ferase = True)
- Local $prect = 0
- If IsDllStruct($TotalTimerect) Then $prect = DllStructGetPtr($TotalTimerect)
- Local $aresult = DllCall("user32.dll", "bool", "InvalidateRect", "hwnd", $HotKeywnd, "ptr", $prect, "bool", $ferase)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_lineto($HotKeydc, $ix, $iy)
- Local $aresult = DllCall("gdi32.dll", "bool", "LineTo", "handle", $HotKeydc, "int", $ix, "int", $iy)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadbitmap($HotKeyinstance, $sbitmap)
- Local $sbitmaptype = "int"
- If IsString($sbitmap) Then $sbitmaptype = "wstr"
- Local $aresult = DllCall("user32.dll", "handle", "LoadBitmapW", "handle", $HotKeyinstance, $sbitmaptype, $sbitmap)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadimage($HotKeyinstance, $simage, $itype, $ixdesired, $iydesired, $iload)
- Local $aresult, $simagetype = "int"
- If IsString($simage) Then $simagetype = "wstr"
- $aresult = DllCall("user32.dll", "handle", "LoadImageW", "handle", $HotKeyinstance, $simagetype, $simage, "uint", $itype, "int", $ixdesired, "int", $iydesired, "uint", $iload)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadlibrary($sfilename)
- Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryW", "wstr", $sfilename)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadlibraryex($sfilename, $iflags = 0)
- Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryExW", "wstr", $sfilename, "ptr", 0, "dword", $iflags)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadshell32icon($iiconid)
- Local $TotalTimeicons = DllStructCreate("ptr Data")
- Local $picons = DllStructGetPtr($TotalTimeicons)
- Local $iicons = _winapi_extracticonex("shell32.dll", $iiconid, 0, $picons, 1)
- If @error Then Return SetError(@error, @extended, 0)
- If $iicons <= 0 Then Return SetError(1, 0, 0)
- Return DllStructGetData($TotalTimeicons, "Data")
- EndFunc
- Func _winapi_loadstring($HotKeyinstance, $istringid)
- Local $aresult = DllCall("user32.dll", "int", "LoadStringW", "handle", $HotKeyinstance, "uint", $istringid, "wstr", "", "int", 4096)
- If @error Then Return SetError(@error, @extended, "")
- Return SetExtended($aresult[0], $aresult[3])
- EndFunc
- Func _winapi_localfree($HotKeymem)
- Local $aresult = DllCall("kernel32.dll", "handle", "LocalFree", "handle", $HotKeymem)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_loword($ilong)
- Return BitAND($ilong, 65535)
- EndFunc
- Func _winapi_makelangid($lgidprimary, $lgidsub)
- Return BitOR(BitShift($lgidsub, -10), $lgidprimary)
- EndFunc
- Func _winapi_makelcid($lgid, $srtid)
- Return BitOR(BitShift($srtid, -16), $lgid)
- EndFunc
- Func _winapi_makelong($ilo, $ihi)
- Return BitOR(BitShift($ihi, -16), BitAND($ilo, 65535))
- EndFunc
- Func _winapi_makeqword($lodword, $HotKeyidword)
- Local $TotalTimeint64 = DllStructCreate("uint64")
- Local $TotalTimedwords = DllStructCreate("dword;dword", DllStructGetPtr($TotalTimeint64))
- DllStructSetData($TotalTimedwords, 1, $lodword)
- DllStructSetData($TotalTimedwords, 2, $HotKeyidword)
- Return DllStructGetData($TotalTimeint64, 1)
- EndFunc
- Func _winapi_messagebeep($itype = 1)
- Local $isound
- Switch $itype
- Case 1
- $isound = 0
- Case 2
- $isound = 16
- Case 3
- $isound = 32
- Case 4
- $isound = 48
- Case 5
- $isound = 64
- Case Else
- $isound = -1
- EndSwitch
- Local $aresult = DllCall("user32.dll", "bool", "MessageBeep", "uint", $isound)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_msgbox($iflags, $stitle, $stext)
- BlockInput(0)
- MsgBox($iflags, $stitle, $stext & " ")
- EndFunc
- Func _winapi_mouse_event($iflags, $ix = 0, $iy = 0, $idata = 0, $iextrainfo = 0)
- DllCall("user32.dll", "none", "mouse_event", "dword", $iflags, "dword", $ix, "dword", $iy, "dword", $idata, "ulong_ptr", $iextrainfo)
- If @error Then Return SetError(@error, @extended)
- EndFunc
- Func _winapi_moveto($HotKeydc, $ix, $iy)
- Local $aresult = DllCall("gdi32.dll", "bool", "MoveToEx", "handle", $HotKeydc, "int", $ix, "int", $iy, "ptr", 0)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_movewindow($HotKeywnd, $ix, $iy, $iwidth, $iheight, $frepaint = True)
- Local $aresult = DllCall("user32.dll", "bool", "MoveWindow", "hwnd", $HotKeywnd, "int", $ix, "int", $iy, "int", $iwidth, "int", $iheight, "bool", $frepaint)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_muldiv($inumber, $inumerator, $idenominator)
- Local $aresult = DllCall("kernel32.dll", "int", "MulDiv", "int", $inumber, "int", $inumerator, "int", $idenominator)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_multibytetowidechar($stext, $icodepage = 0, $iflags = 0, $bretstring = False)
- Local $stexttype = "ptr", $ptext = $stext
- If IsDllStruct($stext) Then
- $ptext = DllStructGetPtr($stext)
- Else
- If NOT IsPtr($stext) Then $stexttype = "STR"
- EndIf
- Local $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $ptext, "int", -1, "ptr", 0, "int", 0)
- If @error Then Return SetError(@error, @extended, 0)
- Local $iout = $aresult[0]
- Local $TotalTimeout = DllStructCreate("wchar[" & $iout & "]")
- Local $pout = DllStructGetPtr($TotalTimeout)
- $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $ptext, "int", -1, "ptr", $pout, "int", $iout)
- If @error Then Return SetError(@error, @extended, 0)
- If $bretstring Then Return DllStructGetData($TotalTimeout, 1)
- Return $TotalTimeout
- EndFunc
- Func _winapi_multibytetowidecharex($stext, $ptext, $icodepage = 0, $iflags = 0)
- Local $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, "STR", $stext, "int", -1, "ptr", $ptext, "int", (StringLen($stext) + 1) * 2)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_openprocess($iaccess, $finherit, $iprocessid, $fdebugpriv = False)
- Local $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $finherit, "dword", $iprocessid)
- If @error Then Return SetError(@error, @extended, 0)
- If $aresult[0] Then Return $aresult[0]
- If NOT $fdebugpriv Then Return 0
- Local $HotKeytoken = _security__openthreadtokenex(BitOR($TotalTimeoken_adjust_privileges, $TotalTimeoken_query))
- If @error Then Return SetError(@error, @extended, 0)
- _security__setprivilege($HotKeytoken, "SeDebugPrivilege", True)
- Local $ierror = @error
- Local $ilasterror = @extended
- Local $iret = 0
- If NOT @error Then
- $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $finherit, "dword", $iprocessid)
- $ierror = @error
- $ilasterror = @extended
- If $aresult[0] Then $iret = $aresult[0]
- _security__setprivilege($HotKeytoken, "SeDebugPrivilege", False)
- If @error Then
- $ierror = @error
- $ilasterror = @extended
- EndIf
- EndIf
- _winapi_closehandle($HotKeytoken)
- Return SetError($ierror, $ilasterror, $iret)
- EndFunc
- Func __winapi_parsefiledialogpath($spath)
- Local $afiles[3]
- $afiles[0] = 2
- Local $stemp = StringMid($spath, 1, StringInStr($spath, "\", 0, -1) - 1)
- $afiles[1] = $stemp
- $afiles[2] = StringMid($spath, StringInStr($spath, "\", 0, -1) + 1)
- Return $afiles
- EndFunc
- Func _winapi_pathfindonpath(Const $szfile, $aextrapaths = "", Const $szpathdelimiter = @LF)
- Local $iextracount = 0
- If IsString($aextrapaths) Then
- If StringLen($aextrapaths) Then
- $aextrapaths = StringSplit($aextrapaths, $szpathdelimiter, 1 + 2)
- $iextracount = UBound($aextrapaths, 1)
- EndIf
- ElseIf IsArray($aextrapaths) Then
- $iextracount = UBound($aextrapaths)
- EndIf
- Local $TotalTimepaths, $TotalTimepathptrs
- If $iextracount Then
- Local $szstruct = ""
- For $path In $aextrapaths
- $szstruct &= "wchar[" & StringLen($path) + 1 & "];"
- Next
- $TotalTimepaths = DllStructCreate($szstruct)
- $TotalTimepathptrs = DllStructCreate("ptr[" & $iextracount + 1 & "]")
- For $i = 1 To $iextracount
- DllStructSetData($TotalTimepaths, $i, $aextrapaths[$i - 1])
- DllStructSetData($TotalTimepathptrs, 1, DllStructGetPtr($TotalTimepaths, $i), $i)
- Next
- DllStructSetData($TotalTimepathptrs, 1, Ptr(0), $iextracount + 1)
- EndIf
- Local $aresult = DllCall("shlwapi.dll", "bool", "PathFindOnPathW", "wstr", $szfile, "ptr", DllStructGetPtr($TotalTimepathptrs))
- If @error Then Return SetError(@error, @extended, False)
- If $aresult[0] = 0 Then Return SetError(1, 0, $szfile)
- Return $aresult[1]
- EndFunc
- Func _winapi_pointfromrect(ByRef $TotalTimerect, $fcenter = True)
- Local $ix1 = DllStructGetData($TotalTimerect, "Left")
- Local $iy1 = DllStructGetData($TotalTimerect, "Top")
- Local $ix2 = DllStructGetData($TotalTimerect, "Right")
- Local $iy2 = DllStructGetData($TotalTimerect, "Bottom")
- If $fcenter Then
- $ix1 = $ix1 + (($ix2 - $ix1) / 2)
- $iy1 = $iy1 + (($iy2 - $iy1) / 2)
- EndIf
- Local $TotalTimepoint = DllStructCreate($TotalTimeagpoint)
- DllStructSetData($TotalTimepoint, "X", $ix1)
- DllStructSetData($TotalTimepoint, "Y", $iy1)
- Return $TotalTimepoint
- EndFunc
- Func _winapi_postmessage($HotKeywnd, $imsg, $iwparam, $ilparam)
- Local $aresult = DllCall("user32.dll", "bool", "PostMessage", "hwnd", $HotKeywnd, "uint", $imsg, "wparam", $iwparam, "lparam", $ilparam)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_primarylangid($lgid)
- Return BitAND($lgid, 1023)
- EndFunc
- Func _winapi_ptinrect(ByRef $TotalTimerect, ByRef $TotalTimepoint)
- Local $ix = DllStructGetData($TotalTimepoint, "X")
- Local $iy = DllStructGetData($TotalTimepoint, "Y")
- Local $aresult = DllCall("user32.dll", "bool", "PtInRect", "ptr", DllStructGetPtr($TotalTimerect), "long", $ix, "long", $iy)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_readfile($HotKeyfile, $pbuffer, $itoread, ByRef $iread, $poverlapped = 0)
- Local $aresult = DllCall("kernel32.dll", "bool", "ReadFile", "handle", $HotKeyfile, "ptr", $pbuffer, "dword", $itoread, "dword*", 0, "ptr", $poverlapped)
- If @error Then Return SetError(@error, @extended, False)
- $iread = $aresult[4]
- Return $aresult[0]
- EndFunc
- Func _winapi_readprocessmemory($HotKeyprocess, $pbaseaddress, $pbuffer, $isize, ByRef $iread)
- Local $aresult = DllCall("kernel32.dll", "bool", "ReadProcessMemory", "handle", $HotKeyprocess, "ptr", $pbaseaddress, "ptr", $pbuffer, "ulong_ptr", $isize, "ulong_ptr*", 0)
- If @error Then Return SetError(@error, @extended, False)
- $iread = $aresult[5]
- Return $aresult[0]
- EndFunc
- Func _winapi_rectisempty(ByRef $TotalTimerect)
- Return (DllStructGetData($TotalTimerect, "Left") = 0) AND (DllStructGetData($TotalTimerect, "Top") = 0) AND (DllStructGetData($TotalTimerect, "Right") = 0) AND (DllStructGetData($TotalTimerect, "Bottom") = 0)
- EndFunc
- Func _winapi_redrawwindow($HotKeywnd, $TotalTimerect = 0, $HotKeyregion = 0, $iflags = 5)
- Local $prect = 0
- If $TotalTimerect <> 0 Then $prect = DllStructGetPtr($TotalTimerect)
- Local $aresult = DllCall("user32.dll", "bool", "RedrawWindow", "hwnd", $HotKeywnd, "ptr", $prect, "handle", $HotKeyregion, "uint", $iflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_registerwindowmessage($smessage)
- Local $aresult = DllCall("user32.dll", "uint", "RegisterWindowMessageW", "wstr", $smessage)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_releasecapture()
- Local $aresult = DllCall("user32.dll", "bool", "ReleaseCapture")
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_releasedc($HotKeywnd, $HotKeydc)
- Local $aresult = DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $HotKeywnd, "handle", $HotKeydc)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_screentoclient($HotKeywnd, ByRef $TotalTimepoint)
- Local $aresult = DllCall("user32.dll", "bool", "ScreenToClient", "hwnd", $HotKeywnd, "ptr", DllStructGetPtr($TotalTimepoint))
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_selectobject($HotKeydc, $HotKeygdiobj)
- Local $aresult = DllCall("gdi32.dll", "handle", "SelectObject", "handle", $HotKeydc, "handle", $HotKeygdiobj)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setbkcolor($HotKeydc, $icolor)
- Local $aresult = DllCall("gdi32.dll", "INT", "SetBkColor", "handle", $HotKeydc, "dword", $icolor)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_setbkmode($HotKeydc, $ibkmode)
- Local $aresult = DllCall("gdi32.dll", "int", "SetBkMode", "handle", $HotKeydc, "int", $ibkmode)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setcapture($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "hwnd", "SetCapture", "hwnd", $HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setcursor($HotKeycursor)
- Local $aresult = DllCall("user32.dll", "handle", "SetCursor", "handle", $HotKeycursor)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setdefaultprinter($sprinter)
- Local $aresult = DllCall("winspool.drv", "bool", "SetDefaultPrinterW", "wstr", $sprinter)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setdibits($HotKeydc, $HotKeybmp, $istartscan, $iscanlines, $pbits, $pbmi, $icoloruse = 0)
- Local $aresult = DllCall("gdi32.dll", "int", "SetDIBits", "handle", $HotKeydc, "handle", $HotKeybmp, "uint", $istartscan, "uint", $iscanlines, "ptr", $pbits, "ptr", $pbmi, "uint", $icoloruse)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setendoffile($HotKeyfile)
- Local $aresult = DllCall("kernel32.dll", "bool", "SetEndOfFile", "handle", $HotKeyfile)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setevent($HotKeyevent)
- Local $aresult = DllCall("kernel32.dll", "bool", "SetEvent", "handle", $HotKeyevent)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setfilepointer($HotKeyfile, $ipos, $imethod = 0)
- Local $aresult = DllCall("kernel32.dll", "INT", "SetFilePointer", "handle", $HotKeyfile, "long", $ipos, "ptr", 0, "long", $imethod)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_setfocus($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "hwnd", "SetFocus", "hwnd", $HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setfont($HotKeywnd, $HotKeyfont, $fredraw = True)
- _sendmessage($HotKeywnd, $__winapiconstant_wm_setfont, $HotKeyfont, $fredraw, 0, "hwnd")
- EndFunc
- Func _winapi_sethandleinformation($HotKeyobject, $imask, $iflags)
- Local $aresult = DllCall("kernel32.dll", "bool", "SetHandleInformation", "handle", $HotKeyobject, "dword", $imask, "dword", $iflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setlayeredwindowattributes($HotKeywnd, $i_transcolor, $TotalTimeransparency = 255, $dwflags = 3, $iscolorref = False)
- If $dwflags = Default OR $dwflags = "" OR $dwflags < 0 Then $dwflags = 3
- If NOT $iscolorref Then
- $i_transcolor = Hex(String($i_transcolor), 6)
- $i_transcolor = Execute("0x00" & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
- EndIf
- Local $aresult = DllCall("user32.dll", "bool", "SetLayeredWindowAttributes", "hwnd", $HotKeywnd, "dword", $i_transcolor, "byte", $TotalTimeransparency, "dword", $dwflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setparent($HotKeywndchild, $HotKeywndparent)
- Local $aresult = DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $HotKeywndchild, "hwnd", $HotKeywndparent)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setprocessaffinitymask($HotKeyprocess, $imask)
- Local $aresult = DllCall("kernel32.dll", "bool", "SetProcessAffinityMask", "handle", $HotKeyprocess, "ulong_ptr", $imask)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setsyscolors($velements, $vcolors)
- Local $isearray = IsArray($velements), $iscarray = IsArray($vcolors)
- Local $ielementnum
- If NOT $iscarray AND NOT $isearray Then
- $ielementnum = 1
- ElseIf $iscarray OR $isearray Then
- If NOT $iscarray OR NOT $isearray Then Return SetError(-1, -1, False)
- If UBound($velements) <> UBound($vcolors) Then Return SetError(-1, -1, False)
- $ielementnum = UBound($velements)
- EndIf
- Local $TotalTimeelements = DllStructCreate("int Element[" & $ielementnum & "]")
- Local $TotalTimecolors = DllStructCreate("dword NewColor[" & $ielementnum & "]")
- Local $pelements = DllStructGetPtr($TotalTimeelements)
- Local $pcolors = DllStructGetPtr($TotalTimecolors)
- If NOT $isearray Then
- DllStructSetData($TotalTimeelements, "Element", $velements, 1)
- Else
- For $x = 0 To $ielementnum - 1
- DllStructSetData($TotalTimeelements, "Element", $velements[$x], $x + 1)
- Next
- EndIf
- If NOT $iscarray Then
- DllStructSetData($TotalTimecolors, "NewColor", $vcolors, 1)
- Else
- For $x = 0 To $ielementnum - 1
- DllStructSetData($TotalTimecolors, "NewColor", $vcolors[$x], $x + 1)
- Next
- EndIf
- Local $aresult = DllCall("user32.dll", "bool", "SetSysColors", "int", $ielementnum, "ptr", $pelements, "ptr", $pcolors)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_settextcolor($HotKeydc, $icolor)
- Local $aresult = DllCall("gdi32.dll", "INT", "SetTextColor", "handle", $HotKeydc, "dword", $icolor)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowlong($HotKeywnd, $iindex, $ivalue)
- _winapi_setlasterror(0)
- Local $sfuncname = "SetWindowLongW"
- If @AutoItX64 Then $sfuncname = "SetWindowLongPtrW"
- Local $aresult = DllCall("user32.dll", "long_ptr", $sfuncname, "hwnd", $HotKeywnd, "int", $iindex, "long_ptr", $ivalue)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowplacement($HotKeywnd, $pwindowplacement)
- Local $aresult = DllCall("user32.dll", "bool", "SetWindowPlacement", "hwnd", $HotKeywnd, "ptr", $pwindowplacement)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowpos($HotKeywnd, $HotKeyafter, $ix, $iy, $icx, $icy, $iflags)
- Local $aresult = DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $HotKeywnd, "hwnd", $HotKeyafter, "int", $ix, "int", $iy, "int", $icx, "int", $icy, "uint", $iflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowrgn($HotKeywnd, $HotKeyrgn, $bredraw = True)
- Local $aresult = DllCall("user32.dll", "int", "SetWindowRgn", "hwnd", $HotKeywnd, "handle", $HotKeyrgn, "bool", $bredraw)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowshookex($idhook, $lpfn, $HotKeymod, $dwthreadid = 0)
- Local $aresult = DllCall("user32.dll", "handle", "SetWindowsHookEx", "int", $idhook, "ptr", $lpfn, "handle", $HotKeymod, "dword", $dwthreadid)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowtext($HotKeywnd, $stext)
- Local $aresult = DllCall("user32.dll", "bool", "SetWindowTextW", "hwnd", $HotKeywnd, "wstr", $stext)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_showcursor($fshow)
- Local $aresult = DllCall("user32.dll", "int", "ShowCursor", "bool", $fshow)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_showerror($stext, $fexit = True)
- _winapi_msgbox(266256, "Error", $stext)
- If $fexit Then Exit
- EndFunc
- Func _winapi_showmsg($stext)
- _winapi_msgbox(64 + 4096, "Information", $stext)
- EndFunc
- Func _winapi_showwindow($HotKeywnd, $icmdshow = 5)
- Local $aresult = DllCall("user32.dll", "bool", "ShowWindow", "hwnd", $HotKeywnd, "int", $icmdshow)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_stringfromguid($pguid)
- Local $aresult = DllCall("ole32.dll", "int", "StringFromGUID2", "ptr", $pguid, "wstr", "", "int", 40)
- If @error Then Return SetError(@error, @extended, "")
- Return SetExtended($aresult[0], $aresult[2])
- EndFunc
- Func _winapi_sublangid($lgid)
- Return BitShift($lgid, 10)
- EndFunc
- Func _winapi_systemparametersinfo($iaction, $iparam = 0, $vparam = 0, $iwinini = 0)
- Local $aresult = DllCall("user32.dll", "bool", "SystemParametersInfoW", "uint", $iaction, "uint", $iparam, "ptr", $vparam, "uint", $iwinini)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_twipsperpixelExitNow()
- Local $lngdc, $TotalTimewipsperpixelx
- $lngdc = _winapi_getdc(0)
- $TotalTimewipsperpixelx = 1440 / _winapi_getdevicecaps($lngdc, $__winapiconstant_logpixelsx)
- _winapi_releasedc(0, $lngdc)
- Return $TotalTimewipsperpixelx
- EndFunc
- Func _winapi_twipsperpixely()
- Local $lngdc, $TotalTimewipsperpixely
- $lngdc = _winapi_getdc(0)
- $TotalTimewipsperpixely = 1440 / _winapi_getdevicecaps($lngdc, $__winapiconstant_logpixelsy)
- _winapi_releasedc(0, $lngdc)
- Return $TotalTimewipsperpixely
- EndFunc
- Func _winapi_unhookwindowshookex($HotKeyhk)
- Local $aresult = DllCall("user32.dll", "bool", "UnhookWindowsHookEx", "handle", $HotKeyhk)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_updatelayeredwindow($HotKeywnd, $HotKeydcdest, $pptdest, $psize, $HotKeydcsrce, $pptsrce, $irgb, $pblend, $iflags)
- 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)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_updatewindow($HotKeywnd)
- Local $aresult = DllCall("user32.dll", "bool", "UpdateWindow", "hwnd", $HotKeywnd)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_waitforinputidle($HotKeyprocess, $itimeout = -1)
- Local $aresult = DllCall("user32.dll", "dword", "WaitForInputIdle", "handle", $HotKeyprocess, "dword", $itimeout)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_waitformultipleobjects($icount, $phandles, $fwaitall = False, $itimeout = -1)
- Local $aresult = DllCall("kernel32.dll", "INT", "WaitForMultipleObjects", "dword", $icount, "ptr", $phandles, "bool", $fwaitall, "dword", $itimeout)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_waitforsingleobject($HotKeyhandle, $itimeout = -1)
- Local $aresult = DllCall("kernel32.dll", "INT", "WaitForSingleObject", "handle", $HotKeyhandle, "dword", $itimeout)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_widechartomultibyte($punicode, $icodepage = 0, $bretstring = True)
- Local $sunicodetype = "ptr"
- If IsDllStruct($punicode) Then
- $punicode = DllStructGetPtr($punicode)
- Else
- If NOT IsPtr($punicode) Then $sunicodetype = "wstr"
- EndIf
- Local $aresult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "uint", $icodepage, "dword", 0, $sunicodetype, $punicode, "int", -1, "ptr", 0, "int", 0, "ptr", 0, "ptr", 0)
- If @error Then Return SetError(@error, @extended, "")
- Local $TotalTimemultibyte = DllStructCreate("char[" & $aresult[0] & "]")
- Local $pmultibyte = DllStructGetPtr($TotalTimemultibyte)
- $aresult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "uint", $icodepage, "dword", 0, $sunicodetype, $punicode, "int", -1, "ptr", $pmultibyte, "int", $aresult[0], "ptr", 0, "ptr", 0)
- If @error Then Return SetError(@error, @extended, "")
- If $bretstring Then Return DllStructGetData($TotalTimemultibyte, 1)
- Return $TotalTimemultibyte
- EndFunc
- Func _winapi_windowfrompoint(ByRef $TotalTimepoint)
- Local $TotalTimepointcast = DllStructCreate("int64", DllStructGetPtr($TotalTimepoint))
- Local $aresult = DllCall("user32.dll", "hwnd", "WindowFromPoint", "int64", DllStructGetData($TotalTimepointcast, 1))
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_writeconsole($HotKeyconsole, $stext)
- Local $aresult = DllCall("kernel32.dll", "bool", "WriteConsoleW", "handle", $HotKeyconsole, "wstr", $stext, "dword", StringLen($stext), "dword*", 0, "ptr", 0)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_writefile($HotKeyfile, $pbuffer, $itowrite, ByRef $iwritten, $poverlapped = 0)
- Local $aresult = DllCall("kernel32.dll", "bool", "WriteFile", "handle", $HotKeyfile, "ptr", $pbuffer, "dword", $itowrite, "dword*", 0, "ptr", $poverlapped)
- If @error Then Return SetError(@error, @extended, False)
- $iwritten = $aresult[4]
- Return $aresult[0]
- EndFunc
- Func _winapi_writeprocessmemory($HotKeyprocess, $pbaseaddress, $pbuffer, $isize, ByRef $iwritten, $sbuffer = "ptr")
- Local $aresult = DllCall("kernel32.dll", "bool", "WriteProcessMemory", "handle", $HotKeyprocess, "ptr", $pbaseaddress, $sbuffer, $pbuffer, "ulong_ptr", $isize, "ulong_ptr*", 0)
- If @error Then Return SetError(@error, @extended, False)
- $iwritten = $aresult[5]
- Return $aresult[0]
- EndFunc
- Global Const $_udf_globalids_offset = 2
- Global Const $_udf_globalid_max_win = 16
- Global Const $_udf_startid = 10000
- Global Const $_udf_globalid_max_ids = 55535
- Global Const $__udfguiconstant_ws_visible = 268435456
- Global Const $__udfguiconstant_ws_child = 1073741824
- Global $_udf_globalids_used[$_udf_globalid_max_win][$_udf_globalid_max_ids + $_udf_globalids_offset + 1]
- Func __udf_getnextglobalid($HotKeywnd)
- Local $nctrlid, $iusedindex = -1, $fallused = True
- If NOT WinExists($HotKeywnd) Then Return SetError(-1, -1, 0)
- For $iindex = 0 To $_udf_globalid_max_win - 1
- If $_udf_globalids_used[$iindex][0] <> 0 Then
- If NOT WinExists($_udf_globalids_used[$iindex][0]) Then
- For $x = 0 To UBound($_udf_globalids_used, 2) - 1
- $_udf_globalids_used[$iindex][$x] = 0
- Next
- $_udf_globalids_used[$iindex][1] = $_udf_startid
- $fallused = False
- EndIf
- EndIf
- Next
- For $iindex = 0 To $_udf_globalid_max_win - 1
- If $_udf_globalids_used[$iindex][0] = $HotKeywnd Then
- $iusedindex = $iindex
- ExitLoop
- EndIf
- Next
- If $iusedindex = -1 Then
- For $iindex = 0 To $_udf_globalid_max_win - 1
- If $_udf_globalids_used[$iindex][0] = 0 Then
- $_udf_globalids_used[$iindex][0] = $HotKeywnd
- $_udf_globalids_used[$iindex][1] = $_udf_startid
- $fallused = False
- $iusedindex = $iindex
- ExitLoop
- EndIf
- Next
- EndIf
- If $iusedindex = -1 AND $fallused Then Return SetError(16, 0, 0)
- If $_udf_globalids_used[$iusedindex][1] = $_udf_startid + $_udf_globalid_max_ids Then
- For $iidindex = $_udf_globalids_offset To UBound($_udf_globalids_used, 2) - 1
- If $_udf_globalids_used[$iusedindex][$iidindex] = 0 Then
- $nctrlid = ($iidindex - $_udf_globalids_offset) + 10000
- $_udf_globalids_used[$iusedindex][$iidindex] = $nctrlid
- Return $nctrlid
- EndIf
- Next
- Return SetError(-1, $_udf_globalid_max_ids, 0)
- EndIf
- $nctrlid = $_udf_globalids_used[$iusedindex][1]
- $_udf_globalids_used[$iusedindex][1] += 1
- $_udf_globalids_used[$iusedindex][($nctrlid - 10000) + $_udf_globalids_offset] = $nctrlid
- Return $nctrlid
- EndFunc
- Func __udf_freeglobalid($HotKeywnd, $iglobalid)
- If $iglobalid - $_udf_startid < 0 OR $iglobalid - $_udf_startid > $_udf_globalid_max_ids Then Return SetError(-1, 0, False)
- For $iindex = 0 To $_udf_globalid_max_win - 1
- If $_udf_globalids_used[$iindex][0] = $HotKeywnd Then
- For $x = $_udf_globalids_offset To UBound($_udf_globalids_used, 2) - 1
- If $_udf_globalids_used[$iindex][$x] = $iglobalid Then
- $_udf_globalids_used[$iindex][$x] = 0
- Return True
- EndIf
- Next
- Return SetError(-3, 0, False)
- EndIf
- Next
- Return SetError(-2, 0, False)
- EndFunc
- Func __udf_debugprint($stext, $iline = @ScriptLineNumber, $err = @error, $ext = @extended)
- ConsoleWrite("!===========================================================" & @CRLF & "+======================================================" & @CRLF & "-->Line(" & StringFormat("%04d", $iline) & "):" & @TAB & $stext & @CRLF & "+======================================================" & @CRLF)
- Return SetError($err, $ext, 1)
- EndFunc
- Func __udf_validateclassname($HotKeywnd, $sclassnames)
- __udf_debugprint("This is for debugging only, set the debug variable to false before submitting")
- If _winapi_isclassname($HotKeywnd, $sclassnames) Then Return True
- Local $sseparator = Opt("GUIDataSeparatorChar")
- $sclassnames = StringReplace($sclassnames, $sseparator, ",")
- __udf_debugprint("Invalid Class Type(s):" & @LF & @TAB & "Expecting Type(s): " & $sclassnames & @LF & @TAB & "Received Type : " & _winapi_getclassname($HotKeywnd))
- Exit
- EndFunc
- Global Const $__hotkeyconstant_classname = "msctls_hotkey32"
- Global $debug_hk
- Global Const $HotKeykm_sethotkey = $wm_user + 1
- Global Const $HotKeykm_gethotkey = $wm_user + 2
- Global Const $HotKeykm_setrules = $wm_user + 3
- Global Const $HotKeyotkeyf_shift = 1
- Global Const $HotKeyotkeyf_control = 2
- Global Const $HotKeyotkeyf_alt = 4
- Global Const $HotKeyotkeyf_ext = 8
- Global Const $HotKeykcomb_none = 1
- Global Const $HotKeykcomb_s = 2
- Global Const $HotKeykcomb_c = 4
- Global Const $HotKeykcomb_a = 8
- Global Const $HotKeykcomb_sc = 16
- Global Const $HotKeykcomb_sa = 32
- Global Const $HotKeykcomb_ca = 64
- Global Const $HotKeykcomb_sca = 128
- Func _guictrlhotkey_create($HotKeywnd, $ix, $iy, $iwidth = -1, $iheight = -1, $istyle = -1, $istyleex = -1)
- If (NOT IsHWnd($HotKeywnd)) OR (NOT WinExists($HotKeywnd)) Then Return SetError(1, 0, 0)
- If $iwidth = -1 Then $iwidth = 200
- If $iheight = -1 Then $iheight = 20
- If $istyle = -1 Then $istyle = $ws_overlapped
- If $istyleex = -1 Then $istyleex = $ws_ex_clientedge
- $istyle = BitOR($istyle, $ws_visible, $ws_child)
- Local $nctrlid = __udf_getnextglobalid($HotKeywnd)
- If @error Then Return SetError(@error, @extended, 0)
- Local $HotKeyret = _winapi_createwindowex($istyleex, $__hotkeyconstant_classname, "", $istyle, $ix, $iy, $iwidth, $iheight, $HotKeywnd, $nctrlid)
- If @error Then Return SetError(@error, @extended, 0)
- Return $HotKeyret
- EndFunc
- Func _guictrlhotkey_delete($HotKeyhotkey)
- If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
- If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
- Local $HotKeyfont = _sendmessage($HotKeyhotkey, $wm_getfont)
- If $HotKeyfont = 0 Then Return SetExtended(1, 1)
- _winapi_deleteobject($HotKeyfont)
- _winapi_destroywindow($HotKeyhotkey)
- If @error Then Return SetError(@error, @extended, 0)
- Return 1
- EndFunc
- Func _guictrlhotkey_gethotkey($HotKeyhotkey)
- If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
- If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
- Local $ihotkey = _guictrlhotkey_gethotkeycode($HotKeyhotkey)
- If $ihotkey = 0 Then Return ""
- Local $sret = ""
- Local $ihibyte = BitShift($ihotkey, 8)
- Local $ilobyte = BitAND($ihotkey, 255)
- If BitAND($ihibyte, $HotKeyotkeyf_control) Then $sret &= "^"
- If BitAND($ihibyte, $HotKeyotkeyf_shift) Then $sret &= "+"
- If BitAND($ihibyte, $HotKeyotkeyf_alt) Then $sret &= "!"
- If BitAND($ihibyte, $HotKeyotkeyf_ext) Then
- Switch $ilobyte
- Case 33
- $sret &= "{PGUP}"
- Case 34
- $sret &= "{PGDN}"
- Case 35
- $sret &= "{END}"
- Case 36
- $sret &= "{HOME}"
- Case 37
- $sret &= "{LEFT}"
- Case 38
- $sret &= "{UP}"
- Case 39
- $sret &= "{RIGHT}"
- Case 40
- $sret &= "{DOWN}"
- Case 45
- $sret &= "{INS}"
- Case 111
- $sret &= "{NUMPADDIV}"
- Case 144
- $sret &= "{NUMLOCK}"
- EndSwitch
- Else
- Switch $ilobyte
- Case 0
- Case 20
- $sret &= "{CAPSLOCK}"
- Case 96 To 105
- $sret &= "{NUMPAD" & ($ilobyte - 96) & "}"
- Case 106
- $sret &= "{NUMPADMULT}"
- Case 107
- $sret &= "{NUMPADADD}"
- Case 109
- $sret &= "{NUMPADSUB}"
- Case 110
- $sret &= "{NUMPADDOT}"
- Case 112 To 123
- $sret &= "{F" & ($ilobyte - 111) & "}"
- Case 145
- $sret &= "{SCROLLLOCK}"
- Case 186
- $sret &= ";"
- Case 187
- $sret &= "="
- Case 128 To 191
- $sret &= Chr($ilobyte - 144)
- Case 192
- $sret &= "`"
- Case 222
- $sret &= "'"
- Case 193 To 255
- $sret &= Chr($ilobyte - 128)
- Case Else
- $sret &= Chr($ilobyte)
- EndSwitch
- EndIf
- Return $sret
- EndFunc
- Func _guictrlhotkey_gethotkeycode($HotKeyhotkey)
- If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
- If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
- Return _sendmessage($HotKeyhotkey, $HotKeykm_gethotkey, 0, 0)
- EndFunc
- Func _guictrlhotkey_gethotkeyname($HotKeyhotkey)
- If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
- If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
- Local $ihotkey = _guictrlhotkey_gethotkeycode($HotKeyhotkey)
- If $ihotkey = 0 Then Return ""
- Local $sret = ""
- Local $ihibyte = BitShift($ihotkey, 8)
- Local $ilobyte = BitAND($ihotkey, 255)
- If BitAND($ihibyte, $HotKeyotkeyf_control) Then $sret &= "CTRL+"
- If BitAND($ihibyte, $HotKeyotkeyf_shift) Then $sret &= "SHIFT+"
- If BitAND($ihibyte, $HotKeyotkeyf_alt) Then $sret &= "ALT+"
- If BitAND($ihibyte, $HotKeyotkeyf_ext) Then
- Switch $ilobyte
- Case 33
- $sret &= "PGUP"
- Case 34
- $sret &= "PGDN"
- Case 35
- $sret &= "END"
- Case 36
- $sret &= "HOME"
- Case 37
- $sret &= "LEFT"
- Case 38
- $sret &= "UP"
- Case 39
- $sret &= "RIGHT"
- Case 40
- $sret &= "DOWN"
- Case 45
- $sret &= "INSERT"
- Case 111
- $sret &= "NUM DIVIDE"
- Case 144
- $sret &= "NUM LOCK"
- EndSwitch
- Else
- Switch $ilobyte
- Case 0
- Case 20
- $sret &= "CAPSLOCK"
- Case 96 To 105
- $sret &= "NUM " & ($ilobyte - 96) & ""
- Case 106
- $sret &= "NUMMULT"
- Case 107
- $sret &= "NUM PLUS"
- Case 109
- $sret &= "NUM SUB"
- Case 110
- $sret &= "NUM DECIMAL"
- Case 112 To 123
- $sret &= "F" & ($ilobyte - 111)
- Case 145
- $sret &= "SCROLL LOCK"
- Case 186
- $sret &= ";"
- Case 187
- $sret &= "="
- Case 128 To 191
- $sret &= Chr($ilobyte - 144)
- Case 192
- $sret &= "`"
- Case 222
- $sret &= "'"
- Case 193 To 255
- $sret &= Chr($ilobyte - 128)
- Case Else
- $sret &= Chr($ilobyte)
- EndSwitch
- EndIf
- Return $sret
- EndFunc
- Func _guictrlhotkey_setfont($HotKeyhotkey, $nsize, $nweight = 400, $nattribute = 0, $sface = "Arial", $nquality = 2)
- If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
- If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
- Local $HotKeydc, $nheight, $fitalic = False, $funderline = False, $fstrikeout = False, $HotKeyfont, $HotKeyfont_old
- $HotKeydc = _winapi_getdc($HotKeyhotkey)
- If @error Then Return SetError(@error, @extended, 0)
- $nheight = _winapi_muldiv($nsize, _winapi_getdevicecaps($HotKeydc, 90), 72)
- _winapi_releasedc($HotKeyhotkey, $HotKeydc)
- If BitAND($nattribute, 2) Then $fitalic = True
- If BitAND($nattribute, 4) Then $funderline = True
- If BitAND($nattribute, 8) Then $fstrikeout = True
- $HotKeyfont_old = _sendmessage($HotKeyhotkey, $wm_getfont)
- $HotKeyfont = _winapi_createfont($nheight, 0, 0, 0, $nweight, $fitalic, $funderline, $fstrikeout, 1, 0, 0, $nquality, 0, $sface)
- If @error Then Return SetError(@error, @extended, 0)
- _winapi_setfont($HotKeyhotkey, $HotKeyfont, True)
- If @error Then
- _winapi_deleteobject($HotKeyfont)
- Return SetError(@error, @extended, 0)
- EndIf
- If $HotKeyfont_old Then _winapi_deleteobject($HotKeyfont_old)
- Return 1
- EndFunc
- Func _guictrlhotkey_sethotkey($HotKeyhotkey, $shotkey)
- If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
- If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
- If $shotkey = "" Then Return _guictrlhotkey_sethotkeycode($HotKeyhotkey, 0)
- Local $ihibyte = 0
- Local $ilobyte = 0
- $shotkey = StringReplace($shotkey, "^", "")
- If @extended Then $ihibyte += $HotKeyotkeyf_control
- $shotkey = StringReplace($shotkey, "+", "")
- If @extended Then $ihibyte += $HotKeyotkeyf_shift
- $shotkey = StringReplace($shotkey, "!", "")
- If @extended Then $ihibyte += $HotKeyotkeyf_alt
- While 1
- Switch $shotkey
- Case "{PGUP}"
- $ilobyte += 33
- Case "{PGDN}"
- $ilobyte += 34
- Case "{END}"
- $ilobyte += 35
- Case "{HOME}"
- $ilobyte += 36
- Case "{LEFT}"
- $ilobyte += 37
- Case "{UP}"
- $ilobyte += 38
- Case "{RIGHT}"
- $ilobyte += 39
- Case "{DOWN}"
- $ilobyte += 40
- Case "{INS}"
- $ilobyte += 45
- Case "{NUMPADDIV}"
- $ilobyte += 111
- Case "{NUMLOCK}"
- $ilobyte += 144
- Case Else
- Switch $shotkey
- Case "{CAPSLOCK}"
- $ilobyte = 20
- Case "{NUMPADMULT}"
- $ilobyte = 106
- Case "{NUMPADADD}"
- $ilobyte = 107
- Case "{NUMPADSUB}"
- $ilobyte = 109
- Case "{NUMPADDOT}"
- $ilobyte = 110
- Case "{SCROLLLOCK}"
- $ilobyte = 145
- Case ";"
- $ilobyte = 186
- Case "="
- $ilobyte = 187
- Case "`"
- $ilobyte = 192
- Case "'"
- $ilobyte = 222
- Case Else
- While 1
- For $i = 16 To 47
- If $shotkey = Chr($i) Then
- $ilobyte = $i + 144
- ExitLoop 2
- EndIf
- Next
- For $i = 65 To 127
- If $shotkey = Chr($i) Then
- $ilobyte = $i
- ExitLoop 2
- EndIf
- Next
- For $i = 0 To 9
- If $shotkey = "{numpad" & $i & "}" Then
- $ilobyte = $i + 96
- ExitLoop 2
- EndIf
- Next
- For $i = 1 To 12
- If $shotkey = "{f" & $i & "}" Then
- $ilobyte = $i + 111
- ExitLoop 2
- EndIf
- Next
- $ilobyte = Asc($shotkey)
- ExitLoop
- WEnd
- EndSwitch
- ExitLoop
- EndSwitch
- $ihibyte += $HotKeyotkeyf_ext
- ExitLoop
- WEnd
- Return _guictrlhotkey_sethotkeycode($HotKeyhotkey, BitShift($ihibyte, -8) + $ilobyte)
- EndFunc
- Func _guictrlhotkey_sethotkeycode($HotKeyhotkey, $ihotkey)
- If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
- If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
- _sendmessage($HotKeyhotkey, $HotKeykm_sethotkey, $ihotkey, 0)
- Return 1
- EndFunc
- Func _guictrlhotkey_sethotkeyname($HotKeyhotkey, $shotkey)
- If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
- If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
- If $shotkey = "" Then Return _guictrlhotkey_sethotkeycode($HotKeyhotkey, 0)
- Local $ihibyte = 0
- Local $ilobyte = 0
- $shotkey = StringStripWS($shotkey, 8)
- $shotkey = StringReplace($shotkey, "CTRL+", "")
- If @extended Then $ihibyte += $HotKeyotkeyf_control
- $shotkey = StringReplace($shotkey, "SHIFT+", "")
- If @extended Then $ihibyte += $HotKeyotkeyf_shift
- $shotkey = StringReplace($shotkey, "ALT+", "")
- If @extended Then $ihibyte += $HotKeyotkeyf_alt
- Switch $shotkey
- Case "CAPSLOCK"
- $ilobyte = 20
- Case "NUMMULT"
- $ilobyte = 106
- Case "NUMPLUS"
- $ilobyte = 107
- Case "NUMSUB"
- $ilobyte = 109
- Case "NUMDECIMAL"
- $ilobyte = 110
- Case "SCROLLLOCK"
- $ilobyte = 145
- Case ";"
- $ilobyte = 186
- Case "="
- $ilobyte = 187
- Case "`"
- $ilobyte = 192
- Case "'"
- $ilobyte = 222
- Case Else
- While 1
- For $i = 16 To 47
- If $shotkey = Chr($i) Then
- $ilobyte = $i + 144
- ExitLoop 2
- EndIf
- Next
- For $i = 65 To 127
- If $shotkey = Chr($i) Then
- $ilobyte = $i
- ExitLoop 2
- EndIf
- Next
- For $i = 0 To 9
- If $shotkey = "NUM" & $i Then
- $ilobyte = $i + 96
- ExitLoop 2
- EndIf
- Next
- For $i = 1 To 12
- If $shotkey = "F" & $i Then
- $ilobyte = $i + 111
- ExitLoop 2
- EndIf
- Next
- $ilobyte = Asc($shotkey)
- ExitLoop
- WEnd
- EndSwitch
- Return _guictrlhotkey_sethotkeycode($HotKeyhotkey, BitShift($ihibyte, -8) + $ilobyte)
- EndFunc
- Func _guictrlhotkey_setrules($HotKeyhotkey, $icombinv, $imodinv)
- If $debug_hk Then __udf_validateclassname($HotKeyhotkey, $__hotkeyconstant_classname)
- If NOT WinExists($HotKeyhotkey) Then Return SetError(1, 0, 0)
- _sendmessage($HotKeyhotkey, $HotKeykm_setrules, $icombinv, $imodinv)
- EndFunc
- Func _IsChecked($idControlID)
- Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
- EndFunc
- #RequireAdmin
- #NoTrayIcon
- $x= @DesktopWidth/2-70
- $y= @DesktopHeight/1.5
- Local $Initialized, $v, $z,$v2
- $Initialized = False
- $BreakLagg = False
- $TotalTime = IniRead("Lag.ini", "Lag7", "Sec", "8")
- $CooldownTotal = IniRead("Lag.ini", "Lag7", "CooldownSec", "5")
- $UseCD = IniRead("Lag.ini", "Lag7", "UseCD", "True")
- $GUI = GUICreate("Lag7", 150, 150)
- GUICtrlCreateLabel("Lagg Time", 12, 5, 60, 20)
- $Slider = GUICtrlCreateSlider(3, 22, 95, 25)
- GUICtrlSetLimit(-1, 20, 1)
- GUICtrlSetData(-1, $TotalTime)
- $Slider1Label = GUICtrlCreateLabel($TotalTime & " Sec.", 102, 27, 60, 20)
- GUICtrlCreateLabel("Cooldown Time", 12, 55, 100, 20)
- $Slider2 = GUICtrlCreateSlider(3, 72, 95, 25)
- GUICtrlSetLimit(-1, 10, 1)
- GUICtrlSetData(-1, $CooldownTotal)
- $Slider2Label = GUICtrlCreateLabel($CooldownTotal & " Sec.", 102, 77, 60, 20)
- $UseCDCheckbox = GUICtrlCreateCheckbox("Use CD",12,95,80,20)
- if $UseCD == "True" then
- GUICtrlSetState (-1, 1)
- Else
- GUICtrlSetState (-1, 4)
- EndIf
- $Button = GUICtrlCreateButton("Set", 100, 120, 40, 22)
- $k = _guictrlhotkey_create($GUI, 10, 121, 80, 20)
- $HotKey = IniRead("Lag.ini", "Lag7", "Key", "{f1}")
- _guictrlhotkey_sethotkey($k, $HotKey)
- $n = Run("netsh", "", @SW_HIDE, 1)
- GUISetState()
- HotKeySet($HotKey, "LaggStart")
- HotKeySet("{f8}", "ExitNow")
- Func LaggStart()
- HotKeySet($HotKey)
- If Not $Initialized Then
- Initialize()
- Else
- StdinWrite($n, "ipsec static set policy lag assign=y" & @CRLF)
- WhileLagg()
- EndIf
- EndFunc
- Func WhileLagg()
- HotKeySet($HotKey, "BreakLagg")
- For $TimeLeft = $TotalTime To 0 Step -1
- $Progressstr=""
- $Proc = $TimeLeft/$TotalTime
- $Proc2 = 20*$Proc
- For $i = 1 To $Proc2 Step 1
- $Progressstr =$Progressstr&"-"
- Next
- ToolTip($Progressstr, $x, $y,"Lag7 Started: " & $TimeLeft & " Sec.",0,4)
- $i2 = TimerInit()
- While TimerDiff($i2) < 1000
- If $BreakLagg Then
- LaggEnd()
- Return
- ElseIf GUIGetMsg() = $gui_event_close Then
- ExitNow()
- EndIf
- Sleep(10)
- WEnd
- Next
- LaggEnd()
- EndFunc
- Func BreakLagg()
- $BreakLagg = True
- EndFunc
- Func LaggEnd()
- $BreakLagg = False
- HotKeySet($HotKey)
- StdinWrite($n, "ipsec static set policy lag assign=n" & @CRLF)
- If $UseCD == "True" Then
- For $TL = $CooldownTotal To 0 Step -1
- $Progressstr=""
- $Proc = $TL/$CooldownTotal
- $Proc2 = 20*$Proc
- For $i = 1 To $Proc2 Step 1
- $Progressstr =$Progressstr&"-"
- Next
- ToolTip($Progressstr, $x, $y,"Lag7 Cooldown: " & $TL & " Sec.",0,4)
- $tim = TimerInit()
- While TimerDiff($tim) < 1000
- Sleep(10)
- WEnd
- Next
- EndIf
- ToolTip("Laggspike finished", $x, $y,"Lag7 Finished" ,0,4)
- HotKeySet($HotKey, "LaggStart")
- Sleep(1000)
- ToolTip("")
- EndFunc
- Func Initialize()
- 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)
- $Initialized = True
- LaggStart()
- EndFunc
- Func ExitNow()
- $z = 1
- StdinWrite($n, "ipsec static delete all" & @CRLF)
- Exit
- EndFunc
- While 1
- $msg = GUIGetMsg()
- Select
- Case $msg = $gui_event_close
- ExitNow()
- Case $msg = $Button
- HotKeySet($HotKey)
- $HotKey = _guictrlhotkey_gethotkey($k)
- If $HotKey = "" Then
- MsgBox(64, "Error", "No hotkey entered")
- Else
- $HotKey = StringLower($HotKey)
- HotKeySet($HotKey, "LaggStart")
- IniWrite("Lag.ini", "Lag7", "Key", $HotKey)
- EndIf
- Case $msg = $UseCDCheckbox
- If _IsChecked($UseCDCheckbox) Then
- IniWrite("Lag.ini", "Lag7", "UseCD", "True")
- $UseCD = "True"
- Else
- IniWrite("Lag.ini", "Lag7", "UseCD", "False")
- $UseCD = "False"
- EndIf
- Case Else
- $TotalTime = GUICtrlRead($Slider)
- If $v <> $TotalTime Then
- $v = $TotalTime
- GUICtrlSetData($Slider1Label, $TotalTime & " Sec.")
- IniWrite("Lag.ini", "Lag7", "Sec", $TotalTime)
- EndIf
- $CooldownTotal = GUICtrlRead($Slider2)
- If $v2 <> $CooldownTotal Then
- $v2 = $CooldownTotal
- GUICtrlSetData($Slider2Label, $CooldownTotal & " Sec.")
- IniWrite("Lag.ini", "Lag7", "CooldownSec", $CooldownTotal)
- EndIf
- EndSelect
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement