首页
社区
课程
招聘
[旧帖] [求助]各位大虾帮忙反编译一下au3的程序 0.00雪花
发表于: 2016-7-6 18:51 5205

[旧帖] [求助]各位大虾帮忙反编译一下au3的程序 0.00雪花

2016-7-6 18:51
5205
想要学习一下 但是看不到源代码 求各位大虾帮帮忙

程序见附件

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

上传的附件:
收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 20
活跃值: (50)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
#Region
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Comment=软件安装管理器 By seeking
#AutoIt3Wrapper_Res_Description=软件安装管理器 By seeking
#AutoIt3Wrapper_Res_Fileversion=1.0.0.10
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=CopyRight (C) 2010
#EndRegion
GLOBAL $TEST_FLAG1 = 0x00000000
GLOBAL $TEST_FLAG2 = 0x00000000
GLOBAL CONST $GUI_EVENT_CLOSE = -0x00000003
GLOBAL CONST $GUI_EVENT_MINIMIZE = -0x00000004
GLOBAL CONST $GUI_EVENT_RESTORE = -0x00000005
GLOBAL CONST $GUI_EVENT_MAXIMIZE = -0x00000006
GLOBAL CONST $GUI_EVENT_PRIMARYDOWN = -0x00000007
GLOBAL CONST $GUI_EVENT_PRIMARYUP = -0x00000008
GLOBAL CONST $GUI_EVENT_SECONDARYDOWN = -0x00000009
GLOBAL CONST $GUI_EVENT_SECONDARYUP = -0x0000000A
GLOBAL CONST $GUI_EVENT_MOUSEMOVE = -0x0000000B
GLOBAL CONST $GUI_EVENT_RESIZED = -0x0000000C
GLOBAL CONST $GUI_EVENT_DROPPED = -0x0000000D
GLOBAL CONST $GUI_RUNDEFMSG = "GUI_RUNDEFMSG"
GLOBAL CONST $GUI_AVISTOP = 0x00000000
GLOBAL CONST $GUI_AVISTART = 0x00000001
GLOBAL CONST $GUI_AVICLOSE = 0x00000002
GLOBAL CONST $GUI_CHECKED = 0x00000001
GLOBAL CONST $GUI_INDETERMINATE = 0x00000002
GLOBAL CONST $GUI_UNCHECKED = 0x00000004
GLOBAL CONST $GUI_DROPACCEPTED = 0x00000008
GLOBAL CONST $GUI_NODROPACCEPTED = 0x00001000
GLOBAL CONST $GUI_ACCEPTFILES = $GUI_DROPACCEPTED
GLOBAL CONST $GUI_SHOW = 0x00000010
GLOBAL CONST $GUI_HIDE = 0x00000020
GLOBAL CONST $GUI_ENABLE = 0x00000040
GLOBAL CONST $GUI_DISABLE = 0x00000080
GLOBAL CONST $GUI_FOCUS = 0x00000100
GLOBAL CONST $GUI_NOFOCUS = 0x00002000
GLOBAL CONST $GUI_DEFBUTTON = 0x00000200
GLOBAL CONST $GUI_EXPAND = 0x00000400
GLOBAL CONST $GUI_ONTOP = 0x00000800
GLOBAL CONST $GUI_FONTITALIC = 0x00000002
GLOBAL CONST $GUI_FONTUNDER = 0x00000004
GLOBAL CONST $GUI_FONTSTRIKE = 0x00000008
GLOBAL CONST $GUI_DOCKAUTO = 0x00000001
GLOBAL CONST $GUI_DOCKLEFT = 0x00000002
GLOBAL CONST $GUI_DOCKRIGHT = 0x00000004
GLOBAL CONST $GUI_DOCKHCENTER = 0x00000008
GLOBAL CONST $GUI_DOCKTOP = 0x00000020
GLOBAL CONST $GUI_DOCKBOTTOM = 0x00000040
GLOBAL CONST $GUI_DOCKVCENTER = 0x00000080
GLOBAL CONST $GUI_DOCKWIDTH = 0x00000100
GLOBAL CONST $GUI_DOCKHEIGHT = 0x00000200
GLOBAL CONST $GUI_DOCKSIZE = 0x00000300
GLOBAL CONST $GUI_DOCKMENUBAR = 0x00000220
GLOBAL CONST $GUI_DOCKSTATEBAR = 0x00000240
GLOBAL CONST $GUI_DOCKALL = 0x00000322
GLOBAL CONST $GUI_DOCKBORDERS = 0x00000066
GLOBAL CONST $GUI_GR_CLOSE = 0x00000001
GLOBAL CONST $GUI_GR_LINE = 0x00000002
GLOBAL CONST $GUI_GR_BEZIER = 0x00000004
GLOBAL CONST $GUI_GR_MOVE = 0x00000006
GLOBAL CONST $GUI_GR_COLOR = 0x00000008
GLOBAL CONST $GUI_GR_RECT = 0x0000000A
GLOBAL CONST $GUI_GR_ELLIPSE = 0x0000000C
GLOBAL CONST $GUI_GR_PIE = 0x0000000E
GLOBAL CONST $GUI_GR_DOT = 0x00000010
GLOBAL CONST $GUI_GR_PIXEL = 0x00000012
GLOBAL CONST $GUI_GR_HINT = 0x00000014
GLOBAL CONST $GUI_GR_REFRESH = 0x00000016
GLOBAL CONST $GUI_GR_PENSIZE = 0x00000018
GLOBAL CONST $GUI_GR_NOBKCOLOR = -0x00000002
GLOBAL CONST $GUI_BKCOLOR_DEFAULT = -0x00000001
GLOBAL CONST $GUI_BKCOLOR_TRANSPARENT = -0x00000002
GLOBAL CONST $GUI_BKCOLOR_LV_ALTERNATE = 0xFE000000
GLOBAL CONST $GUI_WS_EX_PARENTDRAG = 0x00100000
GLOBAL CONST $WS_TILED = 0x00000000
GLOBAL CONST $WS_OVERLAPPED = 0x00000000
GLOBAL CONST $WS_MAXIMIZEBOX = 0x00010000
GLOBAL CONST $WS_MINIMIZEBOX = 0x00020000
GLOBAL CONST $WS_TABSTOP = 0x00010000
GLOBAL CONST $WS_GROUP = 0x00020000
GLOBAL CONST $WS_SIZEBOX = 0x00040000
GLOBAL CONST $WS_THICKFRAME = 0x00040000
GLOBAL CONST $WS_SYSMENU = 0x00080000
GLOBAL CONST $WS_HSCROLL = 0x00100000
GLOBAL CONST $WS_VSCROLL = 0x00200000
GLOBAL CONST $WS_DLGFRAME = 0x00400000
GLOBAL CONST $WS_BORDER = 0x00800000
GLOBAL CONST $WS_CAPTION = 0x00C00000
GLOBAL CONST $WS_OVERLAPPEDWINDOW = 0x00CF0000
GLOBAL CONST $WS_TILEDWINDOW = 0x00CF0000
GLOBAL CONST $WS_MAXIMIZE = 0x01000000
GLOBAL CONST $WS_CLIPCHILDREN = 0x02000000
GLOBAL CONST $WS_CLIPSIBLINGS = 0x04000000
GLOBAL CONST $WS_DISABLED = 0x08000000
GLOBAL CONST $WS_VISIBLE = 0x10000000
GLOBAL CONST $WS_MINIMIZE = 0x20000000
GLOBAL CONST $WS_CHILD = 0x40000000
GLOBAL CONST $WS_POPUP = 0x80000000
GLOBAL CONST $WS_POPUPWINDOW = 0x80880000
GLOBAL CONST $DS_MODALFRAME = 0x00000080
GLOBAL CONST $DS_SETFOREGROUND = 0x00000200
GLOBAL CONST $DS_CONTEXTHELP = 0x00002000
GLOBAL CONST $WS_EX_ACCEPTFILES = 0x00000010
GLOBAL CONST $WS_EX_MDICHILD = 0x00000040
GLOBAL CONST $WS_EX_APPWINDOW = 0x00040000
GLOBAL CONST $WS_EX_COMPOSITED = 0x02000000
GLOBAL CONST $WS_EX_CLIENTEDGE = 0x00000200
GLOBAL CONST $WS_EX_CONTEXTHELP = 0x00000400
GLOBAL CONST $WS_EX_DLGMODALFRAME = 0x00000001
GLOBAL CONST $WS_EX_LEFTSCROLLBAR = 0x00004000
GLOBAL CONST $WS_EX_OVERLAPPEDWINDOW = 0x00000300
GLOBAL CONST $WS_EX_RIGHT = 0x00001000
GLOBAL CONST $WS_EX_STATICEDGE = 0x00020000
GLOBAL CONST $WS_EX_TOOLWINDOW = 0x00000080
GLOBAL CONST $WS_EX_TOPMOST = 0x00000008
GLOBAL CONST $WS_EX_TRANSPARENT = 0x00000020
GLOBAL CONST $WS_EX_WINDOWEDGE = 0x00000100
GLOBAL CONST $WS_EX_LAYERED = 0x00080000
GLOBAL CONST $WS_EX_CONTROLPARENT = 0x00010000
GLOBAL CONST $WS_EX_LAYOUTRTL = 0x00400000
GLOBAL CONST $WS_EX_RTLREADING = 0x00002000
GLOBAL CONST $WM_GETTEXTLENGTH = 0x0000000E
GLOBAL CONST $WM_GETTEXT = 0x0000000D
GLOBAL CONST $WM_SIZE = 0x00000005
GLOBAL CONST $WM_SIZING = 0x00000214
GLOBAL CONST $WM_USER = 0x00000400
GLOBAL CONST $WM_CREATE = 0x00000001
GLOBAL CONST $WM_DESTROY = 0x00000002
GLOBAL CONST $WM_MOVE = 0x00000003
GLOBAL CONST $WM_ACTIVATE = 0x00000006
GLOBAL CONST $WM_SETFOCUS = 0x00000007
GLOBAL CONST $WM_KILLFOCUS = 0x00000008
GLOBAL CONST $WM_ENABLE = 0x0000000A
GLOBAL CONST $WM_SETREDRAW = 0x0000000B
GLOBAL CONST $WM_SETTEXT = 0x0000000C
GLOBAL CONST $WM_PAINT = 0x0000000F
GLOBAL CONST $WM_CLOSE = 0x00000010
GLOBAL CONST $WM_QUIT = 0x00000012
GLOBAL CONST $WM_ERASEBKGND = 0x00000014
GLOBAL CONST $WM_SYSCOLORCHANGE = 0x00000015
GLOBAL CONST $WM_SHOWWINDOW = 0x00000018
GLOBAL CONST $WM_WININICHANGE = 0x0000001A
GLOBAL CONST $WM_DEVMODECHANGE = 0x0000001B
GLOBAL CONST $WM_ACTIVATEAPP = 0x0000001C
GLOBAL CONST $WM_FONTCHANGE = 0x0000001D
GLOBAL CONST $WM_TIMECHANGE = 0x0000001E
GLOBAL CONST $WM_CANCELMODE = 0x0000001F
GLOBAL CONST $WM_SETCURSOR = 0x00000020
GLOBAL CONST $WM_MOUSEACTIVATE = 0x00000021
GLOBAL CONST $WM_CHILDACTIVATE = 0x00000022
GLOBAL CONST $WM_QUEUESYNC = 0x00000023
GLOBAL CONST $WM_GETMINMAXINFO = 0x00000024
GLOBAL CONST $WM_PAINTICON = 0x00000026
GLOBAL CONST $WM_ICONERASEBKGND = 0x00000027
GLOBAL CONST $WM_NEXTDLGCTL = 0x00000028
GLOBAL CONST $WM_SPOOLERSTATUS = 0x0000002A
GLOBAL CONST $WM_DRAWITEM = 0x0000002B
GLOBAL CONST $WM_MEASUREITEM = 0x0000002C
GLOBAL CONST $WM_DELETEITEM = 0x0000002D
GLOBAL CONST $WM_VKEYTOITEM = 0x0000002E
GLOBAL CONST $WM_CHARTOITEM = 0x0000002F
GLOBAL CONST $WM_SETFONT = 0x00000030
GLOBAL CONST $WM_GETFONT = 0x00000031
GLOBAL CONST $WM_SETHOTKEY = 0x00000032
GLOBAL CONST $WM_GETHOTKEY = 0x00000033
GLOBAL CONST $WM_QUERYDRAGICON = 0x00000037
GLOBAL CONST $WM_COMPAREITEM = 0x00000039
GLOBAL CONST $WM_GETOBJECT = 0x0000003D
GLOBAL CONST $WM_COMPACTING = 0x00000041
GLOBAL CONST $WM_COMMNOTIFY = 0x00000044
GLOBAL CONST $WM_WINDOWPOSCHANGING = 0x00000046
GLOBAL CONST $WM_WINDOWPOSCHANGED = 0x00000047
GLOBAL CONST $WM_POWER = 0x00000048
GLOBAL CONST $WM_NOTIFY = 0x0000004E
GLOBAL CONST $WM_COPYDATA = 0x0000004A
GLOBAL CONST $WM_CANCELJOURNAL = 0x0000004B
GLOBAL CONST $WM_INPUTLANGCHANGEREQUEST = 0x00000050
GLOBAL CONST $WM_INPUTLANGCHANGE = 0x00000051
GLOBAL CONST $WM_TCARD = 0x00000052
GLOBAL CONST $WM_HELP = 0x00000053
GLOBAL CONST $WM_USERCHANGED = 0x00000054
GLOBAL CONST $WM_NOTIFYFORMAT = 0x00000055
GLOBAL CONST $WM_CUT = 0x00000300
GLOBAL CONST $WM_COPY = 0x00000301
GLOBAL CONST $WM_PASTE = 0x00000302
GLOBAL CONST $WM_CLEAR = 0x00000303
GLOBAL CONST $WM_UNDO = 0x00000304
GLOBAL CONST $WM_CONTEXTMENU = 0x0000007B
GLOBAL CONST $WM_STYLECHANGING = 0x0000007C
GLOBAL CONST $WM_STYLECHANGED = 0x0000007D
GLOBAL CONST $WM_DISPLAYCHANGE = 0x0000007E
GLOBAL CONST $WM_GETICON = 0x0000007F
GLOBAL CONST $WM_SETICON = 0x00000080
GLOBAL CONST $WM_NCCREATE = 0x00000081
GLOBAL CONST $WM_NCDESTROY = 0x00000082
GLOBAL CONST $WM_NCCALCSIZE = 0x00000083
GLOBAL CONST $WM_NCHITTEST = 0x00000084
GLOBAL CONST $WM_NCPAINT = 0x00000085
GLOBAL CONST $WM_NCACTIVATE = 0x00000086
GLOBAL CONST $WM_GETDLGCODE = 0x00000087
GLOBAL CONST $WM_SYNCPAINT = 0x00000088
GLOBAL CONST $WM_NCMOUSEMOVE = 0x000000A0
GLOBAL CONST $WM_NCLBUTTONDOWN = 0x000000A1
GLOBAL CONST $WM_NCLBUTTONUP = 0x000000A2
GLOBAL CONST $WM_NCLBUTTONDBLCLK = 0x000000A3
GLOBAL CONST $WM_NCRBUTTONDOWN = 0x000000A4
GLOBAL CONST $WM_NCRBUTTONUP = 0x000000A5
GLOBAL CONST $WM_NCRBUTTONDBLCLK = 0x000000A6
GLOBAL CONST $WM_NCMBUTTONDOWN = 0x000000A7
GLOBAL CONST $WM_NCMBUTTONUP = 0x000000A8
GLOBAL CONST $WM_NCMBUTTONDBLCLK = 0x000000A9
GLOBAL CONST $WM_KEYDOWN = 0x00000100
GLOBAL CONST $WM_KEYUP = 0x00000101
GLOBAL CONST $WM_CHAR = 0x00000102
GLOBAL CONST $WM_DEADCHAR = 0x00000103
GLOBAL CONST $WM_SYSKEYDOWN = 0x00000104
GLOBAL CONST $WM_SYSKEYUP = 0x00000105
GLOBAL CONST $WM_SYSCHAR = 0x00000106
GLOBAL CONST $WM_SYSDEADCHAR = 0x00000107
GLOBAL CONST $WM_INITDIALOG = 0x00000110
GLOBAL CONST $WM_COMMAND = 0x00000111
GLOBAL CONST $WM_SYSCOMMAND = 0x00000112
GLOBAL CONST $WM_TIMER = 0x00000113
GLOBAL CONST $WM_HSCROLL = 0x00000114
GLOBAL CONST $WM_VSCROLL = 0x00000115
GLOBAL CONST $WM_INITMENU = 0x00000116
GLOBAL CONST $WM_INITMENUPOPUP = 0x00000117
GLOBAL CONST $WM_MENUSELECT = 0x0000011F
GLOBAL CONST $WM_MENUCHAR = 0x00000120
GLOBAL CONST $WM_ENTERIDLE = 0x00000121
GLOBAL CONST $WM_MENURBUTTONUP = 0x00000122
GLOBAL CONST $WM_MENUDRAG = 0x00000123
GLOBAL CONST $WM_MENUGETOBJECT = 0x00000124
GLOBAL CONST $WM_UNINITMENUPOPUP = 0x00000125
GLOBAL CONST $WM_MENUCOMMAND = 0x00000126
GLOBAL CONST $WM_CHANGEUISTATE = 0x00000127
GLOBAL CONST $WM_UPDATEUISTATE = 0x00000128
GLOBAL CONST $WM_QUERYUISTATE = 0x00000129
GLOBAL CONST $WM_CTLCOLORMSGBOX = 0x00000132
GLOBAL CONST $WM_CTLCOLOREDIT = 0x00000133
GLOBAL CONST $WM_CTLCOLORLISTBOX = 0x00000134
GLOBAL CONST $WM_CTLCOLORBTN = 0x00000135
GLOBAL CONST $WM_CTLCOLORDLG = 0x00000136
GLOBAL CONST $WM_CTLCOLORSCROLLBAR = 0x00000137
GLOBAL CONST $WM_CTLCOLORSTATIC = 0x00000138
GLOBAL CONST $WM_CTLCOLOR = 0x00000019
GLOBAL CONST $MN_GETHMENU = 0x000001E1
GLOBAL CONST $NM_FIRST = 0x00000000
GLOBAL CONST $NM_OUTOFMEMORY = $NM_FIRST - 0x00000001
GLOBAL CONST $NM_CLICK = $NM_FIRST - 0x00000002
GLOBAL CONST $NM_DBLCLK = $NM_FIRST - 0x00000003
GLOBAL CONST $NM_RETURN = $NM_FIRST - 0x00000004
GLOBAL CONST $NM_RCLICK = $NM_FIRST - 0x00000005
GLOBAL CONST $NM_RDBLCLK = $NM_FIRST - 0x00000006
GLOBAL CONST $NM_SETFOCUS = $NM_FIRST - 0x00000007
GLOBAL CONST $NM_KILLFOCUS = $NM_FIRST - 0x00000008
GLOBAL CONST $NM_CUSTOMDRAW = $NM_FIRST - 0x0000000C
GLOBAL CONST $NM_HOVER = $NM_FIRST - 0x0000000D
GLOBAL CONST $NM_NCHITTEST = $NM_FIRST - 0x0000000E
GLOBAL CONST $NM_KEYDOWN = $NM_FIRST - 0x0000000F
GLOBAL CONST $NM_RELEASEDCAPTURE = $NM_FIRST - 0x00000010
GLOBAL CONST $NM_SETCURSOR = $NM_FIRST - 0x00000011
GLOBAL CONST $NM_CHAR = $NM_FIRST - 0x00000012
GLOBAL CONST $NM_TOOLTIPSCREATED = $NM_FIRST - 0x00000013
GLOBAL CONST $NM_LDOWN = $NM_FIRST - 0x00000014
GLOBAL CONST $NM_RDOWN = $NM_FIRST - 0x00000015
GLOBAL CONST $NM_THEMECHANGED = $NM_FIRST - 0x00000016
GLOBAL CONST $WM_MOUSEMOVE = 0x00000200
GLOBAL CONST $WM_LBUTTONDOWN = 0x00000201
GLOBAL CONST $WM_LBUTTONUP = 0x00000202
GLOBAL CONST $WM_LBUTTONDBLCLK = 0x00000203
GLOBAL CONST $WM_RBUTTONDOWN = 0x00000204
GLOBAL CONST $WM_RBUTTONUP = 0x00000205
GLOBAL CONST $WM_RBUTTONDBLCK = 0x00000206
GLOBAL CONST $WM_MBUTTONDOWN = 0x00000207
GLOBAL CONST $WM_MBUTTONUP = 0x00000208
GLOBAL CONST $WM_MBUTTONDBLCK = 0x00000209
GLOBAL CONST $WM_MOUSEWHEEL = 0x0000020A
GLOBAL CONST $WM_XBUTTONDOWN = 0x0000020B
GLOBAL CONST $WM_XBUTTONUP = 0x0000020C
GLOBAL CONST $WM_XBUTTONDBLCLK = 0x0000020D
GLOBAL CONST $WM_MOUSEHWHEEL = 0x0000020E
GLOBAL CONST $PS_SOLID = 0x00000000
GLOBAL CONST $PS_DASH = 0x00000001
GLOBAL CONST $PS_DOT = 0x00000002
GLOBAL CONST $PS_DASHDOT = 0x00000003
GLOBAL CONST $PS_DASHDOTDOT = 0x00000004
GLOBAL CONST $PS_NULL = 0x00000005
GLOBAL CONST $PS_INSIDEFRAME = 0x00000006
GLOBAL CONST $LWA_ALPHA = 0x00000002
GLOBAL CONST $LWA_COLORKEY = 0x00000001
GLOBAL CONST $RGN_AND = 0x00000001
GLOBAL CONST $RGN_OR = 0x00000002
GLOBAL CONST $RGN_XOR = 0x00000003
GLOBAL CONST $RGN_DIFF = 0x00000004
GLOBAL CONST $RGN_COPY = 0x00000005
GLOBAL CONST $ERRORREGION = 0x00000000
GLOBAL CONST $NULLREGION = 0x00000001
GLOBAL CONST $SIMPLEREGION = 0x00000002
GLOBAL CONST $COMPLEXREGION = 0x00000003
GLOBAL CONST $TRANSPARENT = 0x00000001
GLOBAL CONST $OPAQUE = 0x00000002
GLOBAL CONST $CCM_FIRST = 0x00002000
GLOBAL CONST $CCM_GETUNICODEFORMAT = ($CCM_FIRST + 0x00000006)
GLOBAL CONST $CCM_SETUNICODEFORMAT = ($CCM_FIRST + 0x00000005)
GLOBAL CONST $CCM_SETBKCOLOR = $CCM_FIRST + 0x00000001
GLOBAL CONST $CCM_SETCOLORSCHEME = $CCM_FIRST + 0x00000002
GLOBAL CONST $CCM_GETCOLORSCHEME = $CCM_FIRST + 0x00000003
GLOBAL CONST $CCM_GETDROPTARGET = $CCM_FIRST + 0x00000004
GLOBAL CONST $CCM_SETWINDOWTHEME = $CCM_FIRST + 0x0000000B
GLOBAL CONST $GA_PARENT = 0x00000001
GLOBAL CONST $GA_ROOT = 0x00000002
GLOBAL CONST $GA_ROOTOWNER = 0x00000003
GLOBAL CONST $SM_CXSCREEN = 0x00000000
GLOBAL CONST $SM_CYSCREEN = 0x00000001
GLOBAL CONST $SM_CXVSCROLL = 0x00000002
GLOBAL CONST $SM_CYHSCROLL = 0x00000003
GLOBAL CONST $SM_CYCAPTION = 0x00000004
GLOBAL CONST $SM_CXBORDER = 0x00000005
GLOBAL CONST $SM_CYBORDER = 0x00000006
GLOBAL CONST $SM_CXDLGFRAME = 0x00000007
GLOBAL CONST $SM_CYDLGFRAME = 0x00000008
GLOBAL CONST $SM_CYVTHUMB = 0x00000009
GLOBAL CONST $SM_CXHTHUMB = 0x0000000A
GLOBAL CONST $SM_CXICON = 0x0000000B
GLOBAL CONST $SM_CYICON = 0x0000000C
GLOBAL CONST $SM_CXCURSOR = 0x0000000D
GLOBAL CONST $SM_CYCURSOR = 0x0000000E
GLOBAL CONST $SM_CYMENU = 0x0000000F
GLOBAL CONST $SM_CXFULLSCREEN = 0x00000010
GLOBAL CONST $SM_CYFULLSCREEN = 0x00000011
GLOBAL CONST $SM_CYKANJIWINDOW = 0x00000012
GLOBAL CONST $SM_MOUSEPRESENT = 0x00000013
GLOBAL CONST $SM_CYVSCROLL = 0x00000014
GLOBAL CONST $SM_CXHSCROLL = 0x00000015
GLOBAL CONST $SM_DEBUG = 0x00000016
GLOBAL CONST $SM_SWAPBUTTON = 0x00000017
GLOBAL CONST $SM_RESERVED1 = 0x00000018
GLOBAL CONST $SM_RESERVED2 = 0x00000019
GLOBAL CONST $SM_RESERVED3 = 0x0000001A
GLOBAL CONST $SM_RESERVED4 = 0x0000001B
GLOBAL CONST $SM_CXMIN = 0x0000001C
GLOBAL CONST $SM_CYMIN = 0x0000001D
GLOBAL CONST $SM_CXSIZE = 0x0000001E
GLOBAL CONST $SM_CYSIZE = 0x0000001F
GLOBAL CONST $SM_CXFRAME = 0x00000020
GLOBAL CONST $SM_CYFRAME = 0x00000021
GLOBAL CONST $SM_CXMINTRACK = 0x00000022
GLOBAL CONST $SM_CYMINTRACK = 0x00000023
GLOBAL CONST $SM_CXDOUBLECLK = 0x00000024
GLOBAL CONST $SM_CYDOUBLECLK = 0x00000025
GLOBAL CONST $SM_CXICONSPACING = 0x00000026
GLOBAL CONST $SM_CYICONSPACING = 0x00000027
GLOBAL CONST $SM_MENUDROPALIGNMENT = 0x00000028
GLOBAL CONST $SM_PENWINDOWS = 0x00000029
GLOBAL CONST $SM_DBCSENABLED = 0x0000002A
GLOBAL CONST $SM_CMOUSEBUTTONS = 0x0000002B
GLOBAL CONST $SM_SECURE = 0x0000002C
GLOBAL CONST $SM_CXEDGE = 0x0000002D
GLOBAL CONST $SM_CYEDGE = 0x0000002E
GLOBAL CONST $SM_CXMINSPACING = 0x0000002F
GLOBAL CONST $SM_CYMINSPACING = 0x00000030
GLOBAL CONST $SM_CXSMICON = 0x00000031
GLOBAL CONST $SM_CYSMICON = 0x00000032
GLOBAL CONST $SM_CYSMCAPTION = 0x00000033
GLOBAL CONST $SM_CXSMSIZE = 0x00000034
GLOBAL CONST $SM_CYSMSIZE = 0x00000035
GLOBAL CONST $SM_CXMENUSIZE = 0x00000036
GLOBAL CONST $SM_CYMENUSIZE = 0x00000037
GLOBAL CONST $SM_ARRANGE = 0x00000038
GLOBAL CONST $SM_CXMINIMIZED = 0x00000039
GLOBAL CONST $SM_CYMINIMIZED = 0x0000003A
GLOBAL CONST $SM_CXMAXTRACK = 0x0000003B
GLOBAL CONST $SM_CYMAXTRACK = 0x0000003C
GLOBAL CONST $SM_CXMAXIMIZED = 0x0000003D
GLOBAL CONST $SM_CYMAXIMIZED = 0x0000003E
GLOBAL CONST $SM_NETWORK = 0x0000003F
GLOBAL CONST $SM_CLEANBOOT = 0x00000043
GLOBAL CONST $SM_CXDRAG = 0x00000044
GLOBAL CONST $SM_CYDRAG = 0x00000045
GLOBAL CONST $SM_SHOWSOUNDS = 0x00000046
GLOBAL CONST $SM_CXMENUCHECK = 0x00000047
GLOBAL CONST $SM_CYMENUCHECK = 0x00000048
GLOBAL CONST $SM_SLOWMACHINE = 0x00000049
GLOBAL CONST $SM_MIDEASTENABLED = 0x0000004A
GLOBAL CONST $SM_MOUSEWHEELPRESENT = 0x0000004B
GLOBAL CONST $SM_XVIRTUALSCREEN = 0x0000004C
GLOBAL CONST $SM_YVIRTUALSCREEN = 0x0000004D
GLOBAL CONST $SM_CXVIRTUALSCREEN = 0x0000004E
GLOBAL CONST $SM_CYVIRTUALSCREEN = 0x0000004F
GLOBAL CONST $SM_CMONITORS = 0x00000050
GLOBAL CONST $SM_SAMEDISPLAYFORMAT = 0x00000051
GLOBAL CONST $SM_IMMENABLED = 0x00000052
GLOBAL CONST $SM_CXFOCUSBORDER = 0x00000053
GLOBAL CONST $SM_CYFOCUSBORDER = 0x00000054
GLOBAL CONST $SM_TABLETPC = 0x00000056
GLOBAL CONST $SM_MEDIACENTER = 0x00000057
GLOBAL CONST $SM_STARTER = 0x00000058
GLOBAL CONST $SM_SERVERR2 = 0x00000059
GLOBAL CONST $SM_CMETRICS = 0x0000005A
GLOBAL CONST $SM_REMOTESESSION = 0x00001000
GLOBAL CONST $SM_SHUTTINGDOWN = 0x00002000
GLOBAL CONST $SM_REMOTECONTROL = 0x00002001
GLOBAL CONST $SM_CARETBLINKINGENABLED = 0x00002002
GLOBAL CONST $BLACKNESS = 0x00000042
GLOBAL CONST $CAPTUREBLT = 0x40000000
GLOBAL CONST $DSTINVERT = 0x00550009
GLOBAL CONST $MERGECOPY = 0x00C000CA
GLOBAL CONST $MERGEPAINT = 0x00BB0226
GLOBAL CONST $NOMIRRORBITMAP = 0x80000000
GLOBAL CONST $NOTSRCCOPY = 0x00330008
GLOBAL CONST $NOTSRCERASE = 0x001100A6
GLOBAL CONST $PATCOPY = 0x00F00021
GLOBAL CONST $PATINVERT = 0x005A0049
GLOBAL CONST $PATPAINT = 0x00FB0A09
GLOBAL CONST $SRCAND = 0x008800C6
GLOBAL CONST $SRCCOPY = 0x00CC0020
GLOBAL CONST $SRCERASE = 0x00440328
GLOBAL CONST $SRCINVERT = 0x00660046
GLOBAL CONST $SRCPAINT = 0x00EE0086
GLOBAL CONST $WHITENESS = 0x00FF0062
GLOBAL CONST $DT_BOTTOM = 0x00000008
GLOBAL CONST $DT_CALCRECT = 0x00000400
GLOBAL CONST $DT_CENTER = 0x00000001
GLOBAL CONST $DT_EDITCONTROL = 0x00002000
GLOBAL CONST $DT_END_ELLIPSIS = 0x00008000
GLOBAL CONST $DT_EXPANDTABS = 0x00000040
GLOBAL CONST $DT_EXTERNALLEADING = 0x00000200
GLOBAL CONST $DT_HIDEPREFIX = 0x00100000
GLOBAL CONST $DT_INTERNAL = 0x00001000
GLOBAL CONST $DT_LEFT = 0x00000000
GLOBAL CONST $DT_MODIFYSTRING = 0x00010000
GLOBAL CONST $DT_NOCLIP = 0x00000100
GLOBAL CONST $DT_NOFULLWIDTHCHARBREAK = 0x00080000
GLOBAL CONST $DT_NOPREFIX = 0x00000800
GLOBAL CONST $DT_PATH_ELLIPSIS = 0x00004000
GLOBAL CONST $DT_PREFIXONLY = 0x00200000
GLOBAL CONST $DT_RIGHT = 0x00000002
GLOBAL CONST $DT_RTLREADING = 0x00020000
GLOBAL CONST $DT_SINGLELINE = 0x00000020
GLOBAL CONST $DT_TABSTOP = 0x00000080
GLOBAL CONST $DT_TOP = 0x00000000
GLOBAL CONST $DT_VCENTER = 0x00000004
GLOBAL CONST $DT_WORDBREAK = 0x00000010
GLOBAL CONST $DT_WORD_ELLIPSIS = 0x00040000
GLOBAL CONST $RDW_ERASE = 0x00000004
GLOBAL CONST $RDW_FRAME = 0x00000400
GLOBAL CONST $RDW_INTERNALPAINT = 0x00000002
GLOBAL CONST $RDW_INVALIDATE = 0x00000001
GLOBAL CONST $RDW_NOERASE = 0x00000020
GLOBAL CONST $RDW_NOFRAME = 0x00000800
GLOBAL CONST $RDW_NOINTERNALPAINT = 0x00000010
GLOBAL CONST $RDW_VALIDATE = 0x00000008
GLOBAL CONST $RDW_ERASENOW = 0x00000200
GLOBAL CONST $RDW_UPDATENOW = 0x00000100
GLOBAL CONST $RDW_ALLCHILDREN = 0x00000080
GLOBAL CONST $RDW_NOCHILDREN = 0x00000040
GLOBAL CONST $WM_RENDERFORMAT = 0x00000305
GLOBAL CONST $WM_RENDERALLFORMATS = 0x00000306
GLOBAL CONST $WM_DESTROYCLIPBOARD = 0x00000307
GLOBAL CONST $WM_DRAWCLIPBOARD = 0x00000308
GLOBAL CONST $WM_PAINTCLIPBOARD = 0x00000309
GLOBAL CONST $WM_VSCROLLCLIPBOARD = 0x0000030A
GLOBAL CONST $WM_SIZECLIPBOARD = 0x0000030B
GLOBAL CONST $WM_ASKCBFORMATNAME = 0x0000030C
GLOBAL CONST $WM_CHANGECBCHAIN = 0x0000030D
GLOBAL CONST $WM_HSCROLLCLIPBOARD = 0x0000030E
GLOBAL CONST $HTERROR = -0x00000002
GLOBAL CONST $HTTRANSPARENT = -0x00000001
GLOBAL CONST $HTNOWHERE = 0x00000000
GLOBAL CONST $HTCLIENT = 0x00000001
GLOBAL CONST $HTCAPTION = 0x00000002
GLOBAL CONST $HTSYSMENU = 0x00000003
GLOBAL CONST $HTGROWBOX = 0x00000004
GLOBAL CONST $HTSIZE = $HTGROWBOX
GLOBAL CONST $HTMENU = 0x00000005
GLOBAL CONST $HTHSCROLL = 0x00000006
GLOBAL CONST $HTVSCROLL = 0x00000007
GLOBAL CONST $HTMINBUTTON = 0x00000008
GLOBAL CONST $HTMAXBUTTON = 0x00000009
GLOBAL CONST $HTLEFT = 0x0000000A
GLOBAL CONST $HTRIGHT = 0x0000000B
GLOBAL CONST $HTTOP = 0x0000000C
GLOBAL CONST $HTTOPLEFT = 0x0000000D
GLOBAL CONST $HTTOPRIGHT = 0x0000000E
GLOBAL CONST $HTBOTTOM = 0x0000000F
GLOBAL CONST $HTBOTTOMLEFT = 0x00000010
GLOBAL CONST $HTBOTTOMRIGHT = 0x00000011
GLOBAL CONST $HTBORDER = 0x00000012
GLOBAL CONST $HTREDUCE = $HTMINBUTTON
GLOBAL CONST $HTZOOM = $HTMAXBUTTON
GLOBAL CONST $HTSIZEFIRST = $HTLEFT
GLOBAL CONST $HTSIZELAST = $HTBOTTOMRIGHT
GLOBAL CONST $HTOBJECT = 0x00000013
GLOBAL CONST $HTCLOSE = 0x00000014
GLOBAL CONST $HTHELP = 0x00000015
GLOBAL CONST $COLOR_SCROLLBAR = 0x00000000
GLOBAL CONST $COLOR_BACKGROUND = 0x00000001
GLOBAL CONST $COLOR_ACTIVECAPTION = 0x00000002
GLOBAL CONST $COLOR_INACTIVECAPTION = 0x00000003
GLOBAL CONST $COLOR_MENU = 0x00000004
GLOBAL CONST $COLOR_WINDOW = 0x00000005
GLOBAL CONST $COLOR_WINDOWFRAME = 0x00000006
GLOBAL CONST $COLOR_MENUTEXT = 0x00000007
GLOBAL CONST $COLOR_WINDOWTEXT = 0x00000008
GLOBAL CONST $COLOR_CAPTIONTEXT = 0x00000009
GLOBAL CONST $COLOR_ACTIVEBORDER = 0x0000000A
GLOBAL CONST $COLOR_INACTIVEBORDER = 0x0000000B
GLOBAL CONST $COLOR_APPWORKSPACE = 0x0000000C
GLOBAL CONST $COLOR_HIGHLIGHT = 0x0000000D
GLOBAL CONST $COLOR_HIGHLIGHTTEXT = 0x0000000E
GLOBAL CONST $COLOR_BTNFACE = 0x0000000F
GLOBAL CONST $COLOR_BTNSHADOW = 0x00000010
GLOBAL CONST $COLOR_GRAYTEXT = 0x00000011
GLOBAL CONST $COLOR_BTNTEXT = 0x00000012
GLOBAL CONST $COLOR_INACTIVECAPTIONTEXT = 0x00000013
GLOBAL CONST $COLOR_BTNHIGHLIGHT = 0x00000014
GLOBAL CONST $COLOR_3DDKSHADOW = 0x00000015
GLOBAL CONST $COLOR_3DLIGHT = 0x00000016
GLOBAL CONST $COLOR_INFOTEXT = 0x00000017
GLOBAL CONST $COLOR_INFOBK = 0x00000018
GLOBAL CONST $COLOR_HOTLIGHT = 0x0000001A
GLOBAL CONST $COLOR_GRADIENTACTIVECAPTION = 0x0000001B
GLOBAL CONST $COLOR_GRADIENTINACTIVECAPTION = 0x0000001C
GLOBAL CONST $COLOR_MENUHILIGHT = 0x0000001D
GLOBAL CONST $COLOR_MENUBAR = 0x0000001E
GLOBAL CONST $COLOR_DESKTOP = 0x00000001
GLOBAL CONST $COLOR_3DFACE = 0x0000000F
GLOBAL CONST $COLOR_3DSHADOW = 0x00000010
GLOBAL CONST $COLOR_3DHIGHLIGHT = 0x00000014
GLOBAL CONST $COLOR_3DHILIGHT = 0x00000014
GLOBAL CONST $COLOR_BTNHILIGHT = 0x00000014
GLOBAL CONST $HINST_COMMCTRL = -0x00000001
GLOBAL CONST $IDB_STD_SMALL_COLOR = 0x00000000
GLOBAL CONST $IDB_STD_LARGE_COLOR = 0x00000001
GLOBAL CONST $IDB_VIEW_SMALL_COLOR = 0x00000004
GLOBAL CONST $IDB_VIEW_LARGE_COLOR = 0x00000005
GLOBAL CONST $IDB_HIST_SMALL_COLOR = 0x00000008
GLOBAL CONST $IDB_HIST_LARGE_COLOR = 0x00000009
GLOBAL CONST $STARTF_FORCEOFFFEEDBACK = 0x00000080
GLOBAL CONST $STARTF_FORCEONFEEDBACK = 0x00000040
GLOBAL CONST $STARTF_RUNFULLSCREEN = 0x00000020
GLOBAL CONST $STARTF_USECOUNTCHARS = 0x00000008
GLOBAL CONST $STARTF_USEFILLATTRIBUTE = 0x00000010
GLOBAL CONST $STARTF_USEHOTKEY = 0x00000200
GLOBAL CONST $STARTF_USEPOSITION = 0x00000004
GLOBAL CONST $STARTF_USESHOWWINDOW = 0x00000001
GLOBAL CONST $STARTF_USESIZE = 0x00000002
GLOBAL CONST $STARTF_USESTDHANDLES = 0x00000100
GLOBAL CONST $CDDS_PREPAINT = 0x00000001
GLOBAL CONST $CDDS_POSTPAINT = 0x00000002
GLOBAL CONST $CDDS_PREERASE = 0x00000003
GLOBAL CONST $CDDS_POSTERASE = 0x00000004
GLOBAL CONST $CDDS_ITEM = 0x00010000
GLOBAL CONST $CDDS_ITEMPREPAINT = 0x00010001
GLOBAL CONST $CDDS_ITEMPOSTPAINT = 0x00010002
GLOBAL CONST $CDDS_ITEMPREERASE = 0x00010003
GLOBAL CONST $CDDS_ITEMPOSTERASE = 0x00010004
GLOBAL CONST $CDDS_SUBITEM = 0x00020000
GLOBAL CONST $CDIS_SELECTED = 0x00000001
GLOBAL CONST $CDIS_GRAYED = 0x00000002
GLOBAL CONST $CDIS_DISABLED = 0x00000004
GLOBAL CONST $CDIS_CHECKED = 0x00000008
GLOBAL CONST $CDIS_FOCUS = 0x00000010
GLOBAL CONST $CDIS_DEFAULT = 0x00000020
GLOBAL CONST $CDIS_HOT = 0x00000040
GLOBAL CONST $CDIS_MARKED = 0x00000080
GLOBAL CONST $CDIS_INDETERMINATE = 0x00000100
GLOBAL CONST $CDIS_SHOWKEYBOARDCUES = 0x00000200
GLOBAL CONST $CDIS_NEARHOT = 0x00000400
GLOBAL CONST $CDIS_OTHERSIDEHOT = 0x00000800
GLOBAL CONST $CDIS_DROPHILITED = 0x00001000
GLOBAL CONST $CDRF_DODEFAULT = 0x00000000
GLOBAL CONST $CDRF_NEWFONT = 0x00000002
GLOBAL CONST $CDRF_SKIPDEFAULT = 0x00000004
GLOBAL CONST $CDRF_NOTIFYPOSTPAINT = 0x00000010
GLOBAL CONST $CDRF_NOTIFYITEMDRAW = 0x00000020
GLOBAL CONST $CDRF_NOTIFYSUBITEMDRAW = 0x00000020
GLOBAL CONST $CDRF_NOTIFYPOSTERASE = 0x00000040
GLOBAL CONST $CDRF_DOERASE = 0x00000008
GLOBAL CONST $CDRF_SKIPPOSTPAINT = 0x00000100
GLOBAL CONST $GUI_SS_DEFAULT_GUI = BITOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)
GLOBAL CONST $SS_LEFT = 0x00000000
GLOBAL CONST $SS_CENTER = 0x00000001
GLOBAL CONST $SS_RIGHT = 0x00000002
GLOBAL CONST $SS_ICON = 0x00000003
GLOBAL CONST $SS_BLACKRECT = 0x00000004
GLOBAL CONST $SS_GRAYRECT = 0x00000005
GLOBAL CONST $SS_WHITERECT = 0x00000006
GLOBAL CONST $SS_BLACKFRAME = 0x00000007
GLOBAL CONST $SS_GRAYFRAME = 0x00000008
GLOBAL CONST $SS_WHITEFRAME = 0x00000009
GLOBAL CONST $SS_SIMPLE = 0x0000000B
GLOBAL CONST $SS_LEFTNOWORDWRAP = 0x0000000C
GLOBAL CONST $SS_BITMAP = 0x0000000E
GLOBAL CONST $SS_ETCHEDHORZ = 0x00000010
GLOBAL CONST $SS_ETCHEDVERT = 0x00000011
GLOBAL CONST $SS_ETCHEDFRAME = 0x00000012
GLOBAL CONST $SS_NOPREFIX = 0x00000080
GLOBAL CONST $SS_NOTIFY = 0x00000100
GLOBAL CONST $SS_CENTERIMAGE = 0x00000200
GLOBAL CONST $SS_RIGHTJUST = 0x00000400
GLOBAL CONST $SS_SUNKEN = 0x00001000
GLOBAL CONST $GUI_SS_DEFAULT_LABEL = 0x00000000
GLOBAL CONST $GUI_SS_DEFAULT_GRAPHIC = 0x00000000
GLOBAL CONST $GUI_SS_DEFAULT_ICON = $SS_NOTIFY
GLOBAL CONST $GUI_SS_DEFAULT_PIC = $SS_NOTIFY
GLOBAL CONST $SBARS_SIZEGRIP = 0x00000100
GLOBAL CONST $SBT_TOOLTIPS = 0x00000800
GLOBAL CONST $SBARS_TOOLTIPS = 0x00000800
GLOBAL CONST $SBT_SUNKEN = 0x00000000
GLOBAL CONST $SBT_NOBORDERS = 0x00000100
GLOBAL CONST $SBT_POPOUT = 0x00000200
GLOBAL CONST $SBT_RTLREADING = 0x00000400
GLOBAL CONST $SBT_NOTABPARSING = 0x00000800
GLOBAL CONST $SBT_OWNERDRAW = 0x00001000
GLOBAL CONST $__STATUSBARCONSTANT_WM_USER = 0x00000400
GLOBAL CONST $SB_GETBORDERS = ($__STATUSBARCONSTANT_WM_USER + 0x00000007)
GLOBAL CONST $SB_GETICON = ($__STATUSBARCONSTANT_WM_USER + 0x00000014)
GLOBAL CONST $SB_GETPARTS = ($__STATUSBARCONSTANT_WM_USER + 0x00000006)
GLOBAL CONST $SB_GETRECT = ($__STATUSBARCONSTANT_WM_USER + 0x0000000A)
GLOBAL CONST $SB_GETTEXTA = ($__STATUSBARCONSTANT_WM_USER + 0x00000002)
GLOBAL CONST $SB_GETTEXTW = ($__STATUSBARCONSTANT_WM_USER + 0x0000000D)
GLOBAL CONST $SB_GETTEXT = $SB_GETTEXTA
GLOBAL CONST $SB_GETTEXTLENGTHA = ($__STATUSBARCONSTANT_WM_USER + 0x00000003)
GLOBAL CONST $SB_GETTEXTLENGTHW = ($__STATUSBARCONSTANT_WM_USER + 0x0000000C)
GLOBAL CONST $SB_GETTEXTLENGTH = $SB_GETTEXTLENGTHA
GLOBAL CONST $SB_GETTIPTEXTA = ($__STATUSBARCONSTANT_WM_USER + 0x00000012)
GLOBAL CONST $SB_GETTIPTEXTW = ($__STATUSBARCONSTANT_WM_USER + 0x00000013)
GLOBAL CONST $SB_GETUNICODEFORMAT = 0x00002000 + 0x00000006
GLOBAL CONST $SB_ISSIMPLE = ($__STATUSBARCONSTANT_WM_USER + 0x0000000E)
GLOBAL CONST $SB_SETBKCOLOR = 0x00002000 + 0x00000001
GLOBAL CONST $SB_SETICON = ($__STATUSBARCONSTANT_WM_USER + 0x0000000F)
GLOBAL CONST $SB_SETMINHEIGHT = ($__STATUSBARCONSTANT_WM_USER + 0x00000008)
GLOBAL CONST $SB_SETPARTS = ($__STATUSBARCONSTANT_WM_USER + 0x00000004)
GLOBAL CONST $SB_SETTEXTA = ($__STATUSBARCONSTANT_WM_USER + 0x00000001)
GLOBAL CONST $SB_SETTEXTW = ($__STATUSBARCONSTANT_WM_USER + 0x0000000B)
GLOBAL CONST $SB_SETTEXT = $SB_SETTEXTA
GLOBAL CONST $SB_SETTIPTEXTA = ($__STATUSBARCONSTANT_WM_USER + 0x00000010)
GLOBAL CONST $SB_SETTIPTEXTW = ($__STATUSBARCONSTANT_WM_USER + 0x00000011)
GLOBAL CONST $SB_SETUNICODEFORMAT = 0x00002000 + 0x00000005
GLOBAL CONST $SB_SIMPLE = ($__STATUSBARCONSTANT_WM_USER + 0x00000009)
GLOBAL CONST $SB_SIMPLEID = 0x000000FF
GLOBAL CONST $SBN_FIRST = -0x00000370
GLOBAL CONST $SBN_SIMPLEMODECHANGE = $SBN_FIRST - 0x00000000
GLOBAL CONST $GMEM_FIXED = 0x00000000
GLOBAL CONST $GMEM_MOVEABLE = 0x00000002
GLOBAL CONST $GMEM_NOCOMPACT = 0x00000010
GLOBAL CONST $GMEM_NODISCARD = 0x00000020
GLOBAL CONST $GMEM_ZEROINIT = 0x00000040
GLOBAL CONST $GMEM_MODIFY = 0x00000080
GLOBAL CONST $GMEM_DISCARDABLE = 0x00000100
GLOBAL CONST $GMEM_NOT_BANKED = 0x00001000
GLOBAL CONST $GMEM_SHARE = 0x00002000
GLOBAL CONST $GMEM_DDESHARE = 0x00002000
GLOBAL CONST $GMEM_NOTIFY = 0x00004000
GLOBAL CONST $GMEM_LOWER = 0x00001000
GLOBAL CONST $GMEM_VALID_FLAGS = 0x00007F72
GLOBAL CONST $GMEM_INVALID_HANDLE = 0x00008000
GLOBAL CONST $GPTR = $GMEM_FIXED + $GMEM_ZEROINIT
GLOBAL CONST $GHND = $GMEM_MOVEABLE + $GMEM_ZEROINIT
GLOBAL CONST $MEM_COMMIT = 0x00001000
GLOBAL CONST $MEM_RESERVE = 0x00002000
GLOBAL CONST $MEM_TOP_DOWN = 0x00100000
GLOBAL CONST $MEM_SHARED = 0x08000000
GLOBAL CONST $PAGE_NOACCESS = 0x00000001
GLOBAL CONST $PAGE_READONLY = 0x00000002
GLOBAL CONST $PAGE_READWRITE = 0x00000004
GLOBAL CONST $PAGE_EXECUTE = 0x00000010
GLOBAL CONST $PAGE_EXECUTE_READ = 0x00000020
GLOBAL CONST $PAGE_EXECUTE_READWRITE = 0x00000040
GLOBAL CONST $PAGE_GUARD = 0x00000100
GLOBAL CONST $PAGE_NOCACHE = 0x00000200
GLOBAL CONST $MEM_DECOMMIT = 0x00004000
GLOBAL CONST $MEM_RELEASE = 0x00008000
GLOBAL CONST $TAGPOINT = "long X;long Y"
GLOBAL CONST $TAGRECT = "long Left;long Top;long Right;long Bottom"
GLOBAL CONST $TAGSIZE = "long X;long Y"
GLOBAL CONST $TAGMARGINS = "int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight"
GLOBAL CONST $TAGFILETIME = "dword Lo;dword Hi"
GLOBAL CONST $TAGSYSTEMTIME = "word Year;word Month;word Dow;word Day;word Hour;word Minute;word Second;word MSeconds"
GLOBAL CONST $TAGTIME_ZONE_INFORMATION = "long Bias;wchar StdName[32];word StdDate[8];long StdBias;wchar DayName[32];word DayDate[8];long DayBias"
GLOBAL CONST $TAGNMHDR = "hwnd hWndFrom;uint_ptr IDFrom;INT Code"
GLOBAL CONST $TAGCOMBOBOXEXITEM = "uint Mask;int_ptr Item;ptr Text;int TextMax;int Image;int SelectedImage;int OverlayImage;"& "int Indent;lparam Param"
GLOBAL CONST $TAGNMCBEDRAGBEGIN = $TAGNMHDR & ";int ItemID;ptr szText"
GLOBAL CONST $TAGNMCBEENDEDIT = $TAGNMHDR & ";bool fChanged;int NewSelection;ptr szText;int Why"
GLOBAL CONST $TAGNMCOMBOBOXEX = $TAGNMHDR & ";uint Mask;int_ptr Item;ptr Text;int TextMax;int Image;"& "int SelectedImage;int OverlayImage;int Indent;lparam Param"
GLOBAL CONST $TAGDTPRANGE = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;"& "word MinSecond;word MinMSecond;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;"& "word MaxMinute;word MaxSecond;word MaxMSecond;bool MinValid;bool MaxValid"
GLOBAL CONST $TAGNMDATETIMECHANGE = $TAGNMHDR & ";dword Flag;"& $TAGSYSTEMTIME
GLOBAL CONST $TAGNMDATETIMEFORMAT = $TAGNMHDR & ";ptr Format;"& $TAGSYSTEMTIME & ";ptr pDisplay;wchar Display[64]"
GLOBAL CONST $TAGNMDATETIMEFORMATQUERY = $TAGNMHDR & ";ptr Format;long SizeX;long SizeY"
GLOBAL CONST $TAGNMDATETIMEKEYDOWN = $TAGNMHDR & ";int VirtKey;ptr Format;"& $TAGSYSTEMTIME
GLOBAL CONST $TAGNMDATETIMESTRING = $TAGNMHDR & ";ptr UserString;"& $TAGSYSTEMTIME & ";dword Flags"
GLOBAL CONST $TAGEVENTLOGRECORD = "dword Length;dword Reserved;dword RecordNumber;dword TimeGenerated;dword TimeWritten;dword EventID;"& "word EventType;word NumStrings;word EventCategory;word ReservedFlags;dword ClosingRecordNumber;dword StringOffset;"& "dword UserSidLength;dword UserSidOffset;dword DataLength;dword DataOffset"
GLOBAL CONST $TAGGDIPBITMAPDATA = "uint Width;uint Height;int Stride;int Format;ptr Scan0;uint_ptr Reserved"
GLOBAL CONST $TAGGDIPENCODERPARAM = "byte GUID[16];dword Count;dword Type;ptr Values"
GLOBAL CONST $TAGGDIPENCODERPARAMS = "dword Count;byte Params[0]"
GLOBAL CONST $TAGGDIPRECTF = "float X;float Y;float Width;float Height"
GLOBAL CONST $TAGGDIPSTARTUPINPUT = "uint Version;ptr Callback;bool NoThread;bool NoCodecs"
GLOBAL CONST $TAGGDIPSTARTUPOUTPUT = "ptr HookProc;ptr UnhookProc"
GLOBAL CONST $TAGGDIPIMAGECODECINFO = "byte CLSID[16];byte FormatID[16];ptr CodecName;ptr DllName;ptr FormatDesc;ptr FileExt;"& "ptr MimeType;dword Flags;dword Version;dword SigCount;dword SigSize;ptr SigPattern;ptr SigMask"
GLOBAL CONST $TAGGDIPPENCODERPARAMS = "dword Count;byte Params[0]"
GLOBAL CONST $TAGHDITEM = "uint Mask;int XY;ptr Text;handle hBMP;int TextMax;int Fmt;lparam Param;int Image;int Order;uint Type;ptr pFilter;uint State"
GLOBAL CONST $TAGNMHDDISPINFO = $TAGNMHDR & ";int Item;uint Mask;ptr Text;int TextMax;int Image;lparam lParam"
GLOBAL CONST $TAGNMHDFILTERBTNCLICK = $TAGNMHDR & ";int Item;"& $TAGRECT
GLOBAL CONST $TAGNMHEADER = $TAGNMHDR & ";int Item;int Button;ptr pItem"
GLOBAL CONST $TAGGETIPADDRESS = "byte Field4;byte Field3;byte Field2;byte Field1"
GLOBAL CONST $TAGNMIPADDRESS = $TAGNMHDR & ";int Field;int Value"
GLOBAL CONST $TAGLVFINDINFO = "uint Flags;ptr Text;lparam Param;"& $TAGPOINT & ";uint Direction"
GLOBAL CONST $TAGLVHITTESTINFO = $TAGPOINT & ";uint Flags;int Item;int SubItem"
GLOBAL CONST $TAGLVITEM = "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 $TAGNMLISTVIEW = $TAGNMHDR & ";int Item;int SubItem;uint NewState;uint OldState;uint Changed;"& "long ActionX;long ActionY;lparam Param"
GLOBAL CONST $TAGNMLVCUSTOMDRAW = $TAGNMHDR & ";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 $TAGNMLVDISPINFO = $TAGNMHDR & ";"& $TAGLVITEM
GLOBAL CONST $TAGNMLVFINDITEM = $TAGNMHDR & ";"& $TAGLVFINDINFO
GLOBAL CONST $TAGNMLVGETINFOTIP = $TAGNMHDR & ";dword Flags;ptr Text;int TextMax;int Item;int SubItem;lparam lParam"
GLOBAL CONST $TAGNMITEMACTIVATE = $TAGNMHDR & ";int Index;int SubItem;uint NewState;uint OldState;uint Changed;"& $TAGPOINT & ";lparam lParam;uint KeyFlags"
GLOBAL CONST $TAGNMLVKEYDOWN = $TAGNMHDR & ";align 1;word VKey;uint Flags"
GLOBAL CONST $TAGNMLVSCROLL = $TAGNMHDR & ";int DX;int DY"
GLOBAL CONST $TAGMCHITTESTINFO = "uint Size;"& $TAGPOINT & ";uint Hit;"& $TAGSYSTEMTIME
GLOBAL CONST $TAGMCMONTHRANGE = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;"& "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;"& "word MaxMSeconds;short Span"
GLOBAL CONST $TAGMCRANGE = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;"& "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;"& "word MaxMSeconds;short MinSet;short MaxSet"
GLOBAL CONST $TAGMCSELRANGE = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;"& "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;"& "word MaxMSeconds"
GLOBAL CONST $TAGNMDAYSTATE = $TAGNMHDR & ";"& $TAGSYSTEMTIME & ";int DayState;ptr pDayState"
GLOBAL CONST $TAGNMSELCHANGE = $TAGNMHDR & ";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 $TAGNMOBJECTNOTIFY = $TAGNMHDR & ";int Item;ptr piid;ptr pObject;long Result"
GLOBAL CONST $TAGNMTCKEYDOWN = $TAGNMHDR & ";word VKey;uint Flags"
GLOBAL CONST $TAGTVITEM = "uint Mask;handle hItem;uint State;uint StateMask;ptr Text;int TextMax;int Image;int SelectedImage;"& "int Children;lparam Param"
GLOBAL CONST $TAGTVITEMEX = $TAGTVITEM & ";int Integral"
GLOBAL CONST $TAGNMTREEVIEW = $TAGNMHDR & ";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 $TAGNMTVCUSTOMDRAW = $TAGNMHDR & ";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 $TAGNMTVDISPINFO = $TAGNMHDR & ";"& $TAGTVITEM
GLOBAL CONST $TAGNMTVGETINFOTIP = $TAGNMHDR & ";ptr Text;int TextMax;handle hItem;lparam lParam"
GLOBAL CONST $TAGTVHITTESTINFO = $TAGPOINT & ";uint Flags;handle Item"
GLOBAL CONST $TAGNMTVKEYDOWN = $TAGNMHDR & ";word VKey;uint Flags"
GLOBAL CONST $TAGNMMOUSE = $TAGNMHDR & ";dword_ptr ItemSpec;dword_ptr ItemData;"& $TAGPOINT & ";lparam HitInfo"
GLOBAL CONST $TAGTOKEN_PRIVILEGES = "dword Count;int64 LUID;dword Attributes"
GLOBAL CONST $TAGIMAGEINFO = "handle hBitmap;handle hMask;int Unused1;int Unused2;"& $TAGRECT
GLOBAL CONST $TAGMENUINFO = "dword Size;INT Mask;dword Style;uint YMax;handle hBack;dword ContextHelpID;ulong_ptr MenuData"
GLOBAL CONST $TAGMENUITEMINFO = "uint Size;uint Mask;uint Type;uint State;uint ID;handle SubMenu;handle BmpChecked;handle BmpUnchecked;"& "ulong_ptr ItemData;ptr TypeData;uint CCH;handle BmpItem"
GLOBAL CONST $TAGREBARBANDINFO = "uint cbSize;uint fMask;uint fStyle;dword clrFore;dword clrBack;ptr lpText;uint cch;"& "int iImage;hwnd hwndChild;uint cxMinChild;uint cyMinChild;uint cx;handle hbmBack;uint wID;uint cyChild;uint cyMaxChild;"& "uint cyIntegral;uint cxIdeal;lparam lParam;uint cxHeader"
GLOBAL CONST $TAGNMREBARAUTOBREAK = $TAGNMHDR & ";uint uBand;uint wID;lparam lParam;uint uMsg;uint fStyleCurrent;bool fAutoBreak"
GLOBAL CONST $TAGNMRBAUTOSIZE = $TAGNMHDR & ";bool fChanged;long TargetLeft;long TargetTop;long TargetRight;long TargetBottom;"& "long ActualLeft;long ActualTop;long ActualRight;long ActualBottom"
GLOBAL CONST $TAGNMREBAR = $TAGNMHDR & ";dword dwMask;uint uBand;uint fStyle;uint wID;laram lParam"
GLOBAL CONST $TAGNMREBARCHEVRON = $TAGNMHDR & ";uint uBand;uint wID;lparam lParam;"& $TAGRECT & ";lparam lParamNM"
GLOBAL CONST $TAGNMREBARCHILDSIZE = $TAGNMHDR & ";uint uBand;uint wID;long CLeft;long CTop;long CRight;long CBottom;"& "long BLeft;long BTop;long BRight;long BBottom"
GLOBAL CONST $TAGCOLORSCHEME = "dword Size;dword BtnHighlight;dword BtnShadow"
GLOBAL CONST $TAGNMTOOLBAR = $TAGNMHDR & ";int iItem;"& "int iBitmap;int idCommand;byte fsState;byte fsStyle;align;dword_ptr dwData;int_ptr iString"& ";int cchText;ptr pszText;"& $TAGRECT
GLOBAL CONST $TAGNMTBHOTITEM = $TAGNMHDR & ";int idOld;int idNew;dword dwFlags"
GLOBAL CONST $TAGTBBUTTON = "int Bitmap;int Command;byte State;byte Style;align;dword_ptr Param;int_ptr String"
GLOBAL CONST $TAGTBBUTTONINFO = "uint Size;dword Mask;int Command;int Image;byte State;byte Style;word CX;dword_ptr Param;ptr Text;int TextMax"
GLOBAL CONST $TAGNETRESOURCE = "dword Scope;dword Type;dword DisplayType;dword Usage;ptr LocalName;ptr RemoteName;ptr Comment;ptr Provider"
GLOBAL CONST $TAGOVERLAPPED = "ulong_ptr Internal;ulong_ptr InternalHigh;dword Offset;dword OffsetHigh;handle hEvent"
GLOBAL CONST $TAGOPENFILENAME = "dword StructSize;hwnd hwndOwner;handle hInstance;ptr lpstrFilter;ptr lpstrCustomFilter;"& "dword nMaxCustFilter;dword nFilterIndex;ptr lpstrFile;dword nMaxFile;ptr lpstrFileTitle;dword nMaxFileTitle;"& "ptr lpstrInitialDir;ptr lpstrTitle;dword Flags;word nFileOffset;word nFileExtension;ptr lpstrDefExt;lparam lCustData;"& "ptr lpfnHook;ptr lpTemplateName;ptr pvReserved;dword dwReserved;dword FlagsEx"
GLOBAL CONST $TAGBITMAPINFO = "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 $TAGBLENDFUNCTION = "byte Op;byte Flags;byte Alpha;byte Format"
GLOBAL CONST $TAGGUID = "dword Data1;word Data2;word Data3;byte Data4[8]"
GLOBAL CONST $TAGWINDOWPLACEMENT = "uint length; uint flags;uint showCmd;long ptMinPosition[2];long ptMaxPosition[2];long rcNormalPosition[4]"
GLOBAL CONST $TAGWINDOWPOS = "hwnd hWnd;hwnd InsertAfter;int X;int Y;int CX;int CY;uint Flags"
GLOBAL CONST $TAGSCROLLINFO = "uint cbSize;uint fMask;int  nMin;int  nMax;uint nPage;int  nPos;int  nTrackPos"
GLOBAL CONST $TAGSCROLLBARINFO = "dword cbSize;"& $TAGRECT & ";int dxyLineButton;int xyThumbTop;"& "int xyThumbBottom;int reserved;dword rgstate[6]"
GLOBAL CONST $TAGLOGFONT = "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 $TAGKBDLLHOOKSTRUCT = "dword vkCode;dword scanCode;dword flags;dword time;ulong_ptr dwExtraInfo"
GLOBAL CONST $TAGPROCESS_INFORMATION = "handle hProcess;handle hThread;dword ProcessID;dword ThreadID"
GLOBAL CONST $TAGSTARTUPINFO = "dword Size;ptr Reserved1;ptr Desktop;ptr Title;dword X;dword Y;dword XSize;dword YSize;dword XCountChars;"& "dword YCountChars;dword FillAttribute;dword Flags;word ShowWindow;word Reserved2;ptr Reserved3;handle StdInput;"& "handle StdOutput;handle StdError"
GLOBAL CONST $TAGSECURITY_ATTRIBUTES = "dword Length;ptr Descriptor;bool InheritHandle"
GLOBAL CONST $TAGWIN32_FIND_DATA = "dword dwFileAttributes; dword ftCreationTime[2]; dword ftLastAccessTime[2]; dword ftLastWriteTime[2]; dword nFileSizeHigh; dword nFileSizeLow; dword dwReserved0; dword dwReserved1; wchar cFileName[260]; wchar cAlternateFileName[14]"
GLOBAL CONST $PROCESS_TERMINATE = 0x00000001
GLOBAL CONST $PROCESS_CREATE_THREAD = 0x00000002
GLOBAL CONST $PROCESS_SET_SESSIONID = 0x00000004
GLOBAL CONST $PROCESS_VM_OPERATION = 0x00000008
GLOBAL CONST $PROCESS_VM_READ = 0x00000010
GLOBAL CONST $PROCESS_VM_WRITE = 0x00000020
GLOBAL CONST $PROCESS_DUP_HANDLE = 0x00000040
GLOBAL CONST $PROCESS_CREATE_PROCESS = 0x00000080
GLOBAL CONST $PROCESS_SET_QUOTA = 0x00000100
GLOBAL CONST $PROCESS_SET_INFORMATION = 0x00000200
GLOBAL CONST $PROCESS_QUERY_INFORMATION = 0x00000400
GLOBAL CONST $PROCESS_SUSPEND_RESUME = 0x00000800
GLOBAL CONST $PROCESS_ALL_ACCESS = 0x001F0FFF
GLOBAL CONST $ERROR_NO_TOKEN = 0x000003F0
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 = 0x00000001
GLOBAL CONST $SE_PRIVILEGE_ENABLED = 0x00000002
GLOBAL CONST $SE_PRIVILEGE_REMOVED = 0x00000004
GLOBAL CONST $SE_PRIVILEGE_USED_FOR_ACCESS = 0x80000000
GLOBAL CONST $TOKENUSER = 0x00000001
GLOBAL CONST $TOKENGROUPS = 0x00000002
GLOBAL CONST $TOKENPRIVILEGES = 0x00000003
GLOBAL CONST $TOKENOWNER = 0x00000004
GLOBAL CONST $TOKENPRIMARYGROUP = 0x00000005
GLOBAL CONST $TOKENDEFAULTDACL = 0x00000006
GLOBAL CONST $TOKENSOURCE = 0x00000007
GLOBAL CONST $TOKENTYPE = 0x00000008
GLOBAL CONST $TOKENIMPERSONATIONLEVEL = 0x00000009
GLOBAL CONST $TOKENSTATISTICS = 0x0000000A
GLOBAL CONST $TOKENRESTRICTEDSIDS = 0x0000000B
GLOBAL CONST $TOKENSESSIONID = 0x0000000C
GLOBAL CONST $TOKENGROUPSANDPRIVILEGES = 0x0000000D
GLOBAL CONST $TOKENSESSIONREFERENCE = 0x0000000E
GLOBAL CONST $TOKENSANDBOXINERT = 0x0000000F
GLOBAL CONST $TOKENAUDITPOLICY = 0x00000010
GLOBAL CONST $TOKENORIGIN = 0x00000011
GLOBAL CONST $TOKENELEVATIONTYPE = 0x00000012
GLOBAL CONST $TOKENLINKEDTOKEN = 0x00000013
GLOBAL CONST $TOKENELEVATION = 0x00000014
GLOBAL CONST $TOKENHASRESTRICTIONS = 0x00000015
GLOBAL CONST $TOKENACCESSINFORMATION = 0x00000016
GLOBAL CONST $TOKENVIRTUALIZATIONALLOWED = 0x00000017
GLOBAL CONST $TOKENVIRTUALIZATIONENABLED = 0x00000018
GLOBAL CONST $TOKENINTEGRITYLEVEL = 0x00000019
GLOBAL CONST $TOKENUIACCESS = 0x0000001A
GLOBAL CONST $TOKENMANDATORYPOLICY = 0x0000001B
GLOBAL CONST $TOKENLOGONSID = 0x0000001C
GLOBAL CONST $TOKEN_ASSIGN_PRIMARY = 0x00000001
GLOBAL CONST $TOKEN_DUPLICATE = 0x00000002
GLOBAL CONST $TOKEN_IMPERSONATE = 0x00000004
GLOBAL CONST $TOKEN_QUERY = 0x00000008
GLOBAL CONST $TOKEN_QUERY_SOURCE = 0x00000010
GLOBAL CONST $TOKEN_ADJUST_PRIVILEGES = 0x00000020
GLOBAL CONST $TOKEN_ADJUST_GROUPS = 0x00000040
GLOBAL CONST $TOKEN_ADJUST_DEFAULT = 0x00000080
GLOBAL CONST $TOKEN_ADJUST_SESSIONID = 0x00000100
FUNC _WINAPI_GETLASTERROR($CURERR = @ERROR, $CUREXT = @EXTENDED)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "dword", "GetLastError")
RETURN SETERROR($CURERR, $CUREXT, $ARESULT [0x00000000 ])
ENDFUNC
FUNC _WINAPI_SETLASTERROR($IERRCODE, $CURERR = @ERROR, $CUREXT = @EXTENDED)
DLLCALL("kernel32.dll", "none", "SetLastError", "dword", $IERRCODE)
RETURN SETERROR($CURERR, $CUREXT)
ENDFUNC
FUNC _SECURITY__ADJUSTTOKENPRIVILEGES($HTOKEN, $FDISABLEALL, $PNEWSTATE, $IBUFFERLEN, $PPREVSTATE = 0x00000000, $PREQUIRED = 0x00000000)
LOCAL $ARESULT = DLLCALL("advapi32.dll", "bool", "AdjustTokenPrivileges", "handle", $HTOKEN, "bool", $FDISABLEALL, "ptr", $PNEWSTATE, "dword", $IBUFFERLEN, "ptr", $PPREVSTATE, "ptr", $PREQUIRED)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _SECURITY__GETACCOUNTSID($SACCOUNT, $SSYSTEM = "")
LOCAL $AACCT = _SECURITY__LOOKUPACCOUNTNAME($SACCOUNT, $SSYSTEM)
IF @ERROR THEN RETURN SETERROR(@ERROR, 0x00000000, 0x00000000)
RETURN _SECURITY__STRINGSIDTOSID($AACCT [0x00000000 ])
ENDFUNC
FUNC _SECURITY__GETLENGTHSID($PSID)
IF NOT _SECURITY__ISVALIDSID($PSID) THEN RETURN SETERROR(- 0x00000001, 0x00000000, 0x00000000)
LOCAL $ARESULT = DLLCALL("advapi32.dll", "dword", "GetLengthSid", "ptr", $PSID)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _SECURITY__GETTOKENINFORMATION($HTOKEN, $ICLASS)
LOCAL $ARESULT = DLLCALL("advapi32.dll", "bool", "GetTokenInformation", "handle", $HTOKEN, "int", $ICLASS, "ptr", 0x00000000, "dword", 0x00000000, "dword*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
IF NOT $ARESULT [0x00000000 ]THEN RETURN 0x00000000
LOCAL $TBUFFER = DLLSTRUCTCREATE("byte["& $ARESULT [0x00000005 ]& "]")
LOCAL $PBUFFER = DLLSTRUCTGETPTR($TBUFFER)
$ARESULT = DLLCALL("advapi32.dll", "bool", "GetTokenInformation", "handle", $HTOKEN, "int", $ICLASS, "ptr", $PBUFFER, "dword", $ARESULT [0x00000005 ], "dword*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
IF NOT $ARESULT [0x00000000 ]THEN RETURN 0x00000000
RETURN $TBUFFER
ENDFUNC
FUNC _SECURITY__IMPERSONATESELF($ILEVEL = 0x00000002)
LOCAL $ARESULT = DLLCALL("advapi32.dll", "bool", "ImpersonateSelf", "int", $ILEVEL)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _SECURITY__ISVALIDSID($PSID)
LOCAL $ARESULT = DLLCALL("advapi32.dll", "bool", "IsValidSid", "ptr", $PSID)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _SECURITY__LOOKUPACCOUNTNAME($SACCOUNT, $SSYSTEM = "")
LOCAL $TDATA = DLLSTRUCTCREATE("byte SID[256]")
LOCAL $PSID = DLLSTRUCTGETPTR($TDATA, "SID")
LOCAL $ARESULT = DLLCALL("advapi32.dll", "bool", "LookupAccountNameW", "wstr", $SSYSTEM, "wstr", $SACCOUNT, "ptr", $PSID, "dword*", 0x00000100, "wstr", "", "dword*", 0x00000100, "int*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
IF NOT $ARESULT [0x00000000 ]THEN RETURN 0x00000000
LOCAL $AACCT [0x00000003 ]
$AACCT [0x00000000 ]= _SECURITY__SIDTOSTRINGSID($PSID)
$AACCT [0x00000001 ]= $ARESULT [0x00000005 ]
$AACCT [0x00000002 ]= $ARESULT [0x00000007 ]
RETURN $AACCT
ENDFUNC
FUNC _SECURITY__LOOKUPACCOUNTSID($VSID)
LOCAL $PSID, $AACCT [0x00000003 ]
IF ISSTRING($VSID) THEN
LOCAL $TSID = _SECURITY__STRINGSIDTOSID($VSID)
$PSID = DLLSTRUCTGETPTR($TSID)
ELSE
$PSID = $VSID
ENDIF
IF NOT _SECURITY__ISVALIDSID($PSID) THEN RETURN SETERROR(- 0x00000001, 0x00000000, 0x00000000)
LOCAL $ARESULT = DLLCALL("advapi32.dll", "bool", "LookupAccountSidW", "ptr", 0x00000000, "ptr", $PSID, "wstr", "", "dword*", 0x00000100, "wstr", "", "dword*", 0x00000100, "int*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
IF NOT $ARESULT [0x00000000 ]THEN RETURN 0x00000000
LOCAL $AACCT [0x00000003 ]
$AACCT [0x00000000 ]= $ARESULT [0x00000003 ]
$AACCT [0x00000001 ]= $ARESULT [0x00000005 ]
$AACCT [0x00000002 ]= $ARESULT [0x00000007 ]
RETURN $AACCT
ENDFUNC
FUNC _SECURITY__LOOKUPPRIVILEGEVALUE($SSYSTEM, $SNAME)
LOCAL $ARESULT = DLLCALL("advapi32.dll", "int", "LookupPrivilegeValueW", "wstr", $SSYSTEM, "wstr", $SNAME, "int64*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN SETERROR(0x00000000, $ARESULT [0x00000000 ], $ARESULT [0x00000003 ])
ENDFUNC
FUNC _SECURITY__OPENPROCESSTOKEN($HPROCESS, $IACCESS)
LOCAL $ARESULT = DLLCALL("advapi32.dll", "int", "OpenProcessToken", "handle", $HPROCESS, "dword", $IACCESS, "ptr", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN SETERROR(0x00000000, $ARESULT [0x00000000 ], $ARESULT [0x00000003 ])
ENDFUNC
FUNC _SECURITY__OPENTHREADTOKEN($IACCESS, $HTHREAD = 0x00000000, $FOPENASSELF = FALSE)
IF $HTHREAD = 0x00000000 THEN $HTHREAD = DLLCALL("kernel32.dll", "handle", "GetCurrentThread")
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
LOCAL $ARESULT = DLLCALL("advapi32.dll", "bool", "OpenThreadToken", "handle", $HTHREAD [0x00000000 ], "dword", $IACCESS, "int", $FOPENASSELF, "ptr*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN SETERROR(0x00000000, $ARESULT [0x00000000 ], $ARESULT [0x00000004 ])
ENDFUNC
FUNC _SECURITY__OPENTHREADTOKENEX($IACCESS, $HTHREAD = 0x00000000, $FOPENASSELF = FALSE)
LOCAL $HTOKEN = _SECURITY__OPENTHREADTOKEN($IACCESS, $HTHREAD, $FOPENASSELF)
IF $HTOKEN = 0x00000000 THEN
IF _WINAPI_GETLASTERROR() <> $ERROR_NO_TOKEN THEN RETURN SETERROR(- 0x00000003, _WINAPI_GETLASTERROR(), 0x00000000)
IF NOT _SECURITY__IMPERSONATESELF() THEN RETURN SETERROR(- 0x00000001, _WINAPI_GETLASTERROR(), 0x00000000)
$HTOKEN = _SECURITY__OPENTHREADTOKEN($IACCESS, $HTHREAD, $FOPENASSELF)
IF $HTOKEN = 0x00000000 THEN RETURN SETERROR(- 0x00000002, _WINAPI_GETLASTERROR(), 0x00000000)
ENDIF
RETURN $HTOKEN
ENDFUNC
FUNC _SECURITY__SETPRIVILEGE($HTOKEN, $SPRIVILEGE, $FENABLE)
LOCAL $ILUID = _SECURITY__LOOKUPPRIVILEGEVALUE("", $SPRIVILEGE)
IF $ILUID = 0x00000000 THEN RETURN SETERROR(- 0x00000001, 0x00000000, FALSE)
LOCAL $TCURRSTATE = DLLSTRUCTCREATE($TAGTOKEN_PRIVILEGES)
LOCAL $PCURRSTATE = DLLSTRUCTGETPTR($TCURRSTATE)
LOCAL $ICURRSTATE = DLLSTRUCTGETSIZE($TCURRSTATE)
LOCAL $TPREVSTATE = DLLSTRUCTCREATE($TAGTOKEN_PRIVILEGES)
LOCAL $PPREVSTATE = DLLSTRUCTGETPTR($TPREVSTATE)
LOCAL $IPREVSTATE = DLLSTRUCTGETSIZE($TPREVSTATE)
LOCAL $TREQUIRED = DLLSTRUCTCREATE("int Data")
LOCAL $PREQUIRED = DLLSTRUCTGETPTR($TREQUIRED)
DLLSTRUCTSETDATA($TCURRSTATE, "Count", 0x00000001)
DLLSTRUCTSETDATA($TCURRSTATE, "LUID", $ILUID)
IF NOT _SECURITY__ADJUSTTOKENPRIVILEGES($HTOKEN, FALSE, $PCURRSTATE, $ICURRSTATE, $PPREVSTATE, $PREQUIRED) THEN RETURN SETERROR(- 0x00000002, @ERROR, FALSE)
DLLSTRUCTSETDATA($TPREVSTATE, "Count", 0x00000001)
DLLSTRUCTSETDATA($TPREVSTATE, "LUID", $ILUID)
LOCAL $IATTRIBUTES = DLLSTRUCTGETDATA($TPREVSTATE, "Attributes")
IF $FENABLE THEN
$IATTRIBUTES = BITOR($IATTRIBUTES, $SE_PRIVILEGE_ENABLED)
ELSE
$IATTRIBUTES = BITAND($IATTRIBUTES, BITNOT($SE_PRIVILEGE_ENABLED))
ENDIF
DLLSTRUCTSETDATA($TPREVSTATE, "Attributes", $IATTRIBUTES)
IF NOT _SECURITY__ADJUSTTOKENPRIVILEGES($HTOKEN, FALSE, $PPREVSTATE, $IPREVSTATE, $PCURRSTATE, $PREQUIRED) THEN RETURN SETERROR(- 0x00000003, @ERROR, FALSE)
RETURN TRUE
ENDFUNC
FUNC _SECURITY__SIDTOSTRINGSID($PSID)
IF NOT _SECURITY__ISVALIDSID($PSID) THEN RETURN SETERROR(- 0x00000001, 0x00000000, "")
LOCAL $ARESULT = DLLCALL("advapi32.dll", "int", "ConvertSidToStringSidW", "ptr", $PSID, "ptr*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, "")
IF NOT $ARESULT [0x00000000 ]THEN RETURN ""
LOCAL $TBUFFER = DLLSTRUCTCREATE("wchar Text[256]", $ARESULT [0x00000002 ])
LOCAL $SSID = DLLSTRUCTGETDATA($TBUFFER, "Text")
DLLCALL("Kernel32.dll", "ptr", "LocalFree", "ptr", $ARESULT [0x00000002 ])
RETURN $SSID
ENDFUNC
FUNC _SECURITY__SIDTYPESTR($ITYPE)
SWITCH $ITYPE
CASE 0x00000001
RETURN "User"
CASE 0x00000002
RETURN "Group"
CASE 0x00000003
RETURN "Domain"
CASE 0x00000004
RETURN "Alias"
CASE 0x00000005
RETURN "Well Known Group"
CASE 0x00000006
RETURN "Deleted Account"
CASE 0x00000007
RETURN "Invalid"
CASE 0x00000008
RETURN "Invalid"
CASE 0x00000009
RETURN "Computer"
CASE ELSE
RETURN "Unknown SID Type"
ENDSWITCH
ENDFUNC
FUNC _SECURITY__STRINGSIDTOSID($SSID)
LOCAL $ARESULT = DLLCALL("advapi32.dll", "bool", "ConvertStringSidToSidW", "wstr", $SSID, "ptr*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
IF NOT $ARESULT [0x00000000 ]THEN RETURN 0x00000000
LOCAL $ISIZE = _SECURITY__GETLENGTHSID($ARESULT [0x00000002 ])
LOCAL $TBUFFER = DLLSTRUCTCREATE("byte Data["& $ISIZE & "]", $ARESULT [0x00000002 ])
LOCAL $TSID = DLLSTRUCTCREATE("byte Data["& $ISIZE & "]")
DLLSTRUCTSETDATA($TSID, "Data", DLLSTRUCTGETDATA($TBUFFER, "Data"))
DLLCALL("kernel32.dll", "ptr", "LocalFree", "ptr", $ARESULT [0x00000002 ])
RETURN $TSID
ENDFUNC
GLOBAL CONST $TAGMEMMAP = "handle hProc;ulong_ptr Size;ptr Mem"
FUNC _MEMFREE(BYREF $TMEMMAP)
LOCAL $PMEMORY = DLLSTRUCTGETDATA($TMEMMAP, "Mem")
LOCAL $HPROCESS = DLLSTRUCTGETDATA($TMEMMAP, "hProc")
LOCAL $BRESULT = _MEMVIRTUALFREEEX($HPROCESS, $PMEMORY, 0x00000000, $MEM_RELEASE)
DLLCALL("kernel32.dll", "bool", "CloseHandle", "handle", $HPROCESS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $BRESULT
ENDFUNC
FUNC _MEMGLOBALALLOC($IBYTES, $IFLAGS = 0x00000000)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "handle", "GlobalAlloc", "uint", $IFLAGS, "ulong_ptr", $IBYTES)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _MEMGLOBALFREE($HMEM)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "ptr", "GlobalFree", "handle", $HMEM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _MEMGLOBALLOCK($HMEM)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "ptr", "GlobalLock", "handle", $HMEM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _MEMGLOBALSIZE($HMEM)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "ulong_ptr", "GlobalSize", "handle", $HMEM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _MEMGLOBALUNLOCK($HMEM)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "GlobalUnlock", "handle", $HMEM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _MEMINIT($HWND, $ISIZE, BYREF $TMEMMAP)
LOCAL $ARESULT = DLLCALL("User32.dll", "dword", "GetWindowThreadProcessId", "hwnd", $HWND, "dword*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
LOCAL $IPROCESSID = $ARESULT [0x00000002 ]
IF $IPROCESSID = 0x00000000 THEN RETURN SETERROR(0x00000001, 0x00000000, 0x00000000)
LOCAL $IACCESS = BITOR($PROCESS_VM_OPERATION, $PROCESS_VM_READ, $PROCESS_VM_WRITE)
LOCAL $HPROCESS = __MEM_OPENPROCESS($IACCESS, FALSE, $IPROCESSID, TRUE)
LOCAL $IALLOC = BITOR($MEM_RESERVE, $MEM_COMMIT)
LOCAL $PMEMORY = _MEMVIRTUALALLOCEX($HPROCESS, 0x00000000, $ISIZE, $IALLOC, $PAGE_READWRITE)
IF $PMEMORY = 0x00000000 THEN RETURN SETERROR(0x00000002, 0x00000000, 0x00000000)
$TMEMMAP = DLLSTRUCTCREATE($TAGMEMMAP)
DLLSTRUCTSETDATA($TMEMMAP, "hProc", $HPROCESS)
DLLSTRUCTSETDATA($TMEMMAP, "Size", $ISIZE)
DLLSTRUCTSETDATA($TMEMMAP, "Mem", $PMEMORY)
RETURN $PMEMORY
ENDFUNC
FUNC _MEMMOVEMEMORY($PSOURCE, $PDEST, $ILENGTH)
DLLCALL("kernel32.dll", "none", "RtlMoveMemory", "ptr", $PDEST, "ptr", $PSOURCE, "ulong_ptr", $ILENGTH)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED)
ENDFUNC
FUNC _MEMREAD(BYREF $TMEMMAP, $PSRCE, $PDEST, $ISIZE)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "ReadProcessMemory", "handle", DLLSTRUCTGETDATA($TMEMMAP, "hProc"), "ptr", $PSRCE, "ptr", $PDEST, "ulong_ptr", $ISIZE, "ulong_ptr*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _MEMWRITE(BYREF $TMEMMAP, $PSRCE, $PDEST = 0x00000000, $ISIZE = 0x00000000, $SSRCE = "ptr")
IF $PDEST = 0x00000000 THEN $PDEST = DLLSTRUCTGETDATA($TMEMMAP, "Mem")
IF $ISIZE = 0x00000000 THEN $ISIZE = DLLSTRUCTGETDATA($TMEMMAP, "Size")
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "WriteProcessMemory", "handle", DLLSTRUCTGETDATA($TMEMMAP, "hProc"), "ptr", $PDEST, $SSRCE, $PSRCE, "ulong_ptr", $ISIZE, "ulong_ptr*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _MEMVIRTUALALLOC($PADDRESS, $ISIZE, $IALLOCATION, $IPROTECT)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "ptr", "VirtualAlloc", "ptr", $PADDRESS, "ulong_ptr", $ISIZE, "dword", $IALLOCATION, "dword", $IPROTECT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _MEMVIRTUALALLOCEX($HPROCESS, $PADDRESS, $ISIZE, $IALLOCATION, $IPROTECT)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "ptr", "VirtualAllocEx", "handle", $HPROCESS, "ptr", $PADDRESS, "ulong_ptr", $ISIZE, "dword", $IALLOCATION, "dword", $IPROTECT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _MEMVIRTUALFREE($PADDRESS, $ISIZE, $IFREETYPE)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "VirtualFree", "ptr", $PADDRESS, "ulong_ptr", $ISIZE, "dword", $IFREETYPE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _MEMVIRTUALFREEEX($HPROCESS, $PADDRESS, $ISIZE, $IFREETYPE)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "VirtualFreeEx", "handle", $HPROCESS, "ptr", $PADDRESS, "ulong_ptr", $ISIZE, "dword", $IFREETYPE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC __MEM_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, 0x00000000)
IF $ARESULT [0x00000000 ]THEN RETURN $ARESULT [0x00000000 ]
IF NOT $FDEBUGPRIV THEN RETURN 0x00000000
LOCAL $HTOKEN = _SECURITY__OPENTHREADTOKENEX(BITOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
_SECURITY__SETPRIVILEGE($HTOKEN, "SeDebugPrivilege", TRUE)
LOCAL $IERROR = @ERROR
LOCAL $ILASTERROR = @EXTENDED
LOCAL $IRET = 0x00000000
IF NOT @ERROR THEN
$ARESULT = DLLCALL("kernel32.dll", "handle", "OpenProcess", "dword", $IACCESS, "bool", $FINHERIT, "dword", $IPROCESSID)
$IERROR = @ERROR
$ILASTERROR = @EXTENDED
IF $ARESULT [0x00000000 ]THEN $IRET = $ARESULT [0x00000000 ]
_SECURITY__SETPRIVILEGE($HTOKEN, "SeDebugPrivilege", FALSE)
IF @ERROR THEN
$IERROR = @ERROR
$ILASTERROR = @EXTENDED
ENDIF
ENDIF
DLLCALL("kernel32.dll", "bool", "CloseHandle", "handle", $HTOKEN)
RETURN SETERROR($IERROR, $ILASTERROR, $IRET)
ENDFUNC
GLOBAL CONST $FC_NOOVERWRITE = 0x00000000
GLOBAL CONST $FC_OVERWRITE = 0x00000001
GLOBAL CONST $FT_MODIFIED = 0x00000000
GLOBAL CONST $FT_CREATED = 0x00000001
GLOBAL CONST $FT_ACCESSED = 0x00000002
GLOBAL CONST $FO_READ = 0x00000000
GLOBAL CONST $FO_APPEND = 0x00000001
GLOBAL CONST $FO_OVERWRITE = 0x00000002
GLOBAL CONST $FO_BINARY = 0x00000010
GLOBAL CONST $FO_UNICODE = 0x00000020
GLOBAL CONST $FO_UTF16_LE = 0x00000020
GLOBAL CONST $FO_UTF16_BE = 0x00000040
GLOBAL CONST $FO_UTF8 = 0x00000080
GLOBAL CONST $FO_UTF8_NOBOM = 0x00000100
GLOBAL CONST $EOF = -0x00000001
GLOBAL CONST $FD_FILEMUSTEXIST = 0x00000001
GLOBAL CONST $FD_PATHMUSTEXIST = 0x00000002
GLOBAL CONST $FD_MULTISELECT = 0x00000004
GLOBAL CONST $FD_PROMPTCREATENEW = 0x00000008
GLOBAL CONST $FD_PROMPTOVERWRITE = 0x00000010
GLOBAL CONST $CREATE_NEW = 0x00000001
GLOBAL CONST $CREATE_ALWAYS = 0x00000002
GLOBAL CONST $OPEN_EXISTING = 0x00000003
GLOBAL CONST $OPEN_ALWAYS = 0x00000004
GLOBAL CONST $TRUNCATE_EXISTING = 0x00000005
GLOBAL CONST $INVALID_SET_FILE_POINTER = -0x00000001
GLOBAL CONST $FILE_BEGIN = 0x00000000
GLOBAL CONST $FILE_CURRENT = 0x00000001
GLOBAL CONST $FILE_END = 0x00000002
GLOBAL CONST $FILE_ATTRIBUTE_READONLY = 0x00000001
GLOBAL CONST $FILE_ATTRIBUTE_HIDDEN = 0x00000002
GLOBAL CONST $FILE_ATTRIBUTE_SYSTEM = 0x00000004
GLOBAL CONST $FILE_ATTRIBUTE_DIRECTORY = 0x00000010
GLOBAL CONST $FILE_ATTRIBUTE_ARCHIVE = 0x00000020
GLOBAL CONST $FILE_ATTRIBUTE_DEVICE = 0x00000040
GLOBAL CONST $FILE_ATTRIBUTE_NORMAL = 0x00000080
GLOBAL CONST $FILE_ATTRIBUTE_TEMPORARY = 0x00000100
GLOBAL CONST $FILE_ATTRIBUTE_SPARSE_FILE = 0x00000200
GLOBAL CONST $FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400
GLOBAL CONST $FILE_ATTRIBUTE_COMPRESSED = 0x00000800
GLOBAL CONST $FILE_ATTRIBUTE_OFFLINE = 0x00001000
GLOBAL CONST $FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000
GLOBAL CONST $FILE_ATTRIBUTE_ENCRYPTED = 0x00004000
GLOBAL CONST $FILE_SHARE_READ = 0x00000001
GLOBAL CONST $FILE_SHARE_WRITE = 0x00000002
GLOBAL CONST $FILE_SHARE_DELETE = 0x00000004
GLOBAL CONST $GENERIC_ALL = 0x10000000
GLOBAL CONST $GENERIC_EXECUTE = 0x20000000
GLOBAL CONST $GENERIC_WRITE = 0x40000000
GLOBAL CONST $GENERIC_READ = 0x80000000
FUNC _SENDMESSAGE($HWND, $IMSG, $WPARAM = 0x00000000, $LPARAM = 0x00000000, $IRETURN = 0x00000000, $WPARAMTYPE = "wparam", $LPARAMTYPE = "lparam", $SRETURNTYPE = "lresult")
LOCAL $ARESULT = DLLCALL("user32.dll", $SRETURNTYPE, "SendMessageW", "hwnd", $HWND, "uint", $IMSG, $WPARAMTYPE, $WPARAM, $LPARAMTYPE, $LPARAM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, "")
IF $IRETURN >= 0x00000000 AND $IRETURN <= 0x00000004 THEN RETURN $ARESULT [$IRETURN ]
RETURN $ARESULT
ENDFUNC
FUNC _SENDMESSAGEA($HWND, $IMSG, $WPARAM = 0x00000000, $LPARAM = 0x00000000, $IRETURN = 0x00000000, $WPARAMTYPE = "wparam", $LPARAMTYPE = "lparam", $SRETURNTYPE = "lresult")
LOCAL $ARESULT = DLLCALL("user32.dll", $SRETURNTYPE, "SendMessageA", "hwnd", $HWND, "uint", $IMSG, $WPARAMTYPE, $WPARAM, $LPARAMTYPE, $LPARAM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, "")
IF $IRETURN >= 0x00000000 AND $IRETURN <= 0x00000004 THEN RETURN $ARESULT [$IRETURN ]
RETURN $ARESULT
ENDFUNC
GLOBAL $__GAINPROCESS_WINAPI [0x00000040 ][0x00000002 ]= [[0x00000000, 0x00000000 ]]
GLOBAL $__GAWINLIST_WINAPI [0x00000040 ][0x00000002 ]= [[0x00000000, 0x00000000 ]]
GLOBAL CONST $__WINAPICONSTANT_WM_SETFONT = 0x00000030
GLOBAL CONST $__WINAPICONSTANT_FW_NORMAL = 0x00000190
GLOBAL CONST $__WINAPICONSTANT_DEFAULT_CHARSET = 0x00000001
GLOBAL CONST $__WINAPICONSTANT_OUT_DEFAULT_PRECIS = 0x00000000
GLOBAL CONST $__WINAPICONSTANT_CLIP_DEFAULT_PRECIS = 0x00000000
GLOBAL CONST $__WINAPICONSTANT_DEFAULT_QUALITY = 0x00000000
GLOBAL CONST $__WINAPICONSTANT_FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100
GLOBAL CONST $__WINAPICONSTANT_FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000
GLOBAL CONST $__WINAPICONSTANT_LOGPIXELSX = 0x00000058
GLOBAL CONST $__WINAPICONSTANT_LOGPIXELSY = 0x0000005A
GLOBAL CONST $HGDI_ERROR = PTR(- 0x00000001)
GLOBAL CONST $INVALID_HANDLE_VALUE = PTR(- 0x00000001)
GLOBAL CONST $CLR_INVALID = -0x00000001
GLOBAL CONST $__WINAPICONSTANT_FLASHW_CAPTION = 0x00000001
GLOBAL CONST $__WINAPICONSTANT_FLASHW_TRAY = 0x00000002
GLOBAL CONST $__WINAPICONSTANT_FLASHW_TIMER = 0x00000004
GLOBAL CONST $__WINAPICONSTANT_FLASHW_TIMERNOFG = 0x0000000C
GLOBAL CONST $__WINAPICONSTANT_GW_HWNDNEXT = 0x00000002
GLOBAL CONST $__WINAPICONSTANT_GW_CHILD = 0x00000005
GLOBAL CONST $__WINAPICONSTANT_DI_MASK = 0x00000001
GLOBAL CONST $__WINAPICONSTANT_DI_IMAGE = 0x00000002
GLOBAL CONST $__WINAPICONSTANT_DI_NORMAL = 0x00000003
GLOBAL CONST $__WINAPICONSTANT_DI_COMPAT = 0x00000004
GLOBAL CONST $__WINAPICONSTANT_DI_DEFAULTSIZE = 0x00000008
GLOBAL CONST $__WINAPICONSTANT_DI_NOMIRROR = 0x00000010
GLOBAL CONST $__WINAPICONSTANT_DISPLAY_DEVICE_ATTACHED_TO_DESKTOP = 0x00000001
GLOBAL CONST $__WINAPICONSTANT_DISPLAY_DEVICE_PRIMARY_DEVICE = 0x00000004
GLOBAL CONST $__WINAPICONSTANT_DISPLAY_DEVICE_MIRRORING_DRIVER = 0x00000008
GLOBAL CONST $__WINAPICONSTANT_DISPLAY_DEVICE_VGA_COMPATIBLE = 0x00000010
GLOBAL CONST $__WINAPICONSTANT_DISPLAY_DEVICE_REMOVABLE = 0x00000020
GLOBAL CONST $__WINAPICONSTANT_DISPLAY_DEVICE_MODESPRUNED = 0x08000000
GLOBAL CONST $NULL_BRUSH = 0x00000005
GLOBAL CONST $NULL_PEN = 0x00000008
GLOBAL CONST $BLACK_BRUSH = 0x00000004
GLOBAL CONST $DKGRAY_BRUSH = 0x00000003
GLOBAL CONST $DC_BRUSH = 0x00000012
GLOBAL CONST $GRAY_BRUSH = 0x00000002
GLOBAL CONST $HOLLOW_BRUSH = $NULL_BRUSH
GLOBAL CONST $LTGRAY_BRUSH = 0x00000001
GLOBAL CONST $WHITE_BRUSH = 0x00000000
GLOBAL CONST $BLACK_PEN = 0x00000007
GLOBAL CONST $DC_PEN = 0x00000013
GLOBAL CONST $WHITE_PEN = 0x00000006
GLOBAL CONST $ANSI_FIXED_FONT = 0x0000000B
GLOBAL CONST $ANSI_VAR_FONT = 0x0000000C
GLOBAL CONST $DEVICE_DEFAULT_FONT = 0x0000000E
GLOBAL CONST $DEFAULT_GUI_FONT = 0x00000011
GLOBAL CONST $OEM_FIXED_FONT = 0x0000000A
GLOBAL CONST $SYSTEM_FONT = 0x0000000D
GLOBAL CONST $SYSTEM_FIXED_FONT = 0x00000010
GLOBAL CONST $DEFAULT_PALETTE = 0x0000000F
GLOBAL CONST $MB_PRECOMPOSED = 0x00000001
GLOBAL CONST $MB_COMPOSITE = 0x00000002
GLOBAL CONST $MB_USEGLYPHCHARS = 0x00000004
GLOBAL CONST $ULW_ALPHA = 0x00000002
GLOBAL CONST $ULW_COLORKEY = 0x00000001
GLOBAL CONST $ULW_OPAQUE = 0x00000004
GLOBAL CONST $WH_CALLWNDPROC = 0x00000004
GLOBAL CONST $WH_CALLWNDPROCRET = 0x0000000C
GLOBAL CONST $WH_CBT = 0x00000005
GLOBAL CONST $WH_DEBUG = 0x00000009
GLOBAL CONST $WH_FOREGROUNDIDLE = 0x0000000B
GLOBAL CONST $WH_GETMESSAGE = 0x00000003
GLOBAL CONST $WH_JOURNALPLAYBACK = 0x00000001
GLOBAL CONST $WH_JOURNALRECORD = 0x00000000
GLOBAL CONST $WH_KEYBOARD = 0x00000002
GLOBAL CONST $WH_KEYBOARD_LL = 0x0000000D
GLOBAL CONST $WH_MOUSE = 0x00000007
GLOBAL CONST $WH_MOUSE_LL = 0x0000000E
GLOBAL CONST $WH_MSGFILTER = -0x00000001
GLOBAL CONST $WH_SHELL = 0x0000000A
GLOBAL CONST $WH_SYSMSGFILTER = 0x00000006
GLOBAL CONST $WPF_ASYNCWINDOWPLACEMENT = 0x00000004
GLOBAL CONST $WPF_RESTORETOMAXIMIZED = 0x00000002
GLOBAL CONST $WPF_SETMINPOSITION = 0x00000001
GLOBAL CONST $KF_EXTENDED = 0x00000100
GLOBAL CONST $KF_ALTDOWN = 0x00002000
GLOBAL CONST $KF_UP = 0x00008000
GLOBAL CONST $LLKHF_EXTENDED = BITSHIFT($KF_EXTENDED, 0x00000008)
GLOBAL CONST $LLKHF_INJECTED = 0x00000010
GLOBAL CONST $LLKHF_ALTDOWN = BITSHIFT($KF_ALTDOWN, 0x00000008)
GLOBAL CONST $LLKHF_UP = BITSHIFT($KF_UP, 0x00000008)
GLOBAL CONST $OFN_ALLOWMULTISELECT = 0x00000200
GLOBAL CONST $OFN_CREATEPROMPT = 0x00002000
GLOBAL CONST $OFN_DONTADDTORECENT = 0x02000000
GLOBAL CONST $OFN_ENABLEHOOK = 0x00000020
GLOBAL CONST $OFN_ENABLEINCLUDENOTIFY = 0x00400000
GLOBAL CONST $OFN_ENABLESIZING = 0x00800000
GLOBAL CONST $OFN_ENABLETEMPLATE = 0x00000040
GLOBAL CONST $OFN_ENABLETEMPLATEHANDLE = 0x00000080
GLOBAL CONST $OFN_EXPLORER = 0x00080000
GLOBAL CONST $OFN_EXTENSIONDIFFERENT = 0x00000400
GLOBAL CONST $OFN_FILEMUSTEXIST = 0x00001000
GLOBAL CONST $OFN_FORCESHOWHIDDEN = 0x10000000
GLOBAL CONST $OFN_HIDEREADONLY = 0x00000004
GLOBAL CONST $OFN_LONGNAMES = 0x00200000
GLOBAL CONST $OFN_NOCHANGEDIR = 0x00000008
GLOBAL CONST $OFN_NODEREFERENCELINKS = 0x00100000
GLOBAL CONST $OFN_NOLONGNAMES = 0x00040000
GLOBAL CONST $OFN_NONETWORKBUTTON = 0x00020000
GLOBAL CONST $OFN_NOREADONLYRETURN = 0x00008000
GLOBAL CONST $OFN_NOTESTFILECREATE = 0x00010000
GLOBAL CONST $OFN_NOVALIDATE = 0x00000100
GLOBAL CONST $OFN_OVERWRITEPROMPT = 0x00000002
GLOBAL CONST $OFN_PATHMUSTEXIST = 0x00000800
GLOBAL CONST $OFN_READONLY = 0x00000001
GLOBAL CONST $OFN_SHAREAWARE = 0x00004000
GLOBAL CONST $OFN_SHOWHELP = 0x00000010
GLOBAL CONST $OFN_EX_NOPLACESBAR = 0x00000001
GLOBAL CONST $TAGCURSORINFO = "dword Size;dword Flags;handle hCursor;"& $TAGPOINT
GLOBAL CONST $TAGDISPLAY_DEVICE = "dword Size;wchar Name[32];wchar String[128];dword Flags;wchar ID[128];wchar Key[128]"
GLOBAL CONST $TAGFLASHWINFO = "uint Size;hwnd hWnd;dword Flags;uint Count;dword TimeOut"
GLOBAL CONST $TAGICONINFO = "bool Icon;dword XHotSpot;dword YHotSpot;handle hMask;handle hColor"
GLOBAL CONST $TAGMEMORYSTATUSEX = "dword Length;dword MemoryLoad;"& "uint64 TotalPhys;uint64 AvailPhys;uint64 TotalPageFile;uint64 AvailPageFile;"& "uint64 TotalVirtual;uint64 AvailVirtual;uint64 AvailExtendedVirtual"
FUNC _WINAPI_ATTACHCONSOLE($IPROCESSID = -0x00000001)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "AttachConsole", "dword", $IPROCESSID)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
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 [0x00000000 ]
ENDFUNC
FUNC _WINAPI_BEEP($IFREQ = 0x000001F4, $IDURATION = 0x000003E8)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "Beep", "dword", $IFREQ, "dword", $IDURATION)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_BITBLT($HDESTDC, $IXDEST, $IYDEST, $IWIDTH, $IHEIGHT, $HSRCDC, $IXSRC, $IYSRC, $IROP)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "bool", "BitBlt", "handle", $HDESTDC, "int", $IXDEST, "int", $IYDEST, "int", $IWIDTH, "int", $IHEIGHT, "handle", $HSRCDC, "int", $IXSRC, "int", $IYSRC, "dword", $IROP)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CALLNEXTHOOKEX($HHK, $ICODE, $WPARAM, $LPARAM)
LOCAL $ARESULT = DLLCALL("user32.dll", "lresult", "CallNextHookEx", "handle", $HHK, "int", $ICODE, "wparam", $WPARAM, "lparam", $LPARAM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, -0x00000001)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CALLWINDOWPROC($LPPREVWNDFUNC, $HWND, $MSG, $WPARAM, $LPARAM)
LOCAL $ARESULT = DLLCALL("user32.dll", "lresult", "CallWindowProc", "ptr", $LPPREVWNDFUNC, "hwnd", $HWND, "uint", $MSG, "wparam", $WPARAM, "lparam", $LPARAM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, -0x00000001)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CLIENTTOSCREEN($HWND, BYREF $TPOINT)
LOCAL $PPOINT = DLLSTRUCTGETPTR($TPOINT)
DLLCALL("user32.dll", "bool", "ClientToScreen", "hwnd", $HWND, "ptr", $PPOINT)
RETURN SETERROR(@ERROR, @EXTENDED, $TPOINT)
ENDFUNC
FUNC _WINAPI_CLOSEHANDLE($HOBJECT)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "CloseHandle", "handle", $HOBJECT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_COMBINERGN($HRGNDEST, $HRGNSRC1, $HRGNSRC2, $ICOMBINEMODE)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "int", "CombineRgn", "handle", $HRGNDEST, "handle", $HRGNSRC1, "handle", $HRGNSRC2, "int", $ICOMBINEMODE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_COMMDLGEXTENDEDERROR()
LOCAL CONST $CDERR_DIALOGFAILURE = 0x0000FFFF
LOCAL CONST $CDERR_FINDRESFAILURE = 0x00000006
LOCAL CONST $CDERR_INITIALIZATION = 0x00000002
LOCAL CONST $CDERR_LOADRESFAILURE = 0x00000007
LOCAL CONST $CDERR_LOADSTRFAILURE = 0x00000005
LOCAL CONST $CDERR_LOCKRESFAILURE = 0x00000008
LOCAL CONST $CDERR_MEMALLOCFAILURE = 0x00000009
LOCAL CONST $CDERR_MEMLOCKFAILURE = 0x0000000A
LOCAL CONST $CDERR_NOHINSTANCE = 0x00000004
LOCAL CONST $CDERR_NOHOOK = 0x0000000B
LOCAL CONST $CDERR_NOTEMPLATE = 0x00000003
LOCAL CONST $CDERR_REGISTERMSGFAIL = 0x0000000C
LOCAL CONST $CDERR_STRUCTSIZE = 0x00000001
LOCAL CONST $FNERR_BUFFERTOOSMALL = 0x00003003
LOCAL CONST $FNERR_INVALIDFILENAME = 0x00003002
LOCAL CONST $FNERR_SUBCLASSFAILURE = 0x00003001
LOCAL $ARESULT = DLLCALL("comdlg32.dll", "dword", "CommDlgExtendedError")
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
SWITCH $ARESULT [0x00000000 ]
CASE $CDERR_DIALOGFAILURE
RETURN SETERROR($ARESULT [0x00000000 ], 0x00000000, "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 [0x00000000 ], 0x00000000, "The common dialog box function failed to find a specified resource.")
CASE $CDERR_INITIALIZATION
RETURN SETERROR($ARESULT [0x00000000 ], 0x00000000, "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 [0x00000000 ], 0x00000000, "The common dialog box function failed to load a specified resource.")
CASE $CDERR_LOADSTRFAILURE
RETURN SETERROR($ARESULT [0x00000000 ], 0x00000000, "The common dialog box function failed to load a specified string.")
CASE $CDERR_LOCKRESFAILURE
RETURN SETERROR($ARESULT [0x00000000 ], 0x00000000, "The common dialog box function failed to lock a specified resource.")
CASE $CDERR_MEMALLOCFAILURE
RETURN SETERROR($ARESULT [0x00000000 ], 0x00000000, "The common dialog box function was unable to allocate memory for internal structures.")
CASE $CDERR_MEMLOCKFAILURE
RETURN SETERROR($ARESULT [0x00000000 ], 0x00000000, "The common dialog box function was unable to lock the memory associated with a handle.")
CASE $CDERR_NOHINSTANCE
RETURN SETERROR($ARESULT [0x00000000 ], 0x00000000, "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 [0x00000000 ], 0x00000000, "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 [0x00000000 ], 0x00000000, "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 [0x00000000 ], 0x00000000, "The RegisterWindowMessage function returned an error code when it was called by the common dialog box function.")
CASE $CDERR_STRUCTSIZE
RETURN SETERROR($ARESULT [0x00000000 ], 0x00000000, "The lStructSize member of the initialization structure for the corresponding common dialog box is invalid")
CASE $FNERR_BUFFERTOOSMALL
RETURN SETERROR($ARESULT [0x00000000 ], 0x00000000, "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 [0x00000000 ], 0x00000000, "A file name is invalid.")
CASE $FNERR_SUBCLASSFAILURE
RETURN SETERROR($ARESULT [0x00000000 ], 0x00000000, "An attempt to subclass a list box failed because sufficient memory was not available.")
ENDSWITCH
RETURN HEX($ARESULT [0x00000000 ])
ENDFUNC
FUNC _WINAPI_COPYICON($HICON)
LOCAL $ARESULT = DLLCALL("user32.dll", "handle", "CopyIcon", "handle", $HICON)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CREATEBITMAP($IWIDTH, $IHEIGHT, $IPLANES = 0x00000001, $IBITSPERPEL = 0x00000001, $PBITS = 0x00000000)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "handle", "CreateBitmap", "int", $IWIDTH, "int", $IHEIGHT, "uint", $IPLANES, "uint", $IBITSPERPEL, "ptr", $PBITS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CREATECOMPATIBLEBITMAP($HDC, $IWIDTH, $IHEIGHT)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "handle", "CreateCompatibleBitmap", "handle", $HDC, "int", $IWIDTH, "int", $IHEIGHT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CREATECOMPATIBLEDC($HDC)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "handle", "CreateCompatibleDC", "handle", $HDC)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CREATEEVENT($PATTRIBUTES = 0x00000000, $FMANUALRESET = TRUE, $FINITIALSTATE = TRUE, $SNAME = "")
LOCAL $SNAMETYPE = "wstr"
IF $SNAME = ""THEN
$SNAME = 0x00000000
$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, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CREATEFILE($SFILENAME, $ICREATION, $IACCESS = 0x00000004, $ISHARE = 0x00000000, $IATTRIBUTES = 0x00000000, $PSECURITY = 0x00000000)
LOCAL $IDA = 0x00000000, $ISM = 0x00000000, $ICD = 0x00000000, $IFA = 0x00000000
IF BITAND($IACCESS, 0x00000001) <> 0x00000000 THEN $IDA = BITOR($IDA, $GENERIC_EXECUTE)
IF BITAND($IACCESS, 0x00000002) <> 0x00000000 THEN $IDA = BITOR($IDA, $GENERIC_READ)
IF BITAND($IACCESS, 0x00000004) <> 0x00000000 THEN $IDA = BITOR($IDA, $GENERIC_WRITE)
IF BITAND($ISHARE, 0x00000001) <> 0x00000000 THEN $ISM = BITOR($ISM, $FILE_SHARE_DELETE)
IF BITAND($ISHARE, 0x00000002) <> 0x00000000 THEN $ISM = BITOR($ISM, $FILE_SHARE_READ)
IF BITAND($ISHARE, 0x00000004) <> 0x00000000 THEN $ISM = BITOR($ISM, $FILE_SHARE_WRITE)
SWITCH $ICREATION
CASE 0x00000000
$ICD = $CREATE_NEW
CASE 0x00000001
$ICD = $CREATE_ALWAYS
CASE 0x00000002
$ICD = $OPEN_EXISTING
CASE 0x00000003
$ICD = $OPEN_ALWAYS
CASE 0x00000004
$ICD = $TRUNCATE_EXISTING
ENDSWITCH
IF BITAND($IATTRIBUTES, 0x00000001) <> 0x00000000 THEN $IFA = BITOR($IFA, $FILE_ATTRIBUTE_ARCHIVE)
IF BITAND($IATTRIBUTES, 0x00000002) <> 0x00000000 THEN $IFA = BITOR($IFA, $FILE_ATTRIBUTE_HIDDEN)
IF BITAND($IATTRIBUTES, 0x00000004) <> 0x00000000 THEN $IFA = BITOR($IFA, $FILE_ATTRIBUTE_READONLY)
IF BITAND($IATTRIBUTES, 0x00000008) <> 0x00000000 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", 0x00000000)
IF @ERROR OR $ARESULT [0x00000000 ]= PTR(- 0x00000001) THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CREATEFONT($NHEIGHT, $NWIDTH, $NESCAPE = 0x00000000, $NORIENTN = 0x00000000, $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 = 0x00000000, $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, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CREATEFONTINDIRECT($TLOGFONT)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "handle", "CreateFontIndirectW", "ptr", DLLSTRUCTGETPTR($TLOGFONT))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
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, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CREATEPROCESS($SAPPNAME, $SCOMMAND, $PSECURITY, $PTHREAD, $FINHERIT, $IFLAGS, $PENVIRON, $SDIR, $PSTARTUPINFO, $PPROCESS)
LOCAL $PCOMMAND = 0x00000000
LOCAL $SAPPNAMETYPE = "wstr", $SDIRTYPE = "wstr"
IF $SAPPNAME = ""THEN
$SAPPNAMETYPE = "ptr"
$SAPPNAME = 0x00000000
ENDIF
IF $SCOMMAND <> ""THEN
LOCAL $TCOMMAND = DLLSTRUCTCREATE("wchar Text["& 0x00000104 + 0x00000001 & "]")
$PCOMMAND = DLLSTRUCTGETPTR($TCOMMAND)
DLLSTRUCTSETDATA($TCOMMAND, "Text", $SCOMMAND)
ENDIF
IF $SDIR = ""THEN
$SDIRTYPE = "ptr"
$SDIR = 0x00000000
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 [0x00000000 ]
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, 0x00000000)
RETURN $ARESULT [0x00000000 ]
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, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CREATESOLIDBITMAP($HWND, $ICOLOR, $IWIDTH, $IHEIGHT, $BRGB = 0x00000001)
LOCAL $HDC = _WINAPI_GETDC($HWND)
LOCAL $HDESTDC = _WINAPI_CREATECOMPATIBLEDC($HDC)
LOCAL $HBITMAP = _WINAPI_CREATECOMPATIBLEBITMAP($HDC, $IWIDTH, $IHEIGHT)
LOCAL $HOLD = _WINAPI_SELECTOBJECT($HDESTDC, $HBITMAP)
LOCAL $TRECT = DLLSTRUCTCREATE($TAGRECT)
DLLSTRUCTSETDATA($TRECT, 0x00000001, 0x00000000)
DLLSTRUCTSETDATA($TRECT, 0x00000002, 0x00000000)
DLLSTRUCTSETDATA($TRECT, 0x00000003, $IWIDTH)
DLLSTRUCTSETDATA($TRECT, 0x00000004, $IHEIGHT)
IF $BRGB THEN
$ICOLOR = BITOR(BITAND($ICOLOR, 0x0000FF00), BITSHIFT(BITAND($ICOLOR, 0x000000FF), -0x00000010), BITSHIFT(BITAND($ICOLOR, 0x00FF0000), 0x00000010))
ENDIF
LOCAL $HBRUSH = _WINAPI_CREATESOLIDBRUSH($ICOLOR)
_WINAPI_FILLRECT($HDESTDC, DLLSTRUCTGETPTR($TRECT), $HBRUSH)
IF @ERROR THEN
_WINAPI_DELETEOBJECT($HBITMAP)
$HBITMAP = 0x00000000
ENDIF
_WINAPI_DELETEOBJECT($HBRUSH)
_WINAPI_RELEASEDC($HWND, $HDC)
_WINAPI_SELECTOBJECT($HDESTDC, $HOLD)
_WINAPI_DELETEDC($HDESTDC)
IF NOT $HBITMAP THEN RETURN SETERROR(0x00000001, 0x00000000, 0x00000000)
RETURN $HBITMAP
ENDFUNC
FUNC _WINAPI_CREATESOLIDBRUSH($NCOLOR)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "handle", "CreateSolidBrush", "dword", $NCOLOR)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_CREATEWINDOWEX($IEXSTYLE, $SCLASS, $SNAME, $ISTYLE, $IX, $IY, $IWIDTH, $IHEIGHT, $HPARENT, $HMENU = 0x00000000, $HINSTANCE = 0x00000000, $PPARAM = 0x00000000)
IF $HINSTANCE = 0x00000000 THEN $HINSTANCE = _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", $HPARENT, "handle", $HMENU, "handle", $HINSTANCE, "ptr", $PPARAM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_DEFWINDOWPROC($HWND, $IMSG, $IWPARAM, $ILPARAM)
LOCAL $ARESULT = DLLCALL("user32.dll", "lresult", "DefWindowProc", "hwnd", $HWND, "uint", $IMSG, "wparam", $IWPARAM, "lparam", $ILPARAM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_DELETEDC($HDC)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "bool", "DeleteDC", "handle", $HDC)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_DELETEOBJECT($HOBJECT)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "bool", "DeleteObject", "handle", $HOBJECT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_DESTROYICON($HICON)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "DestroyIcon", "handle", $HICON)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_DESTROYWINDOW($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "DestroyWindow", "hwnd", $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_DRAWEDGE($HDC, $PTRRECT, $NEDGETYPE, $GRFFLAGS)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "DrawEdge", "handle", $HDC, "ptr", $PTRRECT, "uint", $NEDGETYPE, "uint", $GRFFLAGS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_DRAWFRAMECONTROL($HDC, $PTRRECT, $NTYPE, $NSTATE)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "DrawFrameControl", "handle", $HDC, "ptr", $PTRRECT, "uint", $NTYPE, "uint", $NSTATE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_DRAWICON($HDC, $IX, $IY, $HICON)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "DrawIcon", "handle", $HDC, "int", $IX, "int", $IY, "handle", $HICON)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_DRAWICONEX($HDC, $IX, $IY, $HICON, $IWIDTH = 0x00000000, $IHEIGHT = 0x00000000, $ISTEP = 0x00000000, $HBRUSH = 0x00000000, $IFLAGS = 0x00000003)
LOCAL $IOPTIONS
SWITCH $IFLAGS
CASE 0x00000001
$IOPTIONS = $__WINAPICONSTANT_DI_MASK
CASE 0x00000002
$IOPTIONS = $__WINAPICONSTANT_DI_IMAGE
CASE 0x00000003
$IOPTIONS = $__WINAPICONSTANT_DI_NORMAL
CASE 0x00000004
$IOPTIONS = $__WINAPICONSTANT_DI_COMPAT
CASE 0x00000005
$IOPTIONS = $__WINAPICONSTANT_DI_DEFAULTSIZE
CASE ELSE
$IOPTIONS = $__WINAPICONSTANT_DI_NOMIRROR
ENDSWITCH
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "DrawIconEx", "handle", $HDC, "int", $IX, "int", $IY, "handle", $HICON, "int", $IWIDTH, "int", $IHEIGHT, "uint", $ISTEP, "handle", $HBRUSH, "uint", $IOPTIONS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_DRAWLINE($HDC, $IX1, $IY1, $IX2, $IY2)
_WINAPI_MOVETO($HDC, $IX1, $IY1)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
_WINAPI_LINETO($HDC, $IX2, $IY2)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN TRUE
ENDFUNC
FUNC _WINAPI_DRAWTEXT($HDC, $STEXT, BYREF $TRECT, $IFLAGS)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "DrawTextW", "handle", $HDC, "wstr", $STEXT, "int", -0x00000001, "ptr", DLLSTRUCTGETPTR($TRECT), "uint", $IFLAGS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_ENABLEWINDOW($HWND, $FENABLE = TRUE)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "EnableWindow", "hwnd", $HWND, "bool", $FENABLE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_ENUMDISPLAYDEVICES($SDEVICE, $IDEVNUM)
LOCAL $PNAME = 0x00000000, $IFLAGS = 0x00000000, $ADEVICE [0x00000005 ]
IF $SDEVICE <> ""THEN
LOCAL $TNAME = DLLSTRUCTCREATE("wchar Text["& STRINGLEN($SDEVICE) + 0x00000001 & "]")
$PNAME = DLLSTRUCTGETPTR($TNAME)
DLLSTRUCTSETDATA($TNAME, "Text", $SDEVICE)
ENDIF
LOCAL $TDEVICE = DLLSTRUCTCREATE($TAGDISPLAY_DEVICE)
LOCAL $PDEVICE = DLLSTRUCTGETPTR($TDEVICE)
LOCAL $IDEVICE = DLLSTRUCTGETSIZE($TDEVICE)
DLLSTRUCTSETDATA($TDEVICE, "Size", $IDEVICE)
DLLCALL("user32.dll", "bool", "EnumDisplayDevicesW", "ptr", $PNAME, "dword", $IDEVNUM, "ptr", $PDEVICE, "dword", 0x00000001)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
LOCAL $IN = DLLSTRUCTGETDATA($TDEVICE, "Flags")
IF BITAND($IN, $__WINAPICONSTANT_DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) <> 0x00000000 THEN $IFLAGS = BITOR($IFLAGS, 0x00000001)
IF BITAND($IN, $__WINAPICONSTANT_DISPLAY_DEVICE_PRIMARY_DEVICE) <> 0x00000000 THEN $IFLAGS = BITOR($IFLAGS, 0x00000002)
IF BITAND($IN, $__WINAPICONSTANT_DISPLAY_DEVICE_MIRRORING_DRIVER) <> 0x00000000 THEN $IFLAGS = BITOR($IFLAGS, 0x00000004)
IF BITAND($IN, $__WINAPICONSTANT_DISPLAY_DEVICE_VGA_COMPATIBLE) <> 0x00000000 THEN $IFLAGS = BITOR($IFLAGS, 0x00000008)
IF BITAND($IN, $__WINAPICONSTANT_DISPLAY_DEVICE_REMOVABLE) <> 0x00000000 THEN $IFLAGS = BITOR($IFLAGS, 0x00000010)
IF BITAND($IN, $__WINAPICONSTANT_DISPLAY_DEVICE_MODESPRUNED) <> 0x00000000 THEN $IFLAGS = BITOR($IFLAGS, 0x00000020)
$ADEVICE [0x00000000 ]= TRUE
$ADEVICE [0x00000001 ]= DLLSTRUCTGETDATA($TDEVICE, "Name")
$ADEVICE [0x00000002 ]= DLLSTRUCTGETDATA($TDEVICE, "String")
$ADEVICE [0x00000003 ]= $IFLAGS
$ADEVICE [0x00000004 ]= DLLSTRUCTGETDATA($TDEVICE, "ID")
RETURN $ADEVICE
ENDFUNC
FUNC _WINAPI_ENUMWINDOWS($FVISIBLE = TRUE, $HWND = DEFAULT)
__WINAPI_ENUMWINDOWSINIT()
IF $HWND = DEFAULT THEN $HWND = _WINAPI_GETDESKTOPWINDOW()
__WINAPI_ENUMWINDOWSCHILD($HWND, $FVISIBLE)
RETURN $__GAWINLIST_WINAPI
ENDFUNC
FUNC __WINAPI_ENUMWINDOWSADD($HWND, $SCLASS = "")
IF $SCLASS = ""THEN $SCLASS = _WINAPI_GETCLASSNAME($HWND)
$__GAWINLIST_WINAPI [0x00000000 ][0x00000000 ]+= 0x00000001
LOCAL $ICOUNT = $__GAWINLIST_WINAPI [0x00000000 ][0x00000000 ]
IF $ICOUNT >= $__GAWINLIST_WINAPI [0x00000000 ][0x00000001 ]THEN
REDIM $__GAWINLIST_WINAPI [$ICOUNT + 0x00000040 ][0x00000002 ]
$__GAWINLIST_WINAPI [0x00000000 ][0x00000001 ]+= 0x00000040
ENDIF
$__GAWINLIST_WINAPI [$ICOUNT ][0x00000000 ]= $HWND
$__GAWINLIST_WINAPI [$ICOUNT ][0x00000001 ]= $SCLASS
ENDFUNC
FUNC __WINAPI_ENUMWINDOWSCHILD($HWND, $FVISIBLE = TRUE)
$HWND = _WINAPI_GETWINDOW($HWND, $__WINAPICONSTANT_GW_CHILD)
WHILE $HWND <> 0x00000000
IF (NOT $FVISIBLE) OR _WINAPI_ISWINDOWVISIBLE($HWND) THEN
__WINAPI_ENUMWINDOWSCHILD($HWND, $FVISIBLE)
__WINAPI_ENUMWINDOWSADD($HWND)
ENDIF
$HWND = _WINAPI_GETWINDOW($HWND, $__WINAPICONSTANT_GW_HWNDNEXT)
WEND
ENDFUNC
FUNC __WINAPI_ENUMWINDOWSINIT()
REDIM $__GAWINLIST_WINAPI [0x00000040 ][0x00000002 ]
$__GAWINLIST_WINAPI [0x00000000 ][0x00000000 ]= 0x00000000
$__GAWINLIST_WINAPI [0x00000000 ][0x00000001 ]= 0x00000040
ENDFUNC
FUNC _WINAPI_ENUMWINDOWSPOPUP()
__WINAPI_ENUMWINDOWSINIT()
LOCAL $HWND = _WINAPI_GETWINDOW(_WINAPI_GETDESKTOPWINDOW(), $__WINAPICONSTANT_GW_CHILD)
LOCAL $SCLASS
WHILE $HWND <> 0x00000000
IF _WINAPI_ISWINDOWVISIBLE($HWND) THEN
$SCLASS = _WINAPI_GETCLASSNAME($HWND)
IF $SCLASS = "#32768"THEN
__WINAPI_ENUMWINDOWSADD($HWND)
ELSEIF $SCLASS = "ToolbarWindow32"THEN
__WINAPI_ENUMWINDOWSADD($HWND)
ELSEIF $SCLASS = "ToolTips_Class32"THEN
__WINAPI_ENUMWINDOWSADD($HWND)
ELSEIF $SCLASS = "BaseBar"THEN
__WINAPI_ENUMWINDOWSCHILD($HWND)
ENDIF
ENDIF
$HWND = _WINAPI_GETWINDOW($HWND, $__WINAPICONSTANT_GW_HWNDNEXT)
WEND
RETURN $__GAWINLIST_WINAPI
ENDFUNC
FUNC _WINAPI_ENUMWINDOWSTOP()
__WINAPI_ENUMWINDOWSINIT()
LOCAL $HWND = _WINAPI_GETWINDOW(_WINAPI_GETDESKTOPWINDOW(), $__WINAPICONSTANT_GW_CHILD)
WHILE $HWND <> 0x00000000
IF _WINAPI_ISWINDOWVISIBLE($HWND) THEN __WINAPI_ENUMWINDOWSADD($HWND)
$HWND = _WINAPI_GETWINDOW($HWND, $__WINAPICONSTANT_GW_HWNDNEXT)
WEND
RETURN $__GAWINLIST_WINAPI
ENDFUNC
FUNC _WINAPI_EXPANDENVIRONMENTSTRINGS($SSTRING)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "dword", "ExpandEnvironmentStringsW", "wstr", $SSTRING, "wstr", "", "dword", 0x00001000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, "")
RETURN $ARESULT [0x00000002 ]
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, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_FATALAPPEXIT($SMESSAGE)
DLLCALL("kernel32.dll", "none", "FatalAppExitW", "uint", 0x00000000, "wstr", $SMESSAGE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED)
ENDFUNC
FUNC _WINAPI_FILLRECT($HDC, $PTRRECT, $HBRUSH)
LOCAL $ARESULT
IF ISPTR($HBRUSH) THEN
$ARESULT = DLLCALL("user32.dll", "int", "FillRect", "handle", $HDC, "ptr", $PTRRECT, "handle", $HBRUSH)
ELSE
$ARESULT = DLLCALL("user32.dll", "int", "FillRect", "handle", $HDC, "ptr", $PTRRECT, "dword", $HBRUSH)
ENDIF
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
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, 0x00000000)
RETURN SETEXTENDED($ARESULT [0x00000000 ], $ARESULT [0x00000003 ])
ENDFUNC
FUNC _WINAPI_FINDWINDOW($SCLASSNAME, $SWINDOWNAME)
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "FindWindowW", "wstr", $SCLASSNAME, "wstr", $SWINDOWNAME)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_FLASHWINDOW($HWND, $FINVERT = TRUE)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "FlashWindow", "hwnd", $HWND, "bool", $FINVERT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_FLASHWINDOWEX($HWND, $IFLAGS = 0x00000003, $ICOUNT = 0x00000003, $ITIMEOUT = 0x00000000)
LOCAL $TFLASH = DLLSTRUCTCREATE($TAGFLASHWINFO)
LOCAL $PFLASH = DLLSTRUCTGETPTR($TFLASH)
LOCAL $IFLASH = DLLSTRUCTGETSIZE($TFLASH)
LOCAL $IMODE = 0x00000000
IF BITAND($IFLAGS, 0x00000001) <> 0x00000000 THEN $IMODE = BITOR($IMODE, $__WINAPICONSTANT_FLASHW_CAPTION)
IF BITAND($IFLAGS, 0x00000002) <> 0x00000000 THEN $IMODE = BITOR($IMODE, $__WINAPICONSTANT_FLASHW_TRAY)
IF BITAND($IFLAGS, 0x00000004) <> 0x00000000 THEN $IMODE = BITOR($IMODE, $__WINAPICONSTANT_FLASHW_TIMER)
IF BITAND($IFLAGS, 0x00000008) <> 0x00000000 THEN $IMODE = BITOR($IMODE, $__WINAPICONSTANT_FLASHW_TIMERNOFG)
DLLSTRUCTSETDATA($TFLASH, "Size", $IFLASH)
DLLSTRUCTSETDATA($TFLASH, "hWnd", $HWND)
DLLSTRUCTSETDATA($TFLASH, "Flags", $IMODE)
DLLSTRUCTSETDATA($TFLASH, "Count", $ICOUNT)
DLLSTRUCTSETDATA($TFLASH, "Timeout", $ITIMEOUT)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "FlashWindowEx", "ptr", $PFLASH)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_FLOATTOINT($NFLOAT)
LOCAL $TFLOAT = DLLSTRUCTCREATE("float")
LOCAL $TINT = DLLSTRUCTCREATE("int", DLLSTRUCTGETPTR($TFLOAT))
DLLSTRUCTSETDATA($TFLOAT, 0x00000001, $NFLOAT)
RETURN DLLSTRUCTGETDATA($TINT, 0x00000001)
ENDFUNC
FUNC _WINAPI_FLUSHFILEBUFFERS($HFILE)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "FlushFileBuffers", "handle", $HFILE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
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, 0x00000000)
IF $SBUFFERTYPE = "wstr"THEN $PBUFFER = $ARESULT [0x00000005 ]
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_FRAMERECT($HDC, $PTRRECT, $HBRUSH)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "FrameRect", "handle", $HDC, "ptr", $PTRRECT, "handle", $HBRUSH)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_FREELIBRARY($HMODULE)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "FreeLibrary", "handle", $HMODULE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETANCESTOR($HWND, $IFLAGS = 0x00000001)
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "GetAncestor", "hwnd", $HWND, "uint", $IFLAGS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETASYNCKEYSTATE($IKEY)
LOCAL $ARESULT = DLLCALL("user32.dll", "short", "GetAsyncKeyState", "int", $IKEY)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETBKMODE($HDC)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "int", "GetBkMode", "handle", $HDC)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETCLASSNAME($HWND)
IF NOT ISHWND($HWND) THEN $HWND = GUICTRLGETHANDLE($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "GetClassNameW", "hwnd", $HWND, "wstr", "", "int", 0x00001000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN SETEXTENDED($ARESULT [0x00000000 ], $ARESULT [0x00000002 ])
ENDFUNC
FUNC _WINAPI_GETCLIENTHEIGHT($HWND)
LOCAL $TRECT = _WINAPI_GETCLIENTRECT($HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN DLLSTRUCTGETDATA($TRECT, "Bottom") - DLLSTRUCTGETDATA($TRECT, "Top")
ENDFUNC
FUNC _WINAPI_GETCLIENTWIDTH($HWND)
LOCAL $TRECT = _WINAPI_GETCLIENTRECT($HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN DLLSTRUCTGETDATA($TRECT, "Right") - DLLSTRUCTGETDATA($TRECT, "Left")
ENDFUNC
FUNC _WINAPI_GETCLIENTRECT($HWND)
LOCAL $TRECT = DLLSTRUCTCREATE($TAGRECT)
DLLCALL("user32.dll", "bool", "GetClientRect", "hwnd", $HWND, "ptr", DLLSTRUCTGETPTR($TRECT))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $TRECT
ENDFUNC
FUNC _WINAPI_GETCURRENTPROCESS()
LOCAL $ARESULT = DLLCALL("kernel32.dll", "handle", "GetCurrentProcess")
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETCURRENTPROCESSID()
LOCAL $ARESULT = DLLCALL("kernel32.dll", "dword", "GetCurrentProcessId")
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETCURRENTTHREAD()
LOCAL $ARESULT = DLLCALL("kernel32.dll", "handle", "GetCurrentThread")
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETCURRENTTHREADID()
LOCAL $ARESULT = DLLCALL("kernel32.dll", "dword", "GetCurrentThreadId")
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETCURSORINFO()
LOCAL $TCURSOR = DLLSTRUCTCREATE($TAGCURSORINFO)
LOCAL $ICURSOR = DLLSTRUCTGETSIZE($TCURSOR)
DLLSTRUCTSETDATA($TCURSOR, "Size", $ICURSOR)
DLLCALL("user32.dll", "bool", "GetCursorInfo", "ptr", DLLSTRUCTGETPTR($TCURSOR))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
LOCAL $ACURSOR [0x00000005 ]
$ACURSOR [0x00000000 ]= TRUE
$ACURSOR [0x00000001 ]= DLLSTRUCTGETDATA($TCURSOR, "Flags") <> 0x00000000
$ACURSOR [0x00000002 ]= DLLSTRUCTGETDATA($TCURSOR, "hCursor")
$ACURSOR [0x00000003 ]= DLLSTRUCTGETDATA($TCURSOR, "X")
$ACURSOR [0x00000004 ]= DLLSTRUCTGETDATA($TCURSOR, "Y")
RETURN $ACURSOR
ENDFUNC
FUNC _WINAPI_GETDC($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "handle", "GetDC", "hwnd", $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETDESKTOPWINDOW()
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "GetDesktopWindow")
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETDEVICECAPS($HDC, $IINDEX)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "int", "GetDeviceCaps", "handle", $HDC, "int", $IINDEX)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETDIBITS($HDC, $HBMP, $ISTARTSCAN, $ISCANLINES, $PBITS, $PBI, $IUSAGE)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "int", "GetDIBits", "handle", $HDC, "handle", $HBMP, "uint", $ISTARTSCAN, "uint", $ISCANLINES, "ptr", $PBITS, "ptr", $PBI, "uint", $IUSAGE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETDLGCTRLID($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "GetDlgCtrlID", "hwnd", $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETDLGITEM($HWND, $IITEMID)
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "GetDlgItem", "hwnd", $HWND, "int", $IITEMID)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETFOCUS()
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "GetFocus")
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETFOREGROUNDWINDOW()
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "GetForegroundWindow")
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETGUIRESOURCES($IFLAG = 0x00000000, $HPROCESS = -0x00000001)
IF $HPROCESS = -0x00000001 THEN $HPROCESS = _WINAPI_GETCURRENTPROCESS()
LOCAL $ARESULT = DLLCALL("user32.dll", "dword", "GetGuiResources", "handle", $HPROCESS, "dword", $IFLAG)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETICONINFO($HICON)
LOCAL $TINFO = DLLSTRUCTCREATE($TAGICONINFO)
DLLCALL("user32.dll", "bool", "GetIconInfo", "handle", $HICON, "ptr", DLLSTRUCTGETPTR($TINFO))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
LOCAL $AICON [0x00000006 ]
$AICON [0x00000000 ]= TRUE
$AICON [0x00000001 ]= DLLSTRUCTGETDATA($TINFO, "Icon") <> 0x00000000
$AICON [0x00000002 ]= DLLSTRUCTGETDATA($TINFO, "XHotSpot")
$AICON [0x00000003 ]= DLLSTRUCTGETDATA($TINFO, "YHotSpot")
$AICON [0x00000004 ]= DLLSTRUCTGETDATA($TINFO, "hMask")
$AICON [0x00000005 ]= DLLSTRUCTGETDATA($TINFO, "hColor")
RETURN $AICON
ENDFUNC
FUNC _WINAPI_GETFILESIZEEX($HFILE)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "GetFileSizeEx", "handle", $HFILE, "int64*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000002 ]
ENDFUNC
FUNC _WINAPI_GETLASTERRORMESSAGE()
LOCAL $TBUFFERPTR = DLLSTRUCTCREATE("ptr")
LOCAL $PBUFFERPTR = DLLSTRUCTGETPTR($TBUFFERPTR)
LOCAL $NCOUNT = _WINAPI_FORMATMESSAGE(BITOR($__WINAPICONSTANT_FORMAT_MESSAGE_ALLOCATE_BUFFER, $__WINAPICONSTANT_FORMAT_MESSAGE_FROM_SYSTEM), 0x00000000, _WINAPI_GETLASTERROR(), 0x00000000, $PBUFFERPTR, 0x00000000, 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, 0x00000000, "")
LOCAL $STEXT = ""
LOCAL $PBUFFER = DLLSTRUCTGETDATA($TBUFFERPTR, 0x00000001)
IF $PBUFFER THEN
IF $NCOUNT > 0x00000000 THEN
LOCAL $TBUFFER = DLLSTRUCTCREATE("wchar["& ($NCOUNT + 0x00000001) & "]", $PBUFFER)
$STEXT = DLLSTRUCTGETDATA($TBUFFER, 0x00000001)
ENDIF
_WINAPI_LOCALFREE($PBUFFER)
ENDIF
RETURN $STEXT
ENDFUNC
FUNC _WINAPI_GETLAYEREDWINDOWATTRIBUTES($HWND, BYREF $I_TRANSCOLOR, BYREF $TRANSPARENCY, $ASCOLORREF = FALSE)
$I_TRANSCOLOR = -0x00000001
$TRANSPARENCY = -0x00000001
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "GetLayeredWindowAttributes", "hwnd", $HWND, "dword*", $I_TRANSCOLOR, "byte*", $TRANSPARENCY, "dword*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
IF NOT $ASCOLORREF THEN
$ARESULT [0x00000002 ]= HEX(STRING($ARESULT [0x00000002 ]), 0x00000006)
$ARESULT [0x00000002 ]= "0x"& STRINGMID($ARESULT [0x00000002 ], 0x00000005, 0x00000002) & STRINGMID($ARESULT [0x00000002 ], 0x00000003, 0x00000002) & STRINGMID($ARESULT [0x00000002 ], 0x00000001, 0x00000002)
ENDIF
$I_TRANSCOLOR = $ARESULT [0x00000002 ]
$TRANSPARENCY = $ARESULT [0x00000003 ]
RETURN $ARESULT [0x00000004 ]
ENDFUNC
FUNC _WINAPI_GETMODULEHANDLE($SMODULENAME)
LOCAL $SMODULENAMETYPE = "wstr"
IF $SMODULENAME = ""THEN
$SMODULENAME = 0x00000000
$SMODULENAMETYPE = "ptr"
ENDIF
LOCAL $ARESULT = DLLCALL("kernel32.dll", "handle", "GetModuleHandleW", $SMODULENAMETYPE, $SMODULENAME)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETMOUSEPOS($FTOCLIENT = FALSE, $HWND = 0x00000000)
LOCAL $IMODE = OPT("MouseCoordMode", 0x00000001)
LOCAL $APOS = MOUSEGETPOS()
OPT("MouseCoordMode", $IMODE)
LOCAL $TPOINT = DLLSTRUCTCREATE($TAGPOINT)
DLLSTRUCTSETDATA($TPOINT, "X", $APOS [0x00000000 ])
DLLSTRUCTSETDATA($TPOINT, "Y", $APOS [0x00000001 ])
IF $FTOCLIENT THEN
_WINAPI_SCREENTOCLIENT($HWND, $TPOINT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
ENDIF
RETURN $TPOINT
ENDFUNC
FUNC _WINAPI_GETMOUSEPOSX($FTOCLIENT = FALSE, $HWND = 0x00000000)
LOCAL $TPOINT = _WINAPI_GETMOUSEPOS($FTOCLIENT, $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN DLLSTRUCTGETDATA($TPOINT, "X")
ENDFUNC
FUNC _WINAPI_GETMOUSEPOSY($FTOCLIENT = FALSE, $HWND = 0x00000000)
LOCAL $TPOINT = _WINAPI_GETMOUSEPOS($FTOCLIENT, $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN DLLSTRUCTGETDATA($TPOINT, "Y")
ENDFUNC
FUNC _WINAPI_GETOBJECT($HOBJECT, $ISIZE, $POBJECT)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "int", "GetObject", "handle", $HOBJECT, "int", $ISIZE, "ptr", $POBJECT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETOPENFILENAME($STITLE = "", $SFILTER = "All files (*.*)", $SINITALDIR = ".", $SDEFAULTFILE = "", $SDEFAULTEXT = "", $IFILTERINDEX = 0x00000001, $IFLAGS = 0x00000000, $IFLAGSEX = 0x00000000, $HWNDOWNER = 0x00000000)
LOCAL $IPATHLEN = 0x00001000
LOCAL $INULLS = 0x00000000
LOCAL $TOFN = DLLSTRUCTCREATE($TAGOPENFILENAME)
LOCAL $AFILES [0x00000001 ]= [0x00000000 ]
LOCAL $IFLAG = $IFLAGS
LOCAL $ASFLINES = STRINGSPLIT($SFILTER, "|")
LOCAL $ASFILTER [$ASFLINES [0x00000000 ]* 0x00000002 + 0x00000001 ]
LOCAL $ISTART, $IFINAL, $STFILTER
$ASFILTER [0x00000000 ]= $ASFLINES [0x00000000 ]* 0x00000002
FOR $I = 0x00000001 TO $ASFLINES [0x00000000 ]
$ISTART = STRINGINSTR($ASFLINES [$I ], "(", 0x00000000, 0x00000001)
$IFINAL = STRINGINSTR($ASFLINES [$I ], ")", 0x00000000, -0x00000001)
$ASFILTER [$I * 0x00000002 - 0x00000001 ]= STRINGSTRIPWS(STRINGLEFT($ASFLINES [$I ], $ISTART - 0x00000001), 0x00000003)
$ASFILTER [$I * 0x00000002 ]= STRINGSTRIPWS(STRINGTRIMRIGHT(STRINGTRIMLEFT($ASFLINES [$I ], $ISTART), STRINGLEN($ASFLINES [$I ]) - $IFINAL + 0x00000001), 0x00000003)
$STFILTER &= "wchar["& STRINGLEN($ASFILTER [$I * 0x00000002 - 0x00000001 ]) + 0x00000001 & "];wchar["& STRINGLEN($ASFILTER [$I * 0x00000002 ]) + 0x00000001 & "];"
NEXT
LOCAL $TTITLE = DLLSTRUCTCREATE("wchar Title["& STRINGLEN($STITLE) + 0x00000001 & "]")
LOCAL $TINITIALDIR = DLLSTRUCTCREATE("wchar InitDir["& STRINGLEN($SINITALDIR) + 0x00000001 & "]")
LOCAL $TFILTER = DLLSTRUCTCREATE($STFILTER & "wchar")
LOCAL $TPATH = DLLSTRUCTCREATE("wchar Path["& $IPATHLEN & "]")
LOCAL $TEXTN = DLLSTRUCTCREATE("wchar Extension["& STRINGLEN($SDEFAULTEXT) + 0x00000001 & "]")
FOR $I = 0x00000001 TO $ASFILTER [0x00000000 ]
DLLSTRUCTSETDATA($TFILTER, $I, $ASFILTER [$I ])
NEXT
DLLSTRUCTSETDATA($TTITLE, "Title", $STITLE)
DLLSTRUCTSETDATA($TINITIALDIR, "InitDir", $SINITALDIR)
DLLSTRUCTSETDATA($TPATH, "Path", $SDEFAULTFILE)
DLLSTRUCTSETDATA($TEXTN, "Extension", $SDEFAULTEXT)
DLLSTRUCTSETDATA($TOFN, "StructSize", DLLSTRUCTGETSIZE($TOFN))
DLLSTRUCTSETDATA($TOFN, "hwndOwner", $HWNDOWNER)
DLLSTRUCTSETDATA($TOFN, "lpstrFilter", DLLSTRUCTGETPTR($TFILTER))
DLLSTRUCTSETDATA($TOFN, "nFilterIndex", $IFILTERINDEX)
DLLSTRUCTSETDATA($TOFN, "lpstrFile", DLLSTRUCTGETPTR($TPATH))
DLLSTRUCTSETDATA($TOFN, "nMaxFile", $IPATHLEN)
DLLSTRUCTSETDATA($TOFN, "lpstrInitialDir", DLLSTRUCTGETPTR($TINITIALDIR))
DLLSTRUCTSETDATA($TOFN, "lpstrTitle", DLLSTRUCTGETPTR($TTITLE))
DLLSTRUCTSETDATA($TOFN, "Flags", $IFLAG)
DLLSTRUCTSETDATA($TOFN, "lpstrDefExt", DLLSTRUCTGETPTR($TEXTN))
DLLSTRUCTSETDATA($TOFN, "FlagsEx", $IFLAGSEX)
DLLCALL("comdlg32.dll", "bool", "GetOpenFileNameW", "ptr", DLLSTRUCTGETPTR($TOFN))
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 = 0x00000001 TO $IPATHLEN
IF DLLSTRUCTGETDATA($TPATH, "Path", $X) = CHR(0x00000000) THEN
DLLSTRUCTSETDATA($TPATH, "Path", "|", $X)
$INULLS += 0x00000001
ELSE
$INULLS = 0x00000000
ENDIF
IF $INULLS = 0x00000002 THEN EXITLOOP
NEXT
DLLSTRUCTSETDATA($TPATH, "Path", CHR(0x00000000), $X - 0x00000001)
$AFILES = STRINGSPLIT(DLLSTRUCTGETDATA($TPATH, "Path"), "|")
IF $AFILES [0x00000000 ]= 0x00000001 THEN RETURN __WINAPI_PARSEFILEDIALOGPATH(DLLSTRUCTGETDATA($TPATH, "Path"))
RETURN STRINGSPLIT(DLLSTRUCTGETDATA($TPATH, "Path"), "|")
ELSEIF BITAND($IFLAGS, $OFN_ALLOWMULTISELECT) = $OFN_ALLOWMULTISELECT THEN
$AFILES = STRINGSPLIT(DLLSTRUCTGETDATA($TPATH, "Path"), " ")
IF $AFILES [0x00000000 ]= 0x00000001 THEN RETURN __WINAPI_PARSEFILEDIALOGPATH(DLLSTRUCTGETDATA($TPATH, "Path"))
RETURN STRINGSPLIT(STRINGREPLACE(DLLSTRUCTGETDATA($TPATH, "Path"), " ", "|"), "|")
ELSE
RETURN __WINAPI_PARSEFILEDIALOGPATH(DLLSTRUCTGETDATA($TPATH, "Path"))
ENDIF
ENDFUNC
FUNC _WINAPI_GETOVERLAPPEDRESULT($HFILE, $POVERLAPPED, BYREF $IBYTES, $FWAIT = FALSE)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "GetOverlappedResult", "handle", $HFILE, "ptr", $POVERLAPPED, "dword*", 0x00000000, "bool", $FWAIT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
$IBYTES = $ARESULT [0x00000003 ]
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETPARENT($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "GetParent", "hwnd", $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETPROCESSAFFINITYMASK($HPROCESS)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "GetProcessAffinityMask", "handle", $HPROCESS, "dword_ptr*", 0x00000000, "dword_ptr*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
LOCAL $AMASK [0x00000003 ]
$AMASK [0x00000000 ]= TRUE
$AMASK [0x00000001 ]= $ARESULT [0x00000002 ]
$AMASK [0x00000002 ]= $ARESULT [0x00000003 ]
RETURN $AMASK
ENDFUNC
FUNC _WINAPI_GETSAVEFILENAME($STITLE = "", $SFILTER = "All files (*.*)", $SINITALDIR = ".", $SDEFAULTFILE = "", $SDEFAULTEXT = "", $IFILTERINDEX = 0x00000001, $IFLAGS = 0x00000000, $IFLAGSEX = 0x00000000, $HWNDOWNER = 0x00000000)
LOCAL $IPATHLEN = 0x00001000
LOCAL $TOFN = DLLSTRUCTCREATE($TAGOPENFILENAME)
LOCAL $AFILES [0x00000001 ]= [0x00000000 ]
LOCAL $IFLAG = $IFLAGS
LOCAL $ASFLINES = STRINGSPLIT($SFILTER, "|")
LOCAL $ASFILTER [$ASFLINES [0x00000000 ]* 0x00000002 + 0x00000001 ]
LOCAL $ISTART, $IFINAL, $STFILTER
$ASFILTER [0x00000000 ]= $ASFLINES [0x00000000 ]* 0x00000002
FOR $I = 0x00000001 TO $ASFLINES [0x00000000 ]
$ISTART = STRINGINSTR($ASFLINES [$I ], "(", 0x00000000, 0x00000001)
$IFINAL = STRINGINSTR($ASFLINES [$I ], ")", 0x00000000, -0x00000001)
$ASFILTER [$I * 0x00000002 - 0x00000001 ]= STRINGSTRIPWS(STRINGLEFT($ASFLINES [$I ], $ISTART - 0x00000001), 0x00000003)
$ASFILTER [$I * 0x00000002 ]= STRINGSTRIPWS(STRINGTRIMRIGHT(STRINGTRIMLEFT($ASFLINES [$I ], $ISTART), STRINGLEN($ASFLINES [$I ]) - $IFINAL + 0x00000001), 0x00000003)
$STFILTER &= "wchar["& STRINGLEN($ASFILTER [$I * 0x00000002 - 0x00000001 ]) + 0x00000001 & "];wchar["& STRINGLEN($ASFILTER [$I * 0x00000002 ]) + 0x00000001 & "];"
NEXT
LOCAL $TTITLE = DLLSTRUCTCREATE("wchar Title["& STRINGLEN($STITLE) + 0x00000001 & "]")
LOCAL $TINITIALDIR = DLLSTRUCTCREATE("wchar InitDir["& STRINGLEN($SINITALDIR) + 0x00000001 & "]")
LOCAL $TFILTER = DLLSTRUCTCREATE($STFILTER & "wchar")
LOCAL $TPATH = DLLSTRUCTCREATE("wchar Path["& $IPATHLEN & "]")
LOCAL $TEXTN = DLLSTRUCTCREATE("wchar Extension["& STRINGLEN($SDEFAULTEXT) + 0x00000001 & "]")
FOR $I = 0x00000001 TO $ASFILTER [0x00000000 ]
DLLSTRUCTSETDATA($TFILTER, $I, $ASFILTER [$I ])
NEXT
DLLSTRUCTSETDATA($TTITLE, "Title", $STITLE)
DLLSTRUCTSETDATA($TINITIALDIR, "InitDir", $SINITALDIR)
DLLSTRUCTSETDATA($TPATH, "Path", $SDEFAULTFILE)
DLLSTRUCTSETDATA($TEXTN, "Extension", $SDEFAULTEXT)
DLLSTRUCTSETDATA($TOFN, "StructSize", DLLSTRUCTGETSIZE($TOFN))
DLLSTRUCTSETDATA($TOFN, "hwndOwner", $HWNDOWNER)
DLLSTRUCTSETDATA($TOFN, "lpstrFilter", DLLSTRUCTGETPTR($TFILTER))
DLLSTRUCTSETDATA($TOFN, "nFilterIndex", $IFILTERINDEX)
DLLSTRUCTSETDATA($TOFN, "lpstrFile", DLLSTRUCTGETPTR($TPATH))
DLLSTRUCTSETDATA($TOFN, "nMaxFile", $IPATHLEN)
DLLSTRUCTSETDATA($TOFN, "lpstrInitialDir", DLLSTRUCTGETPTR($TINITIALDIR))
DLLSTRUCTSETDATA($TOFN, "lpstrTitle", DLLSTRUCTGETPTR($TTITLE))
DLLSTRUCTSETDATA($TOFN, "Flags", $IFLAG)
DLLSTRUCTSETDATA($TOFN, "lpstrDefExt", DLLSTRUCTGETPTR($TEXTN))
DLLSTRUCTSETDATA($TOFN, "FlagsEx", $IFLAGSEX)
DLLCALL("comdlg32.dll", "bool", "GetSaveFileNameW", "ptr", DLLSTRUCTGETPTR($TOFN))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, $AFILES)
RETURN __WINAPI_PARSEFILEDIALOGPATH(DLLSTRUCTGETDATA($TPATH, "Path"))
ENDFUNC
FUNC _WINAPI_GETSTOCKOBJECT($IOBJECT)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "handle", "GetStockObject", "int", $IOBJECT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETSTDHANDLE($ISTDHANDLE)
IF $ISTDHANDLE < 0x00000000 OR $ISTDHANDLE > 0x00000002 THEN RETURN SETERROR(0x00000002, 0x00000000, -0x00000001)
LOCAL CONST $AHANDLE [0x00000003 ]= [- 0x0000000A, -0x0000000B, -0x0000000C ]
LOCAL $ARESULT = DLLCALL("kernel32.dll", "handle", "GetStdHandle", "dword", $AHANDLE [$ISTDHANDLE ])
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, -0x00000001)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETSYSCOLOR($IINDEX)
LOCAL $ARESULT = DLLCALL("user32.dll", "dword", "GetSysColor", "int", $IINDEX)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETSYSCOLORBRUSH($IINDEX)
LOCAL $ARESULT = DLLCALL("user32.dll", "handle", "GetSysColorBrush", "int", $IINDEX)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETSYSTEMMETRICS($IINDEX)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "GetSystemMetrics", "int", $IINDEX)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETTEXTEXTENTPOINT32($HDC, $STEXT)
LOCAL $TSIZE = DLLSTRUCTCREATE($TAGSIZE)
LOCAL $ISIZE = STRINGLEN($STEXT)
DLLCALL("gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $HDC, "wstr", $STEXT, "int", $ISIZE, "ptr", DLLSTRUCTGETPTR($TSIZE))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $TSIZE
ENDFUNC
FUNC _WINAPI_GETWINDOW($HWND, $ICMD)
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "GetWindow", "hwnd", $HWND, "uint", $ICMD)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETWINDOWDC($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "handle", "GetWindowDC", "hwnd", $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETWINDOWHEIGHT($HWND)
LOCAL $TRECT = _WINAPI_GETWINDOWRECT($HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN DLLSTRUCTGETDATA($TRECT, "Bottom") - DLLSTRUCTGETDATA($TRECT, "Top")
ENDFUNC
FUNC _WINAPI_GETWINDOWLONG($HWND, $IINDEX)
LOCAL $SFUNCNAME = "GetWindowLongW"
IF @AUTOITX64 THEN $SFUNCNAME = "GetWindowLongPtrW"
LOCAL $ARESULT = DLLCALL("user32.dll", "long_ptr", $SFUNCNAME, "hwnd", $HWND, "int", $IINDEX)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETWINDOWPLACEMENT($HWND)
LOCAL $TWINDOWPLACEMENT = DLLSTRUCTCREATE($TAGWINDOWPLACEMENT)
DLLSTRUCTSETDATA($TWINDOWPLACEMENT, "length", DLLSTRUCTGETSIZE($TWINDOWPLACEMENT))
LOCAL $PWINDOWPLACEMENT = DLLSTRUCTGETPTR($TWINDOWPLACEMENT)
DLLCALL("user32.dll", "bool", "GetWindowPlacement", "hwnd", $HWND, "ptr", $PWINDOWPLACEMENT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $TWINDOWPLACEMENT
ENDFUNC
FUNC _WINAPI_GETWINDOWRECT($HWND)
LOCAL $TRECT = DLLSTRUCTCREATE($TAGRECT)
DLLCALL("user32.dll", "bool", "GetWindowRect", "hwnd", $HWND, "ptr", DLLSTRUCTGETPTR($TRECT))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $TRECT
ENDFUNC
FUNC _WINAPI_GETWINDOWRGN($HWND, $HRGN)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "GetWindowRgn", "hwnd", $HWND, "handle", $HRGN)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETWINDOWTEXT($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "GetWindowTextW", "hwnd", $HWND, "wstr", "", "int", 0x00001000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, "")
RETURN SETEXTENDED($ARESULT [0x00000000 ], $ARESULT [0x00000002 ])
ENDFUNC
FUNC _WINAPI_GETWINDOWTHREADPROCESSID($HWND, BYREF $IPID)
LOCAL $ARESULT = DLLCALL("user32.dll", "dword", "GetWindowThreadProcessId", "hwnd", $HWND, "dword*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
$IPID = $ARESULT [0x00000002 ]
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_GETWINDOWWIDTH($HWND)
LOCAL $TRECT = _WINAPI_GETWINDOWRECT($HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN DLLSTRUCTGETDATA($TRECT, "Right") - DLLSTRUCTGETDATA($TRECT, "Left")
ENDFUNC
FUNC _WINAPI_GETXYFROMPOINT(BYREF $TPOINT, BYREF $IX, BYREF $IY)
$IX = DLLSTRUCTGETDATA($TPOINT, "X")
$IY = DLLSTRUCTGETDATA($TPOINT, "Y")
ENDFUNC
FUNC _WINAPI_GLOBALMEMORYSTATUS()
LOCAL $TMEM = DLLSTRUCTCREATE($TAGMEMORYSTATUSEX)
LOCAL $PMEM = DLLSTRUCTGETPTR($TMEM)
LOCAL $IMEM = DLLSTRUCTGETSIZE($TMEM)
DLLSTRUCTSETDATA($TMEM, 0x00000001, $IMEM)
DLLCALL("kernel32.dll", "none", "GlobalMemoryStatusEx", "ptr", $PMEM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
LOCAL $AMEM [0x00000007 ]
$AMEM [0x00000000 ]= DLLSTRUCTGETDATA($TMEM, 0x00000002)
$AMEM [0x00000001 ]= DLLSTRUCTGETDATA($TMEM, 0x00000003)
$AMEM [0x00000002 ]= DLLSTRUCTGETDATA($TMEM, 0x00000004)
$AMEM [0x00000003 ]= DLLSTRUCTGETDATA($TMEM, 0x00000005)
$AMEM [0x00000004 ]= DLLSTRUCTGETDATA($TMEM, 0x00000006)
$AMEM [0x00000005 ]= DLLSTRUCTGETDATA($TMEM, 0x00000007)
$AMEM [0x00000006 ]= DLLSTRUCTGETDATA($TMEM, 0x00000008)
RETURN $AMEM
ENDFUNC
FUNC _WINAPI_GUIDFROMSTRING($SGUID)
LOCAL $TGUID = DLLSTRUCTCREATE($TAGGUID)
_WINAPI_GUIDFROMSTRINGEX($SGUID, DLLSTRUCTGETPTR($TGUID))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $TGUID
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 [0x00000000 ]
ENDFUNC
FUNC _WINAPI_HIWORD($ILONG)
RETURN BITSHIFT($ILONG, 0x00000010)
ENDFUNC
FUNC _WINAPI_INPROCESS($HWND, BYREF $HLASTWND)
IF $HWND = $HLASTWND THEN RETURN TRUE
FOR $II = $__GAINPROCESS_WINAPI [0x00000000 ][0x00000000 ]TO 0x00000001 STEP - 0x00000001
IF $HWND = $__GAINPROCESS_WINAPI [$II ][0x00000000 ]THEN
IF $__GAINPROCESS_WINAPI [$II ][0x00000001 ]THEN
$HLASTWND = $HWND
RETURN TRUE
ELSE
RETURN FALSE
ENDIF
ENDIF
NEXT
LOCAL $IPROCESSID
_WINAPI_GETWINDOWTHREADPROCESSID($HWND, $IPROCESSID)
LOCAL $ICOUNT = $__GAINPROCESS_WINAPI [0x00000000 ][0x00000000 ]+ 0x00000001
IF $ICOUNT >= 0x00000040 THEN $ICOUNT = 0x00000001
$__GAINPROCESS_WINAPI [0x00000000 ][0x00000000 ]= $ICOUNT
$__GAINPROCESS_WINAPI [$ICOUNT ][0x00000000 ]= $HWND
$__GAINPROCESS_WINAPI [$ICOUNT ][0x00000001 ]= ($IPROCESSID = @AUTOITPID)
RETURN $__GAINPROCESS_WINAPI [$ICOUNT ][0x00000001 ]
ENDFUNC
FUNC _WINAPI_INTTOFLOAT($IINT)
LOCAL $TINT = DLLSTRUCTCREATE("int")
LOCAL $TFLOAT = DLLSTRUCTCREATE("float", DLLSTRUCTGETPTR($TINT))
DLLSTRUCTSETDATA($TINT, 0x00000001, $IINT)
RETURN DLLSTRUCTGETDATA($TFLOAT, 0x00000001)
ENDFUNC
FUNC _WINAPI_ISCLASSNAME($HWND, $SCLASSNAME)
LOCAL $SSEPARATOR = OPT("GUIDataSeparatorChar")
LOCAL $ACLASSNAME = STRINGSPLIT($SCLASSNAME, $SSEPARATOR)
IF NOT ISHWND($HWND) THEN $HWND = GUICTRLGETHANDLE($HWND)
LOCAL $SCLASSCHECK = _WINAPI_GETCLASSNAME($HWND)
FOR $X = 0x00000001 TO UBOUND($ACLASSNAME) - 0x00000001
IF STRINGUPPER(STRINGMID($SCLASSCHECK, 0x00000001, STRINGLEN($ACLASSNAME [$X ]))) = STRINGUPPER($ACLASSNAME [$X ]) THEN RETURN TRUE
NEXT
RETURN FALSE
ENDFUNC
FUNC _WINAPI_ISWINDOW($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "IsWindow", "hwnd", $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_ISWINDOWVISIBLE($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "IsWindowVisible", "hwnd", $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_INVALIDATERECT($HWND, $TRECT = 0x00000000, $FERASE = TRUE)
LOCAL $PRECT = 0x00000000
IF ISDLLSTRUCT($TRECT) THEN $PRECT = DLLSTRUCTGETPTR($TRECT)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "InvalidateRect", "hwnd", $HWND, "ptr", $PRECT, "bool", $FERASE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_LINETO($HDC, $IX, $IY)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "bool", "LineTo", "handle", $HDC, "int", $IX, "int", $IY)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_LOADBITMAP($HINSTANCE, $SBITMAP)
LOCAL $SBITMAPTYPE = "int"
IF ISSTRING($SBITMAP) THEN $SBITMAPTYPE = "wstr"
LOCAL $ARESULT = DLLCALL("user32.dll", "handle", "LoadBitmapW", "handle", $HINSTANCE, $SBITMAPTYPE, $SBITMAP)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_LOADIMAGE($HINSTANCE, $SIMAGE, $ITYPE, $IXDESIRED, $IYDESIRED, $ILOAD)
LOCAL $ARESULT, $SIMAGETYPE = "int"
IF ISSTRING($SIMAGE) THEN $SIMAGETYPE = "wstr"
$ARESULT = DLLCALL("user32.dll", "handle", "LoadImageW", "handle", $HINSTANCE, $SIMAGETYPE, $SIMAGE, "uint", $ITYPE, "int", $IXDESIRED, "int", $IYDESIRED, "uint", $ILOAD)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_LOADLIBRARY($SFILENAME)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "handle", "LoadLibraryW", "wstr", $SFILENAME)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_LOADLIBRARYEX($SFILENAME, $IFLAGS = 0x00000000)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "handle", "LoadLibraryExW", "wstr", $SFILENAME, "ptr", 0x00000000, "dword", $IFLAGS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_LOADSHELL32ICON($IICONID)
LOCAL $TICONS = DLLSTRUCTCREATE("ptr Data")
LOCAL $PICONS = DLLSTRUCTGETPTR($TICONS)
LOCAL $IICONS = _WINAPI_EXTRACTICONEX("shell32.dll", $IICONID, 0x00000000, $PICONS, 0x00000001)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
IF $IICONS <= 0x00000000 THEN RETURN SETERROR(0x00000001, 0x00000000, 0x00000000)
RETURN DLLSTRUCTGETDATA($TICONS, "Data")
ENDFUNC
FUNC _WINAPI_LOADSTRING($HINSTANCE, $ISTRINGID)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "LoadStringW", "handle", $HINSTANCE, "uint", $ISTRINGID, "wstr", "", "int", 0x00001000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, "")
RETURN SETEXTENDED($ARESULT [0x00000000 ], $ARESULT [0x00000003 ])
ENDFUNC
FUNC _WINAPI_LOCALFREE($HMEM)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "handle", "LocalFree", "handle", $HMEM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_LOWORD($ILONG)
RETURN BITAND($ILONG, 0x0000FFFF)
ENDFUNC
FUNC _WINAPI_MAKELANGID($LGIDPRIMARY, $LGIDSUB)
RETURN BITOR(BITSHIFT($LGIDSUB, -0x0000000A), $LGIDPRIMARY)
ENDFUNC
FUNC _WINAPI_MAKELCID($LGID, $SRTID)
RETURN BITOR(BITSHIFT($SRTID, -0x00000010), $LGID)
ENDFUNC
FUNC _WINAPI_MAKELONG($ILO, $IHI)
RETURN BITOR(BITSHIFT($IHI, -0x00000010), BITAND($ILO, 0x0000FFFF))
ENDFUNC
FUNC _WINAPI_MAKEQWORD($LODWORD, $HIDWORD)
LOCAL $TINT64 = DLLSTRUCTCREATE("uint64")
LOCAL $TDWORDS = DLLSTRUCTCREATE("dword;dword", DLLSTRUCTGETPTR($TINT64))
DLLSTRUCTSETDATA($TDWORDS, 0x00000001, $LODWORD)
DLLSTRUCTSETDATA($TDWORDS, 0x00000002, $HIDWORD)
RETURN DLLSTRUCTGETDATA($TINT64, 0x00000001)
ENDFUNC
FUNC _WINAPI_MESSAGEBEEP($ITYPE = 0x00000001)
LOCAL $ISOUND
SWITCH $ITYPE
CASE 0x00000001
$ISOUND = 0x00000000
CASE 0x00000002
$ISOUND = 0x00000010
CASE 0x00000003
$ISOUND = 0x00000020
CASE 0x00000004
$ISOUND = 0x00000030
CASE 0x00000005
$ISOUND = 0x00000040
CASE ELSE
$ISOUND = -0x00000001
ENDSWITCH
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "MessageBeep", "uint", $ISOUND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_MSGBOX($IFLAGS, $STITLE, $STEXT)
BLOCKINPUT(0x00000000)
MSGBOX($IFLAGS, $STITLE, $STEXT & "      ")
ENDFUNC
FUNC _WINAPI_MOUSE_EVENT($IFLAGS, $IX = 0x00000000, $IY = 0x00000000, $IDATA = 0x00000000, $IEXTRAINFO = 0x00000000)
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($HDC, $IX, $IY)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "bool", "MoveToEx", "handle", $HDC, "int", $IX, "int", $IY, "ptr", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_MOVEWINDOW($HWND, $IX, $IY, $IWIDTH, $IHEIGHT, $FREPAINT = TRUE)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "MoveWindow", "hwnd", $HWND, "int", $IX, "int", $IY, "int", $IWIDTH, "int", $IHEIGHT, "bool", $FREPAINT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
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, -0x00000001)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_MULTIBYTETOWIDECHAR($STEXT, $ICODEPAGE = 0x00000000, $IFLAGS = 0x00000000, $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", -0x00000001, "ptr", 0x00000000, "int", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
LOCAL $IOUT = $ARESULT [0x00000000 ]
LOCAL $TOUT = DLLSTRUCTCREATE("wchar["& $IOUT & "]")
LOCAL $POUT = DLLSTRUCTGETPTR($TOUT)
$ARESULT = DLLCALL("kernel32.dll", "int", "MultiByteToWideChar", "uint", $ICODEPAGE, "dword", $IFLAGS, $STEXTTYPE, $PTEXT, "int", -0x00000001, "ptr", $POUT, "int", $IOUT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
IF $BRETSTRING THEN RETURN DLLSTRUCTGETDATA($TOUT, 0x00000001)
RETURN $TOUT
ENDFUNC
FUNC _WINAPI_MULTIBYTETOWIDECHAREX($STEXT, $PTEXT, $ICODEPAGE = 0x00000000, $IFLAGS = 0x00000000)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "int", "MultiByteToWideChar", "uint", $ICODEPAGE, "dword", $IFLAGS, "STR", $STEXT, "int", -0x00000001, "ptr", $PTEXT, "int", (STRINGLEN($STEXT) + 0x00000001) * 0x00000002)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
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, 0x00000000)
IF $ARESULT [0x00000000 ]THEN RETURN $ARESULT [0x00000000 ]
IF NOT $FDEBUGPRIV THEN RETURN 0x00000000
LOCAL $HTOKEN = _SECURITY__OPENTHREADTOKENEX(BITOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
_SECURITY__SETPRIVILEGE($HTOKEN, "SeDebugPrivilege", TRUE)
LOCAL $IERROR = @ERROR
LOCAL $ILASTERROR = @EXTENDED
LOCAL $IRET = 0x00000000
IF NOT @ERROR THEN
$ARESULT = DLLCALL("kernel32.dll", "handle", "OpenProcess", "dword", $IACCESS, "bool", $FINHERIT, "dword", $IPROCESSID)
$IERROR = @ERROR
$ILASTERROR = @EXTENDED
IF $ARESULT [0x00000000 ]THEN $IRET = $ARESULT [0x00000000 ]
_SECURITY__SETPRIVILEGE($HTOKEN, "SeDebugPrivilege", FALSE)
IF @ERROR THEN
$IERROR = @ERROR
$ILASTERROR = @EXTENDED
ENDIF
ENDIF
_WINAPI_CLOSEHANDLE($HTOKEN)
RETURN SETERROR($IERROR, $ILASTERROR, $IRET)
ENDFUNC
FUNC __WINAPI_PARSEFILEDIALOGPATH($SPATH)
LOCAL $AFILES [0x00000003 ]
$AFILES [0x00000000 ]= 0x00000002
LOCAL $STEMP = STRINGMID($SPATH, 0x00000001, STRINGINSTR($SPATH, "\", 0x00000000, -0x00000001) - 0x00000001)
$AFILES [0x00000001 ]= $STEMP
$AFILES [0x00000002 ]= STRINGMID($SPATH, STRINGINSTR($SPATH, "\", 0x00000000, -0x00000001) + 0x00000001)
RETURN $AFILES
ENDFUNC
FUNC _WINAPI_PATHFINDONPATH(CONST $SZFILE, $AEXTRAPATHS = "", CONST $SZPATHDELIMITER = @LF)
LOCAL $IEXTRACOUNT = 0x00000000
IF ISSTRING($AEXTRAPATHS) THEN
IF STRINGLEN($AEXTRAPATHS) THEN
$AEXTRAPATHS = STRINGSPLIT($AEXTRAPATHS, $SZPATHDELIMITER, 0x00000001 + 0x00000002)
$IEXTRACOUNT = UBOUND($AEXTRAPATHS, 0x00000001)
ENDIF
ELSEIF ISARRAY($AEXTRAPATHS) THEN
$IEXTRACOUNT = UBOUND($AEXTRAPATHS)
ENDIF
LOCAL $TPATHS, $TPATHPTRS
IF $IEXTRACOUNT THEN
LOCAL $SZSTRUCT = ""
FOR $PATH IN $AEXTRAPATHS
$SZSTRUCT &= "wchar["& STRINGLEN($PATH) + 0x00000001 & "];"
NEXT
$TPATHS = DLLSTRUCTCREATE($SZSTRUCT)
$TPATHPTRS = DLLSTRUCTCREATE("ptr["& $IEXTRACOUNT + 0x00000001 & "]")
FOR $I = 0x00000001 TO $IEXTRACOUNT
DLLSTRUCTSETDATA($TPATHS, $I, $AEXTRAPATHS [$I - 0x00000001 ])
DLLSTRUCTSETDATA($TPATHPTRS, 0x00000001, DLLSTRUCTGETPTR($TPATHS, $I), $I)
NEXT
DLLSTRUCTSETDATA($TPATHPTRS, 0x00000001, PTR(0x00000000), $IEXTRACOUNT + 0x00000001)
ENDIF
LOCAL $ARESULT = DLLCALL("shlwapi.dll", "bool", "PathFindOnPathW", "wstr", $SZFILE, "ptr", DLLSTRUCTGETPTR($TPATHPTRS))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
IF $ARESULT [0x00000000 ]= 0x00000000 THEN RETURN SETERROR(0x00000001, 0x00000000, $SZFILE)
RETURN $ARESULT [0x00000001 ]
ENDFUNC
FUNC _WINAPI_POINTFROMRECT(BYREF $TRECT, $FCENTER = TRUE)
LOCAL $IX1 = DLLSTRUCTGETDATA($TRECT, "Left")
LOCAL $IY1 = DLLSTRUCTGETDATA($TRECT, "Top")
LOCAL $IX2 = DLLSTRUCTGETDATA($TRECT, "Right")
LOCAL $IY2 = DLLSTRUCTGETDATA($TRECT, "Bottom")
IF $FCENTER THEN
$IX1 = $IX1 + (($IX2 - $IX1) / 0x00000002)
$IY1 = $IY1 + (($IY2 - $IY1) / 0x00000002)
ENDIF
LOCAL $TPOINT = DLLSTRUCTCREATE($TAGPOINT)
DLLSTRUCTSETDATA($TPOINT, "X", $IX1)
DLLSTRUCTSETDATA($TPOINT, "Y", $IY1)
RETURN $TPOINT
ENDFUNC
FUNC _WINAPI_POSTMESSAGE($HWND, $IMSG, $IWPARAM, $ILPARAM)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "PostMessage", "hwnd", $HWND, "uint", $IMSG, "wparam", $IWPARAM, "lparam", $ILPARAM)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_PRIMARYLANGID($LGID)
RETURN BITAND($LGID, 0x000003FF)
ENDFUNC
FUNC _WINAPI_PTINRECT(BYREF $TRECT, BYREF $TPOINT)
LOCAL $IX = DLLSTRUCTGETDATA($TPOINT, "X")
LOCAL $IY = DLLSTRUCTGETDATA($TPOINT, "Y")
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "PtInRect", "ptr", DLLSTRUCTGETPTR($TRECT), "long", $IX, "long", $IY)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_READFILE($HFILE, $PBUFFER, $ITOREAD, BYREF $IREAD, $POVERLAPPED = 0x00000000)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "ReadFile", "handle", $HFILE, "ptr", $PBUFFER, "dword", $ITOREAD, "dword*", 0x00000000, "ptr", $POVERLAPPED)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
$IREAD = $ARESULT [0x00000004 ]
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_READPROCESSMEMORY($HPROCESS, $PBASEADDRESS, $PBUFFER, $ISIZE, BYREF $IREAD)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "ReadProcessMemory", "handle", $HPROCESS, "ptr", $PBASEADDRESS, "ptr", $PBUFFER, "ulong_ptr", $ISIZE, "ulong_ptr*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
$IREAD = $ARESULT [0x00000005 ]
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_RECTISEMPTY(BYREF $TRECT)
RETURN (DLLSTRUCTGETDATA($TRECT, "Left") = 0x00000000) AND (DLLSTRUCTGETDATA($TRECT, "Top") = 0x00000000) AND (DLLSTRUCTGETDATA($TRECT, "Right") = 0x00000000) AND (DLLSTRUCTGETDATA($TRECT, "Bottom") = 0x00000000)
ENDFUNC
FUNC _WINAPI_REDRAWWINDOW($HWND, $TRECT = 0x00000000, $HREGION = 0x00000000, $IFLAGS = 0x00000005)
LOCAL $PRECT = 0x00000000
IF $TRECT <> 0x00000000 THEN $PRECT = DLLSTRUCTGETPTR($TRECT)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "RedrawWindow", "hwnd", $HWND, "ptr", $PRECT, "handle", $HREGION, "uint", $IFLAGS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_REGISTERWINDOWMESSAGE($SMESSAGE)
LOCAL $ARESULT = DLLCALL("user32.dll", "uint", "RegisterWindowMessageW", "wstr", $SMESSAGE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_RELEASECAPTURE()
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "ReleaseCapture")
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_RELEASEDC($HWND, $HDC)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "ReleaseDC", "hwnd", $HWND, "handle", $HDC)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SCREENTOCLIENT($HWND, BYREF $TPOINT)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "ScreenToClient", "hwnd", $HWND, "ptr", DLLSTRUCTGETPTR($TPOINT))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SELECTOBJECT($HDC, $HGDIOBJ)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "handle", "SelectObject", "handle", $HDC, "handle", $HGDIOBJ)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETBKCOLOR($HDC, $ICOLOR)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "INT", "SetBkColor", "handle", $HDC, "dword", $ICOLOR)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, -0x00000001)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETBKMODE($HDC, $IBKMODE)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "int", "SetBkMode", "handle", $HDC, "int", $IBKMODE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETCAPTURE($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "SetCapture", "hwnd", $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETCURSOR($HCURSOR)
LOCAL $ARESULT = DLLCALL("user32.dll", "handle", "SetCursor", "handle", $HCURSOR)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETDEFAULTPRINTER($SPRINTER)
LOCAL $ARESULT = DLLCALL("winspool.drv", "bool", "SetDefaultPrinterW", "wstr", $SPRINTER)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETDIBITS($HDC, $HBMP, $ISTARTSCAN, $ISCANLINES, $PBITS, $PBMI, $ICOLORUSE = 0x00000000)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "int", "SetDIBits", "handle", $HDC, "handle", $HBMP, "uint", $ISTARTSCAN, "uint", $ISCANLINES, "ptr", $PBITS, "ptr", $PBMI, "uint", $ICOLORUSE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETENDOFFILE($HFILE)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "SetEndOfFile", "handle", $HFILE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETEVENT($HEVENT)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "SetEvent", "handle", $HEVENT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETFILEPOINTER($HFILE, $IPOS, $IMETHOD = 0x00000000)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "INT", "SetFilePointer", "handle", $HFILE, "long", $IPOS, "ptr", 0x00000000, "long", $IMETHOD)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, -0x00000001)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETFOCUS($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "SetFocus", "hwnd", $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETFONT($HWND, $HFONT, $FREDRAW = TRUE)
_SENDMESSAGE($HWND, $__WINAPICONSTANT_WM_SETFONT, $HFONT, $FREDRAW, 0x00000000, "hwnd")
ENDFUNC
FUNC _WINAPI_SETHANDLEINFORMATION($HOBJECT, $IMASK, $IFLAGS)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "SetHandleInformation", "handle", $HOBJECT, "dword", $IMASK, "dword", $IFLAGS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETLAYEREDWINDOWATTRIBUTES($HWND, $I_TRANSCOLOR, $TRANSPARENCY = 0x000000FF, $DWFLAGS = 0x00000003, $ISCOLORREF = FALSE)
IF $DWFLAGS = DEFAULT OR $DWFLAGS = ""OR $DWFLAGS < 0x00000000 THEN $DWFLAGS = 0x00000003
IF NOT $ISCOLORREF THEN
$I_TRANSCOLOR = HEX(STRING($I_TRANSCOLOR), 0x00000006)
$I_TRANSCOLOR = EXECUTE("0x00"& STRINGMID($I_TRANSCOLOR, 0x00000005, 0x00000002) & STRINGMID($I_TRANSCOLOR, 0x00000003, 0x00000002) & STRINGMID($I_TRANSCOLOR, 0x00000001, 0x00000002))
ENDIF
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "SetLayeredWindowAttributes", "hwnd", $HWND, "dword", $I_TRANSCOLOR, "byte", $TRANSPARENCY, "dword", $DWFLAGS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETPARENT($HWNDCHILD, $HWNDPARENT)
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "SetParent", "hwnd", $HWNDCHILD, "hwnd", $HWNDPARENT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETPROCESSAFFINITYMASK($HPROCESS, $IMASK)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "SetProcessAffinityMask", "handle", $HPROCESS, "ulong_ptr", $IMASK)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETSYSCOLORS($VELEMENTS, $VCOLORS)
LOCAL $ISEARRAY = ISARRAY($VELEMENTS), $ISCARRAY = ISARRAY($VCOLORS)
LOCAL $IELEMENTNUM
IF NOT $ISCARRAY AND NOT $ISEARRAY THEN
$IELEMENTNUM = 0x00000001
ELSEIF $ISCARRAY OR $ISEARRAY THEN
IF NOT $ISCARRAY OR NOT $ISEARRAY THEN RETURN SETERROR(- 0x00000001, -0x00000001, FALSE)
IF UBOUND($VELEMENTS) <> UBOUND($VCOLORS) THEN RETURN SETERROR(- 0x00000001, -0x00000001, FALSE)
$IELEMENTNUM = UBOUND($VELEMENTS)
ENDIF
LOCAL $TELEMENTS = DLLSTRUCTCREATE("int Element["& $IELEMENTNUM & "]")
LOCAL $TCOLORS = DLLSTRUCTCREATE("dword NewColor["& $IELEMENTNUM & "]")
LOCAL $PELEMENTS = DLLSTRUCTGETPTR($TELEMENTS)
LOCAL $PCOLORS = DLLSTRUCTGETPTR($TCOLORS)
IF NOT $ISEARRAY THEN
DLLSTRUCTSETDATA($TELEMENTS, "Element", $VELEMENTS, 0x00000001)
ELSE
FOR $X = 0x00000000 TO $IELEMENTNUM - 0x00000001
DLLSTRUCTSETDATA($TELEMENTS, "Element", $VELEMENTS [$X ], $X + 0x00000001)
NEXT
ENDIF
IF NOT $ISCARRAY THEN
DLLSTRUCTSETDATA($TCOLORS, "NewColor", $VCOLORS, 0x00000001)
ELSE
FOR $X = 0x00000000 TO $IELEMENTNUM - 0x00000001
DLLSTRUCTSETDATA($TCOLORS, "NewColor", $VCOLORS [$X ], $X + 0x00000001)
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 [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETTEXTCOLOR($HDC, $ICOLOR)
LOCAL $ARESULT = DLLCALL("gdi32.dll", "INT", "SetTextColor", "handle", $HDC, "dword", $ICOLOR)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, -0x00000001)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETWINDOWLONG($HWND, $IINDEX, $IVALUE)
_WINAPI_SETLASTERROR(0x00000000)
LOCAL $SFUNCNAME = "SetWindowLongW"
IF @AUTOITX64 THEN $SFUNCNAME = "SetWindowLongPtrW"
LOCAL $ARESULT = DLLCALL("user32.dll", "long_ptr", $SFUNCNAME, "hwnd", $HWND, "int", $IINDEX, "long_ptr", $IVALUE)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETWINDOWPLACEMENT($HWND, $PWINDOWPLACEMENT)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "SetWindowPlacement", "hwnd", $HWND, "ptr", $PWINDOWPLACEMENT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETWINDOWPOS($HWND, $HAFTER, $IX, $IY, $ICX, $ICY, $IFLAGS)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "SetWindowPos", "hwnd", $HWND, "hwnd", $HAFTER, "int", $IX, "int", $IY, "int", $ICX, "int", $ICY, "uint", $IFLAGS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETWINDOWRGN($HWND, $HRGN, $BREDRAW = TRUE)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "SetWindowRgn", "hwnd", $HWND, "handle", $HRGN, "bool", $BREDRAW)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETWINDOWSHOOKEX($IDHOOK, $LPFN, $HMOD, $DWTHREADID = 0x00000000)
LOCAL $ARESULT = DLLCALL("user32.dll", "handle", "SetWindowsHookEx", "int", $IDHOOK, "ptr", $LPFN, "handle", $HMOD, "dword", $DWTHREADID)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SETWINDOWTEXT($HWND, $STEXT)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "SetWindowTextW", "hwnd", $HWND, "wstr", $STEXT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SHOWCURSOR($FSHOW)
LOCAL $ARESULT = DLLCALL("user32.dll", "int", "ShowCursor", "bool", $FSHOW)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_SHOWERROR($STEXT, $FEXIT = TRUE)
_WINAPI_MSGBOX(0x00041010, "Error", $STEXT)
IF $FEXIT THEN EXIT
ENDFUNC
FUNC _WINAPI_SHOWMSG($STEXT)
_WINAPI_MSGBOX(0x00000040 + 0x00001000, "Information", $STEXT)
ENDFUNC
FUNC _WINAPI_SHOWWINDOW($HWND, $ICMDSHOW = 0x00000005)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "ShowWindow", "hwnd", $HWND, "int", $ICMDSHOW)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_STRINGFROMGUID($PGUID)
LOCAL $ARESULT = DLLCALL("ole32.dll", "int", "StringFromGUID2", "ptr", $PGUID, "wstr", "", "int", 0x00000028)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, "")
RETURN SETEXTENDED($ARESULT [0x00000000 ], $ARESULT [0x00000002 ])
ENDFUNC
FUNC _WINAPI_SUBLANGID($LGID)
RETURN BITSHIFT($LGID, 0x0000000A)
ENDFUNC
FUNC _WINAPI_SYSTEMPARAMETERSINFO($IACTION, $IPARAM = 0x00000000, $VPARAM = 0x00000000, $IWININI = 0x00000000)
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 [0x00000000 ]
ENDFUNC
FUNC _WINAPI_TWIPSPERPIXELX()
LOCAL $LNGDC, $TWIPSPERPIXELX
$LNGDC = _WINAPI_GETDC(0x00000000)
$TWIPSPERPIXELX = 0x000005A0 / _WINAPI_GETDEVICECAPS($LNGDC, $__WINAPICONSTANT_LOGPIXELSX)
_WINAPI_RELEASEDC(0x00000000, $LNGDC)
RETURN $TWIPSPERPIXELX
ENDFUNC
FUNC _WINAPI_TWIPSPERPIXELY()
LOCAL $LNGDC, $TWIPSPERPIXELY
$LNGDC = _WINAPI_GETDC(0x00000000)
$TWIPSPERPIXELY = 0x000005A0 / _WINAPI_GETDEVICECAPS($LNGDC, $__WINAPICONSTANT_LOGPIXELSY)
_WINAPI_RELEASEDC(0x00000000, $LNGDC)
RETURN $TWIPSPERPIXELY
ENDFUNC
FUNC _WINAPI_UNHOOKWINDOWSHOOKEX($HHK)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "UnhookWindowsHookEx", "handle", $HHK)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_UPDATELAYEREDWINDOW($HWND, $HDCDEST, $PPTDEST, $PSIZE, $HDCSRCE, $PPTSRCE, $IRGB, $PBLEND, $IFLAGS)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "UpdateLayeredWindow", "hwnd", $HWND, "handle", $HDCDEST, "ptr", $PPTDEST, "ptr", $PSIZE, "handle", $HDCSRCE, "ptr", $PPTSRCE, "dword", $IRGB, "ptr", $PBLEND, "dword", $IFLAGS)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_UPDATEWINDOW($HWND)
LOCAL $ARESULT = DLLCALL("user32.dll", "bool", "UpdateWindow", "hwnd", $HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_WAITFORINPUTIDLE($HPROCESS, $ITIMEOUT = -0x00000001)
LOCAL $ARESULT = DLLCALL("user32.dll", "dword", "WaitForInputIdle", "handle", $HPROCESS, "dword", $ITIMEOUT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_WAITFORMULTIPLEOBJECTS($ICOUNT, $PHANDLES, $FWAITALL = FALSE, $ITIMEOUT = -0x00000001)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "INT", "WaitForMultipleObjects", "dword", $ICOUNT, "ptr", $PHANDLES, "bool", $FWAITALL, "dword", $ITIMEOUT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, -0x00000001)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_WAITFORSINGLEOBJECT($HHANDLE, $ITIMEOUT = -0x00000001)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "INT", "WaitForSingleObject", "handle", $HHANDLE, "dword", $ITIMEOUT)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, -0x00000001)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_WIDECHARTOMULTIBYTE($PUNICODE, $ICODEPAGE = 0x00000000, $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", 0x00000000, $SUNICODETYPE, $PUNICODE, "int", -0x00000001, "ptr", 0x00000000, "int", 0x00000000, "ptr", 0x00000000, "ptr", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, "")
LOCAL $TMULTIBYTE = DLLSTRUCTCREATE("char["& $ARESULT [0x00000000 ]& "]")
LOCAL $PMULTIBYTE = DLLSTRUCTGETPTR($TMULTIBYTE)
$ARESULT = DLLCALL("kernel32.dll", "int", "WideCharToMultiByte", "uint", $ICODEPAGE, "dword", 0x00000000, $SUNICODETYPE, $PUNICODE, "int", -0x00000001, "ptr", $PMULTIBYTE, "int", $ARESULT [0x00000000 ], "ptr", 0x00000000, "ptr", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, "")
IF $BRETSTRING THEN RETURN DLLSTRUCTGETDATA($TMULTIBYTE, 0x00000001)
RETURN $TMULTIBYTE
ENDFUNC
FUNC _WINAPI_WINDOWFROMPOINT(BYREF $TPOINT)
LOCAL $TPOINTCAST = DLLSTRUCTCREATE("int64", DLLSTRUCTGETPTR($TPOINT))
LOCAL $ARESULT = DLLCALL("user32.dll", "hwnd", "WindowFromPoint", "int64", DLLSTRUCTGETDATA($TPOINTCAST, 0x00000001))
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_WRITECONSOLE($HCONSOLE, $STEXT)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "WriteConsoleW", "handle", $HCONSOLE, "wstr", $STEXT, "dword", STRINGLEN($STEXT), "dword*", 0x00000000, "ptr", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_WRITEFILE($HFILE, $PBUFFER, $ITOWRITE, BYREF $IWRITTEN, $POVERLAPPED = 0x00000000)
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "WriteFile", "handle", $HFILE, "ptr", $PBUFFER, "dword", $ITOWRITE, "dword*", 0x00000000, "ptr", $POVERLAPPED)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
$IWRITTEN = $ARESULT [0x00000004 ]
RETURN $ARESULT [0x00000000 ]
ENDFUNC
FUNC _WINAPI_WRITEPROCESSMEMORY($HPROCESS, $PBASEADDRESS, $PBUFFER, $ISIZE, BYREF $IWRITTEN, $SBUFFER = "ptr")
LOCAL $ARESULT = DLLCALL("kernel32.dll", "bool", "WriteProcessMemory", "handle", $HPROCESS, "ptr", $PBASEADDRESS, $SBUFFER, $PBUFFER, "ulong_ptr", $ISIZE, "ulong_ptr*", 0x00000000)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
$IWRITTEN = $ARESULT [0x00000005 ]
RETURN $ARESULT [0x00000000 ]
ENDFUNC
GLOBAL CONST $_UDF_GLOBALIDS_OFFSET = 0x00000002
GLOBAL CONST $_UDF_GLOBALID_MAX_WIN = 0x00000010
GLOBAL CONST $_UDF_STARTID = 0x00002710
GLOBAL CONST $_UDF_GLOBALID_MAX_IDS = 0x0000D8EF
GLOBAL CONST $__UDFGUICONSTANT_WS_VISIBLE = 0x10000000
GLOBAL CONST $__UDFGUICONSTANT_WS_CHILD = 0x40000000
GLOBAL $_UDF_GLOBALIDS_USED [$_UDF_GLOBALID_MAX_WIN ][$_UDF_GLOBALID_MAX_IDS + $_UDF_GLOBALIDS_OFFSET + 0x00000001 ]
FUNC __UDF_GETNEXTGLOBALID($HWND)
LOCAL $NCTRLID, $IUSEDINDEX = -0x00000001, $FALLUSED = TRUE
IF NOT WINEXISTS($HWND) THEN RETURN SETERROR(- 0x00000001, -0x00000001, 0x00000000)
FOR $IINDEX = 0x00000000 TO $_UDF_GLOBALID_MAX_WIN - 0x00000001
IF $_UDF_GLOBALIDS_USED [$IINDEX ][0x00000000 ]<> 0x00000000 THEN
IF NOT WINEXISTS($_UDF_GLOBALIDS_USED [$IINDEX ][0x00000000 ]) THEN
FOR $X = 0x00000000 TO UBOUND($_UDF_GLOBALIDS_USED, 0x00000002) - 0x00000001
$_UDF_GLOBALIDS_USED [$IINDEX ][$X ]= 0x00000000
NEXT
$_UDF_GLOBALIDS_USED [$IINDEX ][0x00000001 ]= $_UDF_STARTID
$FALLUSED = FALSE
ENDIF
ENDIF
NEXT
FOR $IINDEX = 0x00000000 TO $_UDF_GLOBALID_MAX_WIN - 0x00000001
IF $_UDF_GLOBALIDS_USED [$IINDEX ][0x00000000 ]= $HWND THEN
$IUSEDINDEX = $IINDEX
EXITLOOP
ENDIF
NEXT
IF $IUSEDINDEX = -0x00000001 THEN
FOR $IINDEX = 0x00000000 TO $_UDF_GLOBALID_MAX_WIN - 0x00000001
IF $_UDF_GLOBALIDS_USED [$IINDEX ][0x00000000 ]= 0x00000000 THEN
$_UDF_GLOBALIDS_USED [$IINDEX ][0x00000000 ]= $HWND
$_UDF_GLOBALIDS_USED [$IINDEX ][0x00000001 ]= $_UDF_STARTID
$FALLUSED = FALSE
$IUSEDINDEX = $IINDEX
EXITLOOP
ENDIF
NEXT
ENDIF
IF $IUSEDINDEX = -0x00000001 AND $FALLUSED THEN RETURN SETERROR(0x00000010, 0x00000000, 0x00000000)
IF $_UDF_GLOBALIDS_USED [$IUSEDINDEX ][0x00000001 ]= $_UDF_STARTID + $_UDF_GLOBALID_MAX_IDS THEN
FOR $IIDINDEX = $_UDF_GLOBALIDS_OFFSET TO UBOUND($_UDF_GLOBALIDS_USED, 0x00000002) - 0x00000001
IF $_UDF_GLOBALIDS_USED [$IUSEDINDEX ][$IIDINDEX ]= 0x00000000 THEN
$NCTRLID = ($IIDINDEX - $_UDF_GLOBALIDS_OFFSET) + 0x00002710
$_UDF_GLOBALIDS_USED [$IUSEDINDEX ][$IIDINDEX ]= $NCTRLID
RETURN $NCTRLID
ENDIF
NEXT
RETURN SETERROR(- 0x00000001, $_UDF_GLOBALID_MAX_IDS, 0x00000000)
ENDIF
$NCTRLID = $_UDF_GLOBALIDS_USED [$IUSEDINDEX ][0x00000001 ]
$_UDF_GLOBALIDS_USED [$IUSEDINDEX ][0x00000001 ]+= 0x00000001
$_UDF_GLOBALIDS_USED [$IUSEDINDEX ][($NCTRLID - 0x00002710) + $_UDF_GLOBALIDS_OFFSET ]= $NCTRLID
RETURN $NCTRLID
ENDFUNC
FUNC __UDF_FREEGLOBALID($HWND, $IGLOBALID)
IF $IGLOBALID - $_UDF_STARTID < 0x00000000 OR $IGLOBALID - $_UDF_STARTID > $_UDF_GLOBALID_MAX_IDS THEN RETURN SETERROR(- 0x00000001, 0x00000000, FALSE)
FOR $IINDEX = 0x00000000 TO $_UDF_GLOBALID_MAX_WIN - 0x00000001
IF $_UDF_GLOBALIDS_USED [$IINDEX ][0x00000000 ]= $HWND THEN
FOR $X = $_UDF_GLOBALIDS_OFFSET TO UBOUND($_UDF_GLOBALIDS_USED, 0x00000002) - 0x00000001
IF $_UDF_GLOBALIDS_USED [$IINDEX ][$X ]= $IGLOBALID THEN
$_UDF_GLOBALIDS_USED [$IINDEX ][$X ]= 0x00000000
RETURN TRUE
ENDIF
NEXT
RETURN SETERROR(- 0x00000003, 0x00000000, FALSE)
ENDIF
NEXT
RETURN SETERROR(- 0x00000002, 0x00000000, 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, 0x00000001)
ENDFUNC
FUNC __UDF_VALIDATECLASSNAME($HWND, $SCLASSNAMES)
__UDF_DEBUGPRINT("This is for debugging only, set the debug variable to false before submitting")
IF _WINAPI_ISCLASSNAME($HWND, $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($HWND))
EXIT
ENDFUNC
GLOBAL $__GHSBLASTWND
GLOBAL $DEBUG_SB = FALSE
GLOBAL CONST $__STATUSBARCONSTANT_CLASSNAME = "msctls_statusbar32"
GLOBAL CONST $__STATUSBARCONSTANT_WM_SIZE = 0x00000005
GLOBAL CONST $__STATUSBARCONSTANT_CLR_DEFAULT = 0xFF000000
GLOBAL CONST $TAGBORDERS = "int BX;int BY;int RX"
FUNC _GUICTRLSTATUSBAR_CREATE($HWND, $VPARTEDGE = -0x00000001, $VPARTTEXT = "", $ISTYLES = -0x00000001, $IEXSTYLES = -0x00000001)
IF NOT ISHWND($HWND) THEN RETURN SETERROR(0x00000001, 0x00000000, 0x00000000)
LOCAL $ISTYLE = BITOR($__UDFGUICONSTANT_WS_CHILD, $__UDFGUICONSTANT_WS_VISIBLE)
IF $ISTYLES = -0x00000001 THEN $ISTYLES = 0x00000000
IF $IEXSTYLES = -0x00000001 THEN $IEXSTYLES = 0x00000000
LOCAL $APARTWIDTH [0x00000001 ], $APARTTEXT [0x00000001 ]
IF @NUMPARAMS > 0x00000001 THEN
IF ISARRAY($VPARTEDGE) THEN
$APARTWIDTH = $VPARTEDGE
ELSE
$APARTWIDTH [0x00000000 ]= $VPARTEDGE
ENDIF
IF @NUMPARAMS = 0x00000002 THEN
REDIM $APARTTEXT [UBOUND($APARTWIDTH) ]
ELSE
IF ISARRAY($VPARTTEXT) THEN
$APARTTEXT = $VPARTTEXT
ELSE
$APARTTEXT [0x00000000 ]= $VPARTTEXT
ENDIF
IF UBOUND($APARTWIDTH) <> UBOUND($APARTTEXT) THEN
LOCAL $ILAST
IF UBOUND($APARTWIDTH) > UBOUND($APARTTEXT) THEN
$ILAST = UBOUND($APARTTEXT)
REDIM $APARTTEXT [UBOUND($APARTWIDTH) ]
FOR $X = $ILAST TO UBOUND($APARTTEXT) - 0x00000001
$APARTWIDTH [$X ]= ""
NEXT
ELSE
$ILAST = UBOUND($APARTWIDTH)
REDIM $APARTWIDTH [UBOUND($APARTTEXT) ]
FOR $X = $ILAST TO UBOUND($APARTWIDTH) - 0x00000001
$APARTWIDTH [$X ]= $APARTWIDTH [$X - 0x00000001 ]+ 0x0000004B
NEXT
$APARTWIDTH [UBOUND($APARTTEXT) - 0x00000001 ]= -0x00000001
ENDIF
ENDIF
ENDIF
IF NOT ISHWND($HWND) THEN $HWND = HWND($HWND)
IF @NUMPARAMS > 0x00000003 THEN $ISTYLE = BITOR($ISTYLE, $ISTYLES)
ENDIF
LOCAL $NCTRLID = __UDF_GETNEXTGLOBALID($HWND)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
LOCAL $HWNDSBAR = _WINAPI_CREATEWINDOWEX($IEXSTYLES, $__STATUSBARCONSTANT_CLASSNAME, "", $ISTYLE, 0x00000000, 0x00000000, 0x00000000, 0x00000000, $HWND, $NCTRLID)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, 0x00000000)
IF @NUMPARAMS > 0x00000001 THEN
_GUICTRLSTATUSBAR_SETPARTS($HWNDSBAR, UBOUND($APARTWIDTH), $APARTWIDTH)
FOR $X = 0x00000000 TO UBOUND($APARTTEXT) - 0x00000001
_GUICTRLSTATUSBAR_SETTEXT($HWNDSBAR, $APARTTEXT [$X ], $X)
NEXT
ENDIF
RETURN $HWNDSBAR
ENDFUNC
FUNC _GUICTRLSTATUSBAR_DESTROY(BYREF $HWND)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
IF NOT _WINAPI_ISCLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME) THEN RETURN SETERROR(0x00000002, 0x00000002, FALSE)
LOCAL $DESTROYED = 0x00000000
IF ISHWND($HWND) THEN
IF _WINAPI_INPROCESS($HWND, $__GHSBLASTWND) THEN
LOCAL $NCTRLID = _WINAPI_GETDLGCTRLID($HWND)
LOCAL $HPARENT = _WINAPI_GETPARENT($HWND)
$DESTROYED = _WINAPI_DESTROYWINDOW($HWND)
LOCAL $IRET = __UDF_FREEGLOBALID($HPARENT, $NCTRLID)
IF NOT $IRET THEN
ENDIF
ELSE
RETURN SETERROR(0x00000001, 0x00000001, FALSE)
ENDIF
ENDIF
IF $DESTROYED THEN $HWND = 0x00000000
RETURN $DESTROYED <> 0x00000000
ENDFUNC
FUNC _GUICTRLSTATUSBAR_EMBEDCONTROL($HWND, $IPART, $HCONTROL, $IFIT = 0x00000004)
LOCAL $ARECT = _GUICTRLSTATUSBAR_GETRECT($HWND, $IPART)
LOCAL $IBARX = $ARECT [0x00000000 ]
LOCAL $IBARY = $ARECT [0x00000001 ]
LOCAL $IBARW = $ARECT [0x00000002 ]- $IBARX
LOCAL $IBARH = $ARECT [0x00000003 ]- $IBARY
LOCAL $ICONX = $IBARX
LOCAL $ICONY = $IBARY
LOCAL $ICONW = _WINAPI_GETWINDOWWIDTH($HCONTROL)
LOCAL $ICONH = _WINAPI_GETWINDOWHEIGHT($HCONTROL)
IF $ICONW > $IBARW THEN $ICONW = $IBARW
IF $ICONH > $IBARH THEN $ICONH = $IBARH
LOCAL $IPADX = ($IBARW - $ICONW) / 0x00000002
LOCAL $IPADY = ($IBARH - $ICONH) / 0x00000002
IF $IPADX < 0x00000000 THEN $IPADX = 0x00000000
IF $IPADY < 0x00000000 THEN $IPADY = 0x00000000
IF BITAND($IFIT, 0x00000001) = 0x00000001 THEN $ICONX = $IBARX + $IPADX
IF BITAND($IFIT, 0x00000002) = 0x00000002 THEN $ICONY = $IBARY + $IPADY
IF BITAND($IFIT, 0x00000004) = 0x00000004 THEN
$IPADX = _GUICTRLSTATUSBAR_GETBORDERSRECT($HWND)
$IPADY = _GUICTRLSTATUSBAR_GETBORDERSVERT($HWND)
$ICONX = $IBARX
IF _GUICTRLSTATUSBAR_ISSIMPLE($HWND) THEN $ICONX += $IPADX
$ICONY = $IBARY + $IPADY
$ICONW = $IBARW - ($IPADX * 0x00000002)
$ICONH = $IBARH - ($IPADY * 0x00000002)
ENDIF
_WINAPI_SETPARENT($HCONTROL, $HWND)
_WINAPI_MOVEWINDOW($HCONTROL, $ICONX, $ICONY, $ICONW, $ICONH)
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETBORDERS($HWND)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
LOCAL $TBORDERS = DLLSTRUCTCREATE($TAGBORDERS)
LOCAL $PBORDERS = DLLSTRUCTGETPTR($TBORDERS)
LOCAL $IRET
IF _WINAPI_INPROCESS($HWND, $__GHSBLASTWND) THEN
$IRET = _SENDMESSAGE($HWND, $SB_GETBORDERS, 0x00000000, $PBORDERS, 0x00000000, "wparam", "ptr")
ELSE
LOCAL $ISIZE = DLLSTRUCTGETSIZE($TBORDERS)
LOCAL $TMEMMAP
LOCAL $PMEMORY = _MEMINIT($HWND, $ISIZE, $TMEMMAP)
$IRET = _SENDMESSAGE($HWND, $SB_GETBORDERS, 0x00000000, $PMEMORY, 0x00000000, "wparam", "ptr")
_MEMREAD($TMEMMAP, $PMEMORY, $PBORDERS, $ISIZE)
_MEMFREE($TMEMMAP)
ENDIF
LOCAL $ABORDERS [0x00000003 ]
IF $IRET = 0x00000000 THEN RETURN SETERROR(- 0x00000001, -0x00000001, $ABORDERS)
$ABORDERS [0x00000000 ]= DLLSTRUCTGETDATA($TBORDERS, "BX")
$ABORDERS [0x00000001 ]= DLLSTRUCTGETDATA($TBORDERS, "BY")
$ABORDERS [0x00000002 ]= DLLSTRUCTGETDATA($TBORDERS, "RX")
RETURN $ABORDERS
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETBORDERSHORZ($HWND)
LOCAL $ABORDERS = _GUICTRLSTATUSBAR_GETBORDERS($HWND)
RETURN SETERROR(@ERROR, @EXTENDED, $ABORDERS [0x00000000 ])
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETBORDERSRECT($HWND)
LOCAL $ABORDERS = _GUICTRLSTATUSBAR_GETBORDERS($HWND)
RETURN SETERROR(@ERROR, @EXTENDED, $ABORDERS [0x00000002 ])
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETBORDERSVERT($HWND)
LOCAL $ABORDERS = _GUICTRLSTATUSBAR_GETBORDERS($HWND)
RETURN SETERROR(@ERROR, @EXTENDED, $ABORDERS [0x00000001 ])
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETCOUNT($HWND)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
RETURN _SENDMESSAGE($HWND, $SB_GETPARTS)
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETHEIGHT($HWND)
LOCAL $TRECT = _GUICTRLSTATUSBAR_GETRECTEX($HWND, 0x00000000)
RETURN DLLSTRUCTGETDATA($TRECT, "Bottom") - DLLSTRUCTGETDATA($TRECT, "Top") - (_GUICTRLSTATUSBAR_GETBORDERSVERT($HWND) * 0x00000002)
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETICON($HWND, $IINDEX = 0x00000000)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
RETURN _SENDMESSAGE($HWND, $SB_GETICON, $IINDEX, 0x00000000, 0x00000000, "wparam", "lparam", "hwnd")
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETPARTS($HWND)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
LOCAL $ICOUNT = _GUICTRLSTATUSBAR_GETCOUNT($HWND)
LOCAL $TPARTS = DLLSTRUCTCREATE("int["& $ICOUNT & "]")
LOCAL $PPARTS = DLLSTRUCTGETPTR($TPARTS)
LOCAL $APARTS [$ICOUNT + 0x00000001 ]
IF _WINAPI_INPROCESS($HWND, $__GHSBLASTWND) THEN
$APARTS [0x00000000 ]= _SENDMESSAGE($HWND, $SB_GETPARTS, $ICOUNT, $PPARTS, 0x00000000, "wparam", "ptr")
ELSE
LOCAL $IPARTS = DLLSTRUCTGETSIZE($TPARTS)
LOCAL $TMEMMAP
LOCAL $PMEMORY = _MEMINIT($HWND, $IPARTS, $TMEMMAP)
$APARTS [0x00000000 ]= _SENDMESSAGE($HWND, $SB_GETPARTS, $ICOUNT, $PMEMORY, 0x00000000, "wparam", "ptr")
_MEMREAD($TMEMMAP, $PMEMORY, $PPARTS, $IPARTS)
_MEMFREE($TMEMMAP)
ENDIF
FOR $II = 0x00000001 TO $ICOUNT
$APARTS [$II ]= DLLSTRUCTGETDATA($TPARTS, 0x00000001, $II)
NEXT
RETURN $APARTS
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETRECT($HWND, $IPART)
LOCAL $TRECT = _GUICTRLSTATUSBAR_GETRECTEX($HWND, $IPART)
IF @ERROR THEN RETURN SETERROR(@ERROR, 0x00000000, 0x00000000)
LOCAL $ARECT [0x00000004 ]
$ARECT [0x00000000 ]= DLLSTRUCTGETDATA($TRECT, "Left")
$ARECT [0x00000001 ]= DLLSTRUCTGETDATA($TRECT, "Top")
$ARECT [0x00000002 ]= DLLSTRUCTGETDATA($TRECT, "Right")
$ARECT [0x00000003 ]= DLLSTRUCTGETDATA($TRECT, "Bottom")
RETURN $ARECT
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETRECTEX($HWND, $IPART)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
LOCAL $TRECT = DLLSTRUCTCREATE($TAGRECT)
LOCAL $PRECT = DLLSTRUCTGETPTR($TRECT)
LOCAL $IRET
IF _WINAPI_INPROCESS($HWND, $__GHSBLASTWND) THEN
$IRET = _SENDMESSAGE($HWND, $SB_GETRECT, $IPART, $PRECT, 0x00000000, "wparam", "ptr")
ELSE
LOCAL $IRECT = DLLSTRUCTGETSIZE($TRECT)
LOCAL $TMEMMAP
LOCAL $PMEMORY = _MEMINIT($HWND, $IRECT, $TMEMMAP)
$IRET = _SENDMESSAGE($HWND, $SB_GETRECT, $IPART, $PMEMORY, 0x00000000, "wparam", "ptr")
_MEMREAD($TMEMMAP, $PMEMORY, $PRECT, $IRECT)
_MEMFREE($TMEMMAP)
ENDIF
RETURN SETERROR($IRET = 0x00000000, 0x00000000, $TRECT)
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETTEXT($HWND, $IPART)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
LOCAL $FUNICODE = _GUICTRLSTATUSBAR_GETUNICODEFORMAT($HWND)
LOCAL $IBUFFER = _GUICTRLSTATUSBAR_GETTEXTLENGTH($HWND, $IPART)
IF $IBUFFER = 0x00000000 THEN RETURN SETERROR(0x00000001, 0x00000000, "")
LOCAL $TBUFFER
IF $FUNICODE THEN
$TBUFFER = DLLSTRUCTCREATE("wchar Text["& $IBUFFER & "]")
$IBUFFER *= 0x00000002
ELSE
$TBUFFER = DLLSTRUCTCREATE("char Text["& $IBUFFER & "]")
ENDIF
LOCAL $PBUFFER = DLLSTRUCTGETPTR($TBUFFER)
IF _WINAPI_INPROCESS($HWND, $__GHSBLASTWND) THEN
_SENDMESSAGE($HWND, $SB_GETTEXTW, $IPART, $PBUFFER, 0x00000000, "wparam", "ptr")
ELSE
LOCAL $TMEMMAP
LOCAL $PMEMORY = _MEMINIT($HWND, $IBUFFER, $TMEMMAP)
IF $FUNICODE THEN
_SENDMESSAGE($HWND, $SB_GETTEXTW, $IPART, $PMEMORY, 0x00000000, "wparam", "ptr")
ELSE
_SENDMESSAGE($HWND, $SB_GETTEXT, $IPART, $PMEMORY, 0x00000000, "wparam", "ptr")
ENDIF
_MEMREAD($TMEMMAP, $PMEMORY, $PBUFFER, $IBUFFER)
_MEMFREE($TMEMMAP)
ENDIF
RETURN DLLSTRUCTGETDATA($TBUFFER, "Text")
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETTEXTFLAGS($HWND, $IPART)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
IF _GUICTRLSTATUSBAR_GETUNICODEFORMAT($HWND) THEN
RETURN _SENDMESSAGE($HWND, $SB_GETTEXTLENGTHW, $IPART)
ELSE
RETURN _SENDMESSAGE($HWND, $SB_GETTEXTLENGTH, $IPART)
ENDIF
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETTEXTLENGTH($HWND, $IPART)
RETURN _WINAPI_LOWORD(_GUICTRLSTATUSBAR_GETTEXTFLAGS($HWND, $IPART))
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETTEXTLENGTHEX($HWND, $IPART)
RETURN _WINAPI_HIWORD(_GUICTRLSTATUSBAR_GETTEXTFLAGS($HWND, $IPART))
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETTIPTEXT($HWND, $IPART)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
LOCAL $FUNICODE = _GUICTRLSTATUSBAR_GETUNICODEFORMAT($HWND)
LOCAL $TBUFFER
IF $FUNICODE THEN
$TBUFFER = DLLSTRUCTCREATE("wchar Text[4096]")
ELSE
$TBUFFER = DLLSTRUCTCREATE("char Text[4096]")
ENDIF
LOCAL $PBUFFER = DLLSTRUCTGETPTR($TBUFFER)
IF _WINAPI_INPROCESS($HWND, $__GHSBLASTWND) THEN
_SENDMESSAGE($HWND, $SB_GETTIPTEXTW, _WINAPI_MAKELONG($IPART, 0x00001000), $PBUFFER, 0x00000000, "wparam", "ptr")
ELSE
LOCAL $TMEMMAP
LOCAL $PMEMORY = _MEMINIT($HWND, 0x00001000, $TMEMMAP)
IF $FUNICODE THEN
_SENDMESSAGE($HWND, $SB_GETTIPTEXTW, _WINAPI_MAKELONG($IPART, 0x00001000), $PMEMORY, 0x00000000, "wparam", "ptr")
ELSE
_SENDMESSAGE($HWND, $SB_GETTIPTEXTA, _WINAPI_MAKELONG($IPART, 0x00001000), $PMEMORY, 0x00000000, "wparam", "ptr")
ENDIF
_MEMREAD($TMEMMAP, $PMEMORY, $PBUFFER, 0x00001000)
_MEMFREE($TMEMMAP)
ENDIF
RETURN DLLSTRUCTGETDATA($TBUFFER, "Text")
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETUNICODEFORMAT($HWND)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
RETURN _SENDMESSAGE($HWND, $SB_GETUNICODEFORMAT) <> 0x00000000
ENDFUNC
FUNC _GUICTRLSTATUSBAR_GETWIDTH($HWND, $IPART)
LOCAL $TRECT = _GUICTRLSTATUSBAR_GETRECTEX($HWND, $IPART)
RETURN DLLSTRUCTGETDATA($TRECT, "Right") - DLLSTRUCTGETDATA($TRECT, "Left") - (_GUICTRLSTATUSBAR_GETBORDERSHORZ($HWND) * 0x00000002)
ENDFUNC
FUNC _GUICTRLSTATUSBAR_ISSIMPLE($HWND)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
RETURN _SENDMESSAGE($HWND, $SB_ISSIMPLE) <> 0x00000000
ENDFUNC
FUNC _GUICTRLSTATUSBAR_RESIZE($HWND)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
_SENDMESSAGE($HWND, $__STATUSBARCONSTANT_WM_SIZE)
ENDFUNC
FUNC _GUICTRLSTATUSBAR_SETBKCOLOR($HWND, $ICOLOR)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
$ICOLOR = _SENDMESSAGE($HWND, $SB_SETBKCOLOR, 0x00000000, $ICOLOR)
IF $ICOLOR = $__STATUSBARCONSTANT_CLR_DEFAULT THEN RETURN "0x"& HEX($__STATUSBARCONSTANT_CLR_DEFAULT)
RETURN $ICOLOR
ENDFUNC
FUNC _GUICTRLSTATUSBAR_SETICON($HWND, $IPART, $HICON = -0x00000001, $SICONFILE = "")
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
IF $HICON = -0x00000001 THEN RETURN _SENDMESSAGE($HWND, $SB_SETICON, $IPART, $HICON, 0x00000000, "wparam", "handle") <> 0x00000000
IF STRINGLEN($SICONFILE) <= 0x00000000 THEN RETURN _SENDMESSAGE($HWND, $SB_SETICON, $IPART, $HICON) <> 0x00000000
LOCAL $TICON = DLLSTRUCTCREATE("handle")
LOCAL $VRESULT = DLLCALL("shell32.dll", "uint", "ExtractIconExW", "wstr", $SICONFILE, "int", $HICON, "ptr", 0x00000000, "ptr", DLLSTRUCTGETPTR($TICON), "uint", 0x00000001)
IF @ERROR THEN RETURN SETERROR(@ERROR, @EXTENDED, FALSE)
$VRESULT = $VRESULT [0x00000000 ]
IF $VRESULT > 0x00000000 THEN $VRESULT = _SENDMESSAGE($HWND, $SB_SETICON, $IPART, DLLSTRUCTGETDATA($TICON, 0x00000001), 0x00000000, "wparam", "handle")
DLLCALL("user32.dll", "bool", "DestroyIcon", "handle", DLLSTRUCTGETDATA($TICON, 0x00000001))
RETURN $VRESULT
ENDFUNC
FUNC _GUICTRLSTATUSBAR_SETMINHEIGHT($HWND, $IMINHEIGHT)
IF $DEBUG_SB THEN __UDF_VALIDATECLASSNAME($HWND, $__STATUSBARCONSTANT_CLASSNAME)
_SENDMESSAGE($HWND, $SB_SETMINHEIGHT, $IMINHEIGHT)
_GUICTRLSTATUSBAR_RESIZE($HWND)
ENDFUNC
2016-7-6 22:34
0
游客
登录 | 注册 方可回帖
返回
//