1. Nathan Durnan
  2. AutoIt UDFs

Commits

Nathan Durnan  committed e163d96 Merge

Merge with Development

  • Participants
  • Parent commits 4d25b27, 3512408
  • Branches Master
  • Tags WinAPIEx 3.6

Comments (0)

Files changed (5)

File .hgtimestamp

View file
  • Ignore whitespace
 ProcessExitCode.au3,1325789908.23
-resources.au3,1266028242.0
+resources.au3,1308653282.0
 DriveTools.au3,1310081687.81
 GlobalFSO.au3,1325637915.29
 SMTP_Mailer.au3,1325726068.67
-APIConstants.au3,1319062543.74
-.hgtags,1325793503.09
-WinAPIEx.au3,1319062543.74
-APIErrors.au3,1319062543.74
+APIConstants.au3,1325192176.91
+README.rst,1325790530.38
+WinAPIEx.au3,1325192176.91
+APIErrors.au3,1325192176.91
 GlobalWMI.au3,1310065421.17
 .hgignore,1325784547.36
 GlobalCOM_ErrHandler.au3,1325727958.85
-README.rst,1325790530.38
-.hgtimestamp,1325793503.13
+.hgtimestamp,1325793381.11

File APIConstants.au3

View file
  • Ignore whitespace
     Filename:       APIConstants.au3
     Description:    Constants that can be used with WinAPIEx UDF library
     Author:         Yashied
-    Version:        3.5 / 3.3.6.1
+    Version:        3.6 / 3.3.8.0
     Requirements:   AutoIt v3.3 +, Developed/Tested on Windows XP Pro Service Pack 2 and Windows Vista/7
     Uses:           BorderConstants.au3, Constants.au3, FileConstants.au3, FontConstants.au3, FrameConstants.au3, MemoryConstants.au3, MenuConstants.au3, ProcessConstants.au3, SecurityConstants.au3, WindowsConstants.au3
     Note:           -
 ; Standard Access Rights
 ; ===============================================================================================================================
 
-Global Const $DELETE = 0x00010000
-Global Const $READ_CONTROL = 0x00020000
-Global Const $SYNCHRONIZE = 0x00100000
-Global Const $WRITE_DAC = 0x00040000
-Global Const $WRITE_OWNER = 0x00080000
-
-Global Const $STANDARD_RIGHTS_ALL = BitOR($DELETE, $READ_CONTROL, $SYNCHRONIZE, $WRITE_DAC, $WRITE_OWNER)
-Global Const $STANDARD_RIGHTS_EXECUTE = $READ_CONTROL
-Global Const $STANDARD_RIGHTS_READ = $READ_CONTROL
-Global Const $STANDARD_RIGHTS_REQUIRED = BitOR($DELETE, $READ_CONTROL, $WRITE_DAC, $WRITE_OWNER)
-Global Const $STANDARD_RIGHTS_WRITE = $READ_CONTROL
+;Global Const $DELETE = 0x00010000
+;Global Const $READ_CONTROL = 0x00020000
+;Global Const $SYNCHRONIZE = 0x00100000
+;Global Const $WRITE_DAC = 0x00040000
+;Global Const $WRITE_OWNER = 0x00080000
+
+;Global Const $STANDARD_RIGHTS_ALL = BitOR($DELETE, $READ_CONTROL, $SYNCHRONIZE, $WRITE_DAC, $WRITE_OWNER)
+;Global Const $STANDARD_RIGHTS_EXECUTE = $READ_CONTROL
+;Global Const $STANDARD_RIGHTS_READ = $READ_CONTROL
+;Global Const $STANDARD_RIGHTS_REQUIRED = BitOR($DELETE, $READ_CONTROL, $WRITE_DAC, $WRITE_OWNER)
+;Global Const $STANDARD_RIGHTS_WRITE = $READ_CONTROL
 
 ; ===============================================================================================================================
 ; Window Classes
 ;Global Const $WM_GETTEXTLENGTH = 0x000E
 ;Global Const $WM_PAINT = 0x000F
 ;Global Const $WM_CLOSE = 0x0010
-Global Const $WM_QUERYENDSESSION = 0x0011
+;Global Const $WM_QUERYENDSESSION = 0x0011
 ;Global Const $WM_QUIT = 0x0012
-Global Const $WM_QUERYOPEN = 0x0013
+;Global Const $WM_QUERYOPEN = 0x0013
 ;Global Const $WM_ERASEBKGND = 0x0014
 ;Global Const $WM_SYSCOLORCHANGE = 0x0015
-Global Const $WM_ENDSESSION = 0x0016
+;Global Const $WM_ENDSESSION = 0x0016
 Global Const $WM_SYSTEMERROR = 0x0017
 ;Global Const $WM_SHOWWINDOW = 0x0018
 ;Global Const $WM_CTLCOLOR = 0x0019
-Global Const $WM_SETTINGCHANGE = 0x001A
+;Global Const $WM_SETTINGCHANGE = 0x001A
 ;Global Const $WM_DEVMODECHANGE = 0x001B
 ;Global Const $WM_ACTIVATEAPP = 0x001C
 ;Global Const $WM_FONTCHANGE = 0x001D
 ;Global Const $WM_NCMBUTTONDOWN = 0x00A7
 ;Global Const $WM_NCMBUTTONUP = 0x00A8
 ;Global Const $WM_NCMBUTTONDBLCLK = 0x00A9
-Global Const $WM_NCXBUTTONDOWN = 0x00AB
-Global Const $WM_NCXBUTTONUP = 0x00AC
-Global Const $WM_NCXBUTTONDBLCLK = 0x00AD
+;Global Const $WM_NCXBUTTONDOWN = 0x00AB
+;Global Const $WM_NCXBUTTONUP = 0x00AC
+;Global Const $WM_NCXBUTTONDBLCLK = 0x00AD
 Global Const $WM_NCUAHDRAWCAPTION = 0x00AE
 Global Const $WM_NCUAHDRAWFRAME = 0x00AF
 Global Const $WM_INPUT_DEVICE_CHANGE = 0x00FE
 ;Global Const $WM_SYSCHAR = 0x0106
 ;Global Const $WM_SYSDEADCHAR = 0x0107
 Global Const $WM_YOMICHAR = 0x0108
-Global Const $WM_UNICHAR = 0x0109
+;Global Const $WM_UNICHAR = 0x0109
 Global Const $WM_CONVERTREQUEST = 0x010A
 Global Const $WM_CONVERTRESULT = 0x010B
 Global Const $WM_IM_INFO = 0x010C
-Global Const $WM_IME_STARTCOMPOSITION = 0x010D
-Global Const $WM_IME_ENDCOMPOSITION = 0x010E
-Global Const $WM_IME_COMPOSITION = 0x010F
+;Global Const $WM_IME_STARTCOMPOSITION = 0x010D
+;Global Const $WM_IME_ENDCOMPOSITION = 0x010E
+;Global Const $WM_IME_COMPOSITION = 0x010F
 ;Global Const $WM_INITDIALOG = 0x0110
 ;Global Const $WM_COMMAND = 0x0111
 ;Global Const $WM_SYSCOMMAND = 0x0112
 ;Global Const $WM_LBUTTONDBLCLK = 0x0203
 ;Global Const $WM_RBUTTONDOWN = 0x0204
 ;Global Const $WM_RBUTTONUP = 0x0205
-Global Const $WM_RBUTTONDBLCLK = 0x0206
+;Global Const $WM_RBUTTONDBLCLK = 0x0206
 ;Global Const $WM_MBUTTONDOWN = 0x0207
 ;Global Const $WM_MBUTTONUP = 0x0208
-Global Const $WM_MBUTTONDBLCLK = 0x0209
+;Global Const $WM_MBUTTONDBLCLK = 0x0209
 ;Global Const $WM_MOUSEWHEEL = 0x020A
 ;Global Const $WM_XBUTTONDOWN = 0x020B
 ;Global Const $WM_XBUTTONUP = 0x020C
 ;Global Const $WM_XBUTTONDBLCLK = 0x020D
 ;Global Const $WM_MOUSEHWHEEL = 0x020E
-Global Const $WM_PARENTNOTIFY = 0x0210
-Global Const $WM_ENTERMENULOOP = 0x0211
-Global Const $WM_EXITMENULOOP = 0x0212
-Global Const $WM_NEXTMENU = 0x0213
+;Global Const $WM_PARENTNOTIFY = 0x0210
+;Global Const $WM_ENTERMENULOOP = 0x0211
+;Global Const $WM_EXITMENULOOP = 0x0212
+;Global Const $WM_NEXTMENU = 0x0213
 ;Global Const $WM_SIZING = 0x0214
-Global Const $WM_CAPTURECHANGED = 0x0215
-Global Const $WM_MOVING = 0x0216
-Global Const $WM_POWERBROADCAST = 0x0218
-Global Const $WM_DEVICECHANGE = 0x0219
-Global Const $WM_MDICREATE = 0x0220
-Global Const $WM_MDIDESTROY = 0x0221
-Global Const $WM_MDIACTIVATE = 0x0222
-Global Const $WM_MDIRESTORE = 0x0223
-Global Const $WM_MDINEXT = 0x0224
-Global Const $WM_MDIMAXIMIZE = 0x0225
-Global Const $WM_MDITILE = 0x0226
-Global Const $WM_MDICASCADE = 0x0227
-Global Const $WM_MDIICONARRANGE = 0x0228
-Global Const $WM_MDIGETACTIVE = 0x0229
+;Global Const $WM_CAPTURECHANGED = 0x0215
+;Global Const $WM_MOVING = 0x0216
+;Global Const $WM_POWERBROADCAST = 0x0218
+;Global Const $WM_DEVICECHANGE = 0x0219
+;Global Const $WM_MDICREATE = 0x0220
+;Global Const $WM_MDIDESTROY = 0x0221
+;Global Const $WM_MDIACTIVATE = 0x0222
+;Global Const $WM_MDIRESTORE = 0x0223
+;Global Const $WM_MDINEXT = 0x0224
+;Global Const $WM_MDIMAXIMIZE = 0x0225
+;Global Const $WM_MDITILE = 0x0226
+;Global Const $WM_MDICASCADE = 0x0227
+;Global Const $WM_MDIICONARRANGE = 0x0228
+;Global Const $WM_MDIGETACTIVE = 0x0229
 Global Const $WM_DROPOBJECT = 0x022A
 Global Const $WM_QUERYDROPOBJECT = 0x022B
 Global Const $WM_BEGINDRAG = 0x022C
 Global Const $WM_DRAGLOOP = 0x022D
 Global Const $WM_DRAGSELECT = 0x022E
 Global Const $WM_DRAGMOVE = 0x022F
-Global Const $WM_MDISETMENU = 0x0230
-Global Const $WM_ENTERSIZEMOVE = 0x0231
-Global Const $WM_EXITSIZEMOVE = 0x0232
-Global Const $WM_DROPFILES = 0x0233
-Global Const $WM_MDIREFRESHMENU = 0x0234
+;Global Const $WM_MDISETMENU = 0x0230
+;Global Const $WM_ENTERSIZEMOVE = 0x0231
+;Global Const $WM_EXITSIZEMOVE = 0x0232
+;Global Const $WM_DROPFILES = 0x0233
+;Global Const $WM_MDIREFRESHMENU = 0x0234
 Global Const $WM_TOUCH = 0x0240
-Global Const $WM_IME_SETCONTEXT = 0x0281
-Global Const $WM_IME_NOTIFY = 0x0282
-Global Const $WM_IME_CONTROL = 0x0283
-Global Const $WM_IME_COMPOSITIONFULL = 0x0284
-Global Const $WM_IME_SELECT = 0x0285
-Global Const $WM_IME_CHAR = 0x0286
+;Global Const $WM_IME_SETCONTEXT = 0x0281
+;Global Const $WM_IME_NOTIFY = 0x0282
+;Global Const $WM_IME_CONTROL = 0x0283
+;Global Const $WM_IME_COMPOSITIONFULL = 0x0284
+;Global Const $WM_IME_SELECT = 0x0285
+;Global Const $WM_IME_CHAR = 0x0286
 Global Const $WM_IME_SYSTEM = 0x0287
-Global Const $WM_IME_REQUEST = 0x0288
-Global Const $WM_IME_KEYDOWN = 0x0290
-Global Const $WM_IME_KEYUP = 0x0291
-Global Const $WM_NCMOUSEHOVER = 0x02A0
-Global Const $WM_MOUSEHOVER = 0x02A1
-Global Const $WM_NCMOUSELEAVE = 0x02A2
-Global Const $WM_MOUSELEAVE = 0x02A3
-Global Const $WM_WTSSESSION_CHANGE = 0x02B1
-Global Const $WM_TABLET_FIRST = 0x02C0
-Global Const $WM_TABLET_LAST = 0x02DF
+;Global Const $WM_IME_REQUEST = 0x0288
+;Global Const $WM_IME_KEYDOWN = 0x0290
+;Global Const $WM_IME_KEYUP = 0x0291
+;Global Const $WM_NCMOUSEHOVER = 0x02A0
+;Global Const $WM_MOUSEHOVER = 0x02A1
+;Global Const $WM_NCMOUSELEAVE = 0x02A2
+;Global Const $WM_MOUSELEAVE = 0x02A3
+;Global Const $WM_WTSSESSION_CHANGE = 0x02B1
+;Global Const $WM_TABLET_FIRST = 0x02C0
+;Global Const $WM_TABLET_LAST = 0x02DF
 ;Global Const $WM_CUT = 0x0300
 ;Global Const $WM_COPY = 0x0301
 ;Global Const $WM_PASTE = 0x0302
 ;Global Const $WM_ASKCBFORMATNAME = 0x030C
 ;Global Const $WM_CHANGECBCHAIN = 0x030D
 ;Global Const $WM_HSCROLLCLIPBOARD = 0x030E
-Global Const $WM_QUERYNEWPALETTE = 0x030F
-Global Const $WM_PALETTEISCHANGING = 0x0310
-Global Const $WM_PALETTECHANGED = 0x0311
-Global Const $WM_HOTKEY = 0x0312
+;Global Const $WM_QUERYNEWPALETTE = 0x030F
+;Global Const $WM_PALETTEISCHANGING = 0x0310
+;Global Const $WM_PALETTECHANGED = 0x0311
+;Global Const $WM_HOTKEY = 0x0312
 Global Const $WM_SYSMENU = 0x0313
 Global Const $WM_HOOKMSG = 0x0314
 Global Const $WM_EXITPROCESS = 0x0315
 Global Const $WM_WAKETHREAD = 0x0316
-Global Const $WM_PRINT = 0x0317
-Global Const $WM_PRINTCLIENT = 0x0318
-Global Const $WM_APPCOMMAND = 0x0319
-Global Const $WM_THEMECHANGED = 0x031A
+;Global Const $WM_PRINT = 0x0317
+;Global Const $WM_PRINTCLIENT = 0x0318
+;Global Const $WM_APPCOMMAND = 0x0319
+;Global Const $WM_THEMECHANGED = 0x031A
 Global Const $WM_UAHINIT = 0x031B
 Global Const $WM_DESKTOPNOTIFY = 0x031C
 Global Const $WM_CLIPBOARDUPDATE = 0x031D
 Global Const $WM_FORWARDKEYUP = 0x0334
 Global Const $WM_GETTITLEBARINFOEX = 0x033F
 Global Const $WM_NOTIFYWOW = 0x0340
-Global Const $WM_HANDHELDFIRST = 0x0358
-Global Const $WM_HANDHELDLAST = 0x035F
-Global Const $WM_AFXFIRST = 0x0360
-Global Const $WM_AFXLAST = 0x037F
-Global Const $WM_PENWINFIRST = 0x0380
-Global Const $WM_PENWINLAST = 0x038F
+;Global Const $WM_HANDHELDFIRST = 0x0358
+;Global Const $WM_HANDHELDLAST = 0x035F
+;Global Const $WM_AFXFIRST = 0x0360
+;Global Const $WM_AFXLAST = 0x037F
+;Global Const $WM_PENWINFIRST = 0x0380
+;Global Const $WM_PENWINLAST = 0x038F
 Global Const $WM_DDE_INITIATE = 0x03E0
 Global Const $WM_DDE_TERMINATE = 0x03E1
 Global Const $WM_DDE_ADVISE = 0x03E2
 ; _WinAPI_DuplicateHandle()
 ; ===============================================================================================================================
 
-Global Const $DUPLICATE_CLOSE_SOURCE = 0x01
-Global Const $DUPLICATE_SAME_ACCESS = 0x02
+;~Global Const $DUPLICATE_CLOSE_SOURCE = 0x01
+;~Global Const $DUPLICATE_SAME_ACCESS = 0x02
 
 ; ===============================================================================================================================
 ; _WinAPI_DwmGetWindowAttribute(), _WinAPI_DwmSetWindowAttribute()
 Global Const $LIST_MODULES_DEFAULT = 0
 
 ; ===============================================================================================================================
+; _WinAPI_EnumUILanguages()
+; ===============================================================================================================================
+
+Global Const $MUI_LANGUAGE_ID = 0x0004
+Global Const $MUI_LANGUAGE_NAME = 0x0008
+
+; ===============================================================================================================================
 ; _WinAPI_ExtFloodFill()
 ; ===============================================================================================================================
 
 Global Const $GET_MODULE_HANDLE_EX_FLAG_DEFAULT = 0x00000000
 
 ; ===============================================================================================================================
+; _WinAPI_GetPriorityClass(), _WinAPI_SetPriorityClass()
+; ===============================================================================================================================
+
+Global Const $ABOVE_NORMAL_PRIORITY_CLASS = 0x00008000
+Global Const $BELOW_NORMAL_PRIORITY_CLASS = 0x00004000
+Global Const $HIGH_PRIORITY_CLASS = 0x00000080
+Global Const $IDLE_PRIORITY_CLASS = 0x00000040
+Global Const $NORMAL_PRIORITY_CLASS = 0x00000020
+Global Const $REALTIME_PRIORITY_CLASS = 0x00000100
+
+Global Const $PROCESS_MODE_BACKGROUND_BEGIN = 0x00100000
+Global Const $PROCESS_MODE_BACKGROUND_END = 0x00200000
+
+; ===============================================================================================================================
 ; _WinAPI_GetROP2(), _WinAPI_SetROP2()
 ; ===============================================================================================================================
 
 ;Global Const $TOKEN_ADJUST_SESSIONID = 0x0100
 ;Global Const $TOKEN_ASSIGN_PRIMARY = 0x0001
 ;Global Const $TOKEN_DUPLICATE = 0x0002
-Global Const $TOKEN_EXECUTE = $STANDARD_RIGHTS_EXECUTE
+;Global Const $TOKEN_EXECUTE = $STANDARD_RIGHTS_EXECUTE
 ;Global Const $TOKEN_IMPERSONATE = 0x0004
 ;Global Const $TOKEN_QUERY = 0x0008
 ;Global Const $TOKEN_QUERY_SOURCE = 0x0010
-Global Const $TOKEN_READ = BitOR($STANDARD_RIGHTS_READ, $TOKEN_QUERY)
-Global Const $TOKEN_WRITE = BitOR($STANDARD_RIGHTS_WRITE, $TOKEN_ADJUST_DEFAULT, $TOKEN_ADJUST_GROUPS, $TOKEN_ADJUST_PRIVILEGES)
-Global Const $TOKEN_ALL_ACCESS = BitOR($STANDARD_RIGHTS_REQUIRED, $TOKEN_ADJUST_DEFAULT, $TOKEN_ADJUST_GROUPS, $TOKEN_ADJUST_PRIVILEGES, $TOKEN_ADJUST_SESSIONID, $TOKEN_ASSIGN_PRIMARY, $TOKEN_DUPLICATE, $TOKEN_EXECUTE, $TOKEN_IMPERSONATE, $TOKEN_QUERY, $TOKEN_QUERY_SOURCE)
+;Global Const $TOKEN_READ = BitOR($STANDARD_RIGHTS_READ, $TOKEN_QUERY)
+;Global Const $TOKEN_WRITE = BitOR($STANDARD_RIGHTS_WRITE, $TOKEN_ADJUST_DEFAULT, $TOKEN_ADJUST_GROUPS, $TOKEN_ADJUST_PRIVILEGES)
+;Global Const $TOKEN_ALL_ACCESS = BitOR($STANDARD_RIGHTS_REQUIRED, $TOKEN_ADJUST_DEFAULT, $TOKEN_ADJUST_GROUPS, $TOKEN_ADJUST_PRIVILEGES, $TOKEN_ADJUST_SESSIONID, $TOKEN_ASSIGN_PRIMARY, $TOKEN_DUPLICATE, $TOKEN_EXECUTE, $TOKEN_IMPERSONATE, $TOKEN_QUERY, $TOKEN_QUERY_SOURCE)
 
 ; ===============================================================================================================================
 ; _WinAPI_OpenSemaphore()
 ;Global Const $RESOURCETYPE_PRINT = 0x02
 
 ; ===============================================================================================================================
+; _WinAPI_SystemParametersInfo()
+; ===============================================================================================================================
+
+Global Const $SPI_GETBEEP = 0x0001
+Global Const $SPI_SETBEEP = 0x0002
+Global Const $SPI_GETMOUSE = 0x0003
+Global Const $SPI_SETMOUSE = 0x0004
+Global Const $SPI_GETBORDER = 0x0005
+Global Const $SPI_SETBORDER = 0x0006
+Global Const $SPI_GETKEYBOARDSPEED = 0x000A
+Global Const $SPI_SETKEYBOARDSPEED = 0x000B
+Global Const $SPI_LANGDRIVER = 0x000C
+Global Const $SPI_ICONHORIZONTALSPACING = 0x000D
+Global Const $SPI_GETSCREENSAVETIMEOUT = 0x000E
+Global Const $SPI_SETSCREENSAVETIMEOUT = 0x000F
+Global Const $SPI_GETSCREENSAVEACTIVE = 0x0010
+Global Const $SPI_SETSCREENSAVEACTIVE = 0x0011
+Global Const $SPI_GETGRIDGRANULARITY = 0x0012
+Global Const $SPI_SETGRIDGRANULARITY = 0x0013
+Global Const $SPI_SETDESKWALLPAPER = 0x0014
+Global Const $SPI_SETDESKPATTERN = 0x0015
+Global Const $SPI_GETKEYBOARDDELAY = 0x0016
+Global Const $SPI_SETKEYBOARDDELAY = 0x0017
+Global Const $SPI_ICONVERTICALSPACING = 0x0018
+Global Const $SPI_GETICONTITLEWRAP = 0x0019
+Global Const $SPI_SETICONTITLEWRAP = 0x001A
+Global Const $SPI_GETMENUDROPALIGNMENT = 0x001B
+Global Const $SPI_SETMENUDROPALIGNMENT = 0x001C
+Global Const $SPI_SETDOUBLECLKWIDTH = 0x001D
+Global Const $SPI_SETDOUBLECLKHEIGHT = 0x001E
+Global Const $SPI_GETICONTITLELOGFONT = 0x001F
+Global Const $SPI_SETDOUBLECLICKTIME = 0x0020
+Global Const $SPI_SETMOUSEBUTTONSWAP = 0x0021
+Global Const $SPI_SETICONTITLELOGFONT = 0x0022
+Global Const $SPI_GETFASTTASKSWITCH = 0x0023
+Global Const $SPI_SETFASTTASKSWITCH = 0x0024
+Global Const $SPI_SETDRAGFULLWINDOWS = 0x0025
+Global Const $SPI_GETDRAGFULLWINDOWS = 0x0026
+Global Const $SPI_GETNONCLIENTMETRICS = 0x0029
+Global Const $SPI_SETNONCLIENTMETRICS = 0x002A
+Global Const $SPI_GETMINIMIZEDMETRICS = 0x002B
+Global Const $SPI_SETMINIMIZEDMETRICS = 0x002C
+Global Const $SPI_GETICONMETRICS = 0x002D
+Global Const $SPI_SETICONMETRICS = 0x002E
+Global Const $SPI_SETWORKAREA = 0x002F
+Global Const $SPI_GETWORKAREA = 0x0030
+Global Const $SPI_SETPENWINDOWS = 0x0031
+Global Const $SPI_GETHIGHCONTRAST = 0x0042
+Global Const $SPI_SETHIGHCONTRAST = 0x0043
+Global Const $SPI_GETKEYBOARDPREF = 0x0044
+Global Const $SPI_SETKEYBOARDPREF = 0x0045
+Global Const $SPI_GETSCREENREADER = 0x0046
+Global Const $SPI_SETSCREENREADER = 0x0047
+Global Const $SPI_GETANIMATION = 0x0048
+Global Const $SPI_SETANIMATION = 0x0049
+Global Const $SPI_GETFONTSMOOTHING = 0x004A
+Global Const $SPI_SETFONTSMOOTHING = 0x004B
+Global Const $SPI_SETDRAGWIDTH = 0x004C
+Global Const $SPI_SETDRAGHEIGHT = 0x004D
+Global Const $SPI_SETHANDHELD = 0x004E
+Global Const $SPI_GETLOWPOWERTIMEOUT = 0x004F
+Global Const $SPI_GETPOWEROFFTIMEOUT = 0x0050
+Global Const $SPI_SETLOWPOWERTIMEOUT = 0x0051
+Global Const $SPI_SETPOWEROFFTIMEOUT = 0x0052
+Global Const $SPI_GETLOWPOWERACTIVE = 0x0053
+Global Const $SPI_GETPOWEROFFACTIVE = 0x0054
+Global Const $SPI_SETLOWPOWERACTIVE = 0x0055
+Global Const $SPI_SETPOWEROFFACTIVE = 0x0056
+Global Const $SPI_SETCURSORS = 0x0057
+Global Const $SPI_SETICONS = 0x0058
+Global Const $SPI_GETDEFAULTINPUTLANG = 0x0059
+Global Const $SPI_SETDEFAULTINPUTLANG = 0x005A
+Global Const $SPI_SETLANGTOGGLE = 0x005B
+Global Const $SPI_GETWINDOWSEXTENSION = 0x005C
+Global Const $SPI_SETMOUSETRAILS = 0x005D
+Global Const $SPI_GETMOUSETRAILS = 0x005E
+Global Const $SPI_SETSCREENSAVERRUNNING = 0x0061
+Global Const $SPI_SCREENSAVERRUNNING = $SPI_SETSCREENSAVERRUNNING
+Global Const $SPI_GETFILTERKEYS = 0x0032
+Global Const $SPI_SETFILTERKEYS = 0x0033
+Global Const $SPI_GETTOGGLEKEYS = 0x0034
+Global Const $SPI_SETTOGGLEKEYS = 0x0035
+Global Const $SPI_GETMOUSEKEYS = 0x0036
+Global Const $SPI_SETMOUSEKEYS = 0x0037
+Global Const $SPI_GETSHOWSOUNDS = 0x0038
+Global Const $SPI_SETSHOWSOUNDS = 0x0039
+Global Const $SPI_GETSTICKYKEYS = 0x003A
+Global Const $SPI_SETSTICKYKEYS = 0x003B
+Global Const $SPI_GETACCESSTIMEOUT = 0x003C
+Global Const $SPI_SETACCESSTIMEOUT = 0x003D
+Global Const $SPI_GETSERIALKEYS = 0x003E
+Global Const $SPI_SETSERIALKEYS = 0x003F
+Global Const $SPI_GETSOUNDSENTRY = 0x0040
+Global Const $SPI_SETSOUNDSENTRY = 0x0041
+Global Const $SPI_GETSNAPTODEFBUTTON = 0x005F
+Global Const $SPI_SETSNAPTODEFBUTTON = 0x0060
+Global Const $SPI_GETMOUSEHOVERWIDTH = 0x0062
+Global Const $SPI_SETMOUSEHOVERWIDTH = 0x0063
+Global Const $SPI_GETMOUSEHOVERHEIGHT = 0x0064
+Global Const $SPI_SETMOUSEHOVERHEIGHT = 0x0065
+Global Const $SPI_GETMOUSEHOVERTIME = 0x0066
+Global Const $SPI_SETMOUSEHOVERTIME = 0x0067
+Global Const $SPI_GETWHEELSCROLLLINES = 0x0068
+Global Const $SPI_SETWHEELSCROLLLINES = 0x0069
+Global Const $SPI_GETMENUSHOWDELAY = 0x006A
+Global Const $SPI_SETMENUSHOWDELAY = 0x006B
+Global Const $SPI_GETSHOWIMEUI = 0x006E
+Global Const $SPI_SETSHOWIMEUI = 0x006F
+Global Const $SPI_GETMOUSESPEED = 0x0070
+Global Const $SPI_SETMOUSESPEED = 0x0071
+Global Const $SPI_GETSCREENSAVERRUNNING = 0x0072
+Global Const $SPI_GETDESKWALLPAPER = 0x0073
+Global Const $SPI_GETACTIVEWINDOWTRACKING = 0x1000
+Global Const $SPI_SETACTIVEWINDOWTRACKING = 0x1001
+Global Const $SPI_GETMENUANIMATION = 0x1002
+Global Const $SPI_SETMENUANIMATION = 0x1003
+Global Const $SPI_GETCOMBOBOXANIMATION = 0x1004
+Global Const $SPI_SETCOMBOBOXANIMATION = 0x1005
+Global Const $SPI_GETLISTBOXSMOOTHSCROLLING = 0x1006
+Global Const $SPI_SETLISTBOXSMOOTHSCROLLING = 0x1007
+Global Const $SPI_GETGRADIENTCAPTIONS = 0x1008
+Global Const $SPI_SETGRADIENTCAPTIONS = 0x1009
+Global Const $SPI_GETKEYBOARDCUES = 0x100A
+Global Const $SPI_SETKEYBOARDCUES = 0x100B
+Global Const $SPI_GETMENUUNDERLINES = $SPI_GETKEYBOARDCUES
+Global Const $SPI_SETMENUUNDERLINES = $SPI_SETKEYBOARDCUES
+Global Const $SPI_GETACTIVEWNDTRKZORDER = 0x100C
+Global Const $SPI_SETACTIVEWNDTRKZORDER = 0x100D
+Global Const $SPI_GETHOTTRACKING = 0x100E
+Global Const $SPI_SETHOTTRACKING = 0x100F
+Global Const $SPI_GETMENUFADE = 0x1012
+Global Const $SPI_SETMENUFADE = 0x1013
+Global Const $SPI_GETSELECTIONFADE = 0x1014
+Global Const $SPI_SETSELECTIONFADE = 0x1015
+Global Const $SPI_GETTOOLTIPANIMATION = 0x1016
+Global Const $SPI_SETTOOLTIPANIMATION = 0x1017
+Global Const $SPI_GETTOOLTIPFADE = 0x1018
+Global Const $SPI_SETTOOLTIPFADE = 0x1019
+Global Const $SPI_GETCURSORSHADOW = 0x101A
+Global Const $SPI_SETCURSORSHADOW = 0x101B
+Global Const $SPI_GETMOUSESONAR = 0x101C
+Global Const $SPI_SETMOUSESONAR = 0x101D
+Global Const $SPI_GETMOUSECLICKLOCK = 0x101E
+Global Const $SPI_SETMOUSECLICKLOCK = 0x101F
+Global Const $SPI_GETMOUSEVANISH = 0x1020
+Global Const $SPI_SETMOUSEVANISH = 0x1021
+Global Const $SPI_GETFLATMENU = 0x1022
+Global Const $SPI_SETFLATMENU = 0x1023
+Global Const $SPI_GETDROPSHADOW = 0x1024
+Global Const $SPI_SETDROPSHADOW = 0x1025
+Global Const $SPI_GETBLOCKSENDINPUTRESETS = 0x1026
+Global Const $SPI_SETBLOCKSENDINPUTRESETS = 0x1027
+Global Const $SPI_GETUIEFFECTS = 0x103E
+Global Const $SPI_SETUIEFFECTS = 0x103F
+Global Const $SPI_GETFOREGROUNDLOCKTIMEOUT = 0x2000
+Global Const $SPI_SETFOREGROUNDLOCKTIMEOUT = 0x2001
+Global Const $SPI_GETACTIVEWNDTRKTIMEOUT = 0x2002
+Global Const $SPI_SETACTIVEWNDTRKTIMEOUT = 0x2003
+Global Const $SPI_GETFOREGROUNDFLASHCOUNT = 0x2004
+Global Const $SPI_SETFOREGROUNDFLASHCOUNT = 0x2005
+Global Const $SPI_GETCARETWIDTH = 0x2006
+Global Const $SPI_SETCARETWIDTH = 0x2007
+Global Const $SPI_GETMOUSECLICKLOCKTIME = 0x2008
+Global Const $SPI_SETMOUSECLICKLOCKTIME = 0x2009
+Global Const $SPI_GETFONTSMOOTHINGTYPE = 0x200A
+Global Const $SPI_SETFONTSMOOTHINGTYPE = 0x200B
+Global Const $SPI_GETFONTSMOOTHINGCONTRAST = 0x200C
+Global Const $SPI_SETFONTSMOOTHINGCONTRAST = 0x200D
+Global Const $SPI_GETFOCUSBORDERWIDTH = 0x200E
+Global Const $SPI_SETFOCUSBORDERWIDTH = 0x200F
+Global Const $SPI_GETFOCUSBORDERHEIGHT = 0x2010
+Global Const $SPI_SETFOCUSBORDERHEIGHT = 0x2011
+Global Const $SPI_GETFONTSMOOTHINGORIENTATION = 0x2012
+Global Const $SPI_SETFONTSMOOTHINGORIENTATION = 0x2013
+
+Global Const $FE_FONTSMOOTHINGSTANDARD = 0x0001
+Global Const $FE_FONTSMOOTHINGCLEARTYPE = 0x0002
+Global Const $FE_FONTSMOOTHINGDOCKING = 0x8000
+
+Global Const $FE_FONTSMOOTHINGORIENTATIONBGR = 0x0000
+Global Const $FE_FONTSMOOTHINGORIENTATIONRGB = 0x0001
+
+Global Const $SPIF_UPDATEINIFILE = 0x0001
+Global Const $SPIF_SENDWININICHANGE = 0x0002
+Global Const $SPIF_SENDCHANGE = $SPIF_SENDWININICHANGE
+
+; ===============================================================================================================================
 ; _WinAPI_TrackMouseEvent()
 ; ===============================================================================================================================
 

File APIErrors.au3

View file
  • Ignore whitespace
     Filename:       APIErrors.au3
     Description:    System error codes to be used with WinAPIEx UDF library
     Author:         Yashied
-    Version:        3.5 / 3.3.6.1
+    Version:        3.6 / 3.3.8.0
     Requirements:   AutoIt v3.3 +, Developed/Tested on Windows XP Pro Service Pack 2 and Windows Vista/7
     Uses:           None
     Note:           -

File WinAPIEx.au3

View file
  • Ignore whitespace
     Filename:       WinAPIEx.au3
     Description:    Additional variables, constants and functions for the WinAPI.au3
     Author:         Yashied
-    Version:        3.5 / 3.3.6.1
+    Version:        3.6 / 3.3.8.0
     Requirements:   AutoIt v3.3 +, Developed/Tested on Windows XP Pro Service Pack 2 and Windows Vista/7
     Uses:           StructureConstants.au3, WinAPI.au3
     Note:           The library uses the following system DLLs:
     _WinAPI_BufferedPaintSetAlpha
     _WinAPI_BufferedPaintUnInit
     _WinAPI_CalculatePopupWindowPosition
+    _WinAPI_CallWindowProcW
     _WinAPI_CascadeWindows
     _WinAPI_ChangeWindowMessageFilterEx
     _WinAPI_CharToOem
     _WinAPI_CloseWindow
     _WinAPI_CloseWindowStation
     _WinAPI_CoInitialize
+    _WinAPI_ColorAdjustLuma
     _WinAPI_ColorHLSToRGB
     _WinAPI_ColorRGBToHLS
     _WinAPI_CombineTransform
     _WinAPI_CreateANDBitmap
     _WinAPI_CreateBitmapIndirect
     _WinAPI_CreateBrushIndirect
+    _WinAPI_CreateBuffer
     _WinAPI_CreateCaret
     _WinAPI_CreateCompatibleBitmapEx
     _WinAPI_CreateDesktop
     _WinAPI_DeferWindowPos
     _WinAPI_DefineDosDevice
     _WinAPI_DefSubclassProc
+    _WinAPI_DefWindowProcW
     _WinAPI_DeleteEnhMetaFile
     _WinAPI_DeleteFile
     _WinAPI_DeleteObjectID
     _WinAPI_DrawThemeParentBackground
     _WinAPI_DrawThemeText
     _WinAPI_DrawThemeTextEx
-    _WinAPI_DuplicateHandle
+   *_WinAPI_DuplicateHandle
     _WinAPI_DwmEnableBlurBehindWindow
     _WinAPI_DwmEnableComposition
     _WinAPI_DwmGetColorizationColor
     _WinAPI_EnumResourceNames
     _WinAPI_EnumResourceTypes
     _WinAPI_EnumSystemLocales
+    _WinAPI_EnumUILanguages
     _WinAPI_EnumWindowStations
     _WinAPI_EqualMemory
     _WinAPI_EqualRect
     _WinAPI_ExtractIcon
     _WinAPI_ExtSelectClipRgn
     _WinAPI_FatalExit
+    _WinAPI_FileExists
     _WinAPI_FileInUse
     _WinAPI_FillMemory
     _WinAPI_FillPath
    *_WinAPI_FillRect
     _WinAPI_FillRgn
+    _WinAPI_FindClose
+    _WinAPI_FindFirstFile
+    _WinAPI_FindNextFile
     _WinAPI_FindResource
     _WinAPI_FindResourceEx
     _WinAPI_FindTextDlg
     _WinAPI_GetExtended
     _WinAPI_GetFileAttributes
     _WinAPI_GetFileInformationByHandle
+    _WinAPI_GetFileSize
     _WinAPI_GetFileSizeOnDisk
     _WinAPI_GetFileTitle
     _WinAPI_GetFileType
     _WinAPI_GetLocaleInfo
     _WinAPI_GetLogicalDrives
     _WinAPI_GetMapMode
+    _WinAPI_GetMemorySize
     _WinAPI_GetMessageExtraInfo
     _WinAPI_GetModuleFileNameEx
     _WinAPI_GetModuleHandleEx
     _WinAPI_GetPixel
     _WinAPI_GetPolyFillMode
     _WinAPI_GetPosFromRect
+    _WinAPI_GetPriorityClass
     _WinAPI_GetProcAddress
     _WinAPI_GetProcessCommandLine
     _WinAPI_GetProcessFileName
     _WinAPI_GetStartupInfo
     _WinAPI_GetString
     _WinAPI_GetSystemDefaultLCID
+    _WinAPI_GetSystemDefaultUILanguage
     _WinAPI_GetSystemDEPPolicy
     _WinAPI_GetSystemInfo
     _WinAPI_GetSystemPowerStatus
     _WinAPI_GetUpdateRect
     _WinAPI_GetUpdateRgn
     _WinAPI_GetUserDefaultLCID
+    _WinAPI_GetUserDefaultUILanguage
     _WinAPI_GetUserObjectInformation
     _WinAPI_GetVersion
     _WinAPI_GetVersionEx
     _WinAPI_IsIconic
     _WinAPI_IsInternetConnected
     _WinAPI_IsLoadKBLayout
+    _WinAPI_IsMemory
     _WinAPI_IsNetworkAlive
     _WinAPI_IsProcessInJob
     _WinAPI_IsProcessorFeaturePresent
     _WinAPI_IsRectEmpty
-    _WinAPI_IsString
     _WinAPI_IsThemeActive
     _WinAPI_IsThemeBackgroundPartiallyTransparent
     _WinAPI_IsThemePartDefined
     _WinAPI_PatBlt
     _WinAPI_PathAddBackslash
     _WinAPI_PathAddExtension
+    _WinAPI_PathAppend
+    _WinAPI_PathBuildRoot
     _WinAPI_PathCanonicalize
     _WinAPI_PathCommonPrefix
     _WinAPI_PathCompactPath
     _WinAPI_ReleaseSemaphore
     _WinAPI_ReleaseStream
     _WinAPI_RemoveClipboardFormatListener
+    _WinAPI_RemoveDirectory
     _WinAPI_RemoveFontMemResourceEx
     _WinAPI_RemoveFontResourceEx
     _WinAPI_RemoveWindowSubclass
    *_WinAPI_SetParent
     _WinAPI_SetPixel
     _WinAPI_SetPolyFillMode
+    _WinAPI_SetPriorityClass
     _WinAPI_SetProcessShutdownParameters
     _WinAPI_SetProcessWindowStation
     _WinAPI_SetRectRgn
 #Region Initialization
 
 Global Const $__WINVER = __Ver()
-Global Const $__UDFVER = '3.5'
+Global Const $__UDFVER = '3.6'
 
 #EndRegion Initialization
 
 Global Const $tagPRINTPAGERANGE = 'dword FromPage;dword ToPage;'
 Global Const $tagRGNDATAHEADER = 'dword Size;dword Type;dword Count;dword RgnSize;' & $tagRECT & ';'
 ;Global Const $tagRGNDATA = $tagRGNDATAHEADER ; & $tagRECT[n] & ';'
+Global Const $tagSHELLHOOKINFO = 'hwnd hWnd;' & $tagRECT & ';'
 Global Const $tagSHFILEINFO = 'ptr hIcon;int iIcon;dword Attributes;wchar DisplayName[260];wchar TypeName[80];'
 Global Const $tagSHFILEOPSTRUCT = 'hwnd hWnd;uint Func;ptr From;ptr To;dword Flags;int fAnyOperationsAborted;ptr hNameMappings;ptr ProgressTitle;'
 Global Const $tagSHFOLDERCUSTOMSETTINGS = 'dword Size;dword Mask;ptr GUID;ptr WebViewTemplate;dword SizeWVT;ptr WebViewTemplateVersion;ptr InfoTip;dword SizeIT;ptr CLSID;dword Flags;ptr IconFile;dword SizeIF;int IconIndex;ptr Logo;dword SizeL;'
 Global Const $tagUSEROBJECTFLAGS = 'int Inherit;int Reserved;dword Flags;'
 Global Const $tagVS_FIXEDFILEINFO = 'dword Signature;dword StrucVersion;dword FileVersionMS;dword FileVersionLS;dword ProductVersionMS;dword ProductVersionLS;dword FileFlagsMask;dword FileFlags;dword FileOS;dword FileType;dword FileSubtype;dword FileDateMS;dword FileDateLS;'
 ;Global Const $tagVS_VERSIONINFO = 'ushort Length;ushort ValueLength;ushort Type;wchar Key;ushort Padding1;' & $tagVS_FIXEDFILEINFO & 'ushort Padding2;ushort Children;'
+;Global Const $tagWIN32_FIND_DATA = 'align 4;dword FileAttributes;uint64 CreationTime;uint64 LastAccessTime;uint64 LastWriteTime;dword FileSizeHigh;dword FileSizeLow;dword Reserved0;dword Reserved1;wchar FileName[260];wchar AlternateFileName[14];'
 Global Const $tagWINDOWINFO = 'dword Size;dword rWindow[4];dword rClient[4];dword Style;dword ExStyle;dword WindowStatus;uint cxWindowBorders;uint cyWindowBorders;ushort atomWindowType;ushort CreatorVersion;'
 Global Const $tagWNDCLASSEX = 'uint Size;uint Style;ptr hWndProc;int ClsExtra;int WndExtra;ptr hInstance;ptr hIcon;ptr hCursor;ptr hBackground;ptr MenuName;ptr ClassName;ptr hIconSm;'
 Global Const $tagXFORM = 'float eM11;float eM12;float eM21;float eM22;float eDx;float eDy;'
 	Local $tBROWSEINFO = DllStructCreate('hwnd;ptr;ptr;ptr;int;ptr;uint_ptr;int;wchar[' & (StringLen($sText) + 1) & '];wchar[260]')
 	Local $PIDL = 0, $Path, $Result = ''
 
-	$Path = _WinAPI_PathSearchAndQualify($sRoot, 1)
-	If @error Then
-		$Path = $sRoot
-	EndIf
-	$PIDL = _WinAPI_ShellILCreateFromPath($Path)
-	If @error Then
-		; Nothing
+	If StringStripWS($sRoot, 3) Then
+		$Path = _WinAPI_PathSearchAndQualify($sRoot, 1)
+		If @error Then
+			$Path = $sRoot
+		EndIf
+		$PIDL = _WinAPI_ShellILCreateFromPath($Path)
+		If @error Then
+			; Nothing
+		EndIf
 	EndIf
 
 	DllStructSetData($tBROWSEINFO, 1, $hParent)
 EndFunc   ;==>_WinAPI_CalculatePopupWindowPosition
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_CallWindowProcW
+; Description....: Passes message information to the specified window procedure.
+; Syntax.........: _WinAPI_CallWindowProcW ( $pPrevWndProc, $hWnd, $iMsg, $wParam, $lParam )
+; Parameters.....: $pPrevWndProc - The address of a previous window procedure, or a special internal value meaningful only to
+;                                  _WinAPI_CallWindowProcW() function.
+;                  $hWnd         - A handle to the window procedure that received the message.
+;                  $iMsg         - The message.
+;                  $wParam       - Additional message-specific information. The content of this parameter depends on the message.
+;                  $lParam       - Additional message-specific information. The content of this parameter depends on the message.
+; Return values..: Success       - The result of the message processing and depends on the message sent.
+;                  Failure       - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: Use this function for window subclassing. Usually, all windows with the same class share one window procedure.
+;                  A subclass is a window or set of windows with the same class whose messages are intercepted and processed by
+;                  another window procedure (or procedures) before being passed to the window procedure of the class.
+;
+;                  The _WinAPI_CallWindowProcW() function handles Unicode-to-ANSI conversion. You cannot take advantage
+;                  of this conversion if you call the window procedure directly.
+; Related........:
+; Link...........: @@MsdnLink@@ CallWindowProc
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_CallWindowProcW($pPrevWndProc, $hWnd, $iMsg, $wParam, $lParam)
+
+	Local $Ret = DllCall('user32.dll', 'lresult', 'CallWindowProcW', 'ptr', $pPrevWndProc, 'hwnd', $hWnd, 'uint', $iMsg, 'wparam', $wParam, 'lparam', $lParam)
+
+	If @error Then
+		Return SetError(1, 0, 0)
+	EndIf
+	Return $Ret[0]
+EndFunc   ;==>_WinAPI_CallWindowProcW
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_CascadeWindows
 ; Description....: Cascades the specified child windows of the specified parent window.
-; Syntax.........: _WinAPI_CascadeWindows ( Const ByRef $aWnds [, $tRECT [, $hParent [, $iFlags [, $iStart [, $iEnd]]]]] )
+; Syntax.........: _WinAPI_CascadeWindows ( $aWnds [, $tRECT [, $hParent [, $iFlags [, $iStart [, $iEnd]]]]] )
 ; Parameters.....: $aWnds   - The array of handles to the child windows to arrange. If a specified child window is a top-level window
 ;                             with the style $WS_EX_TOPMOST or $WS_EX_TOOLWINDOW, the child window is not arranged. If this parameter
 ;                             is 0, all child windows of the specified parent window (or of the desktop window) are arranged.
 ; Example........: Yes
 ; ===============================================================================================================================
 
-Func _WinAPI_CascadeWindows(Const ByRef $aWnds, $tRECT = 0, $hParent = 0, $iFlags = 0, $iStart = 0, $iEnd = -1)
-
-	If Not IsArray($aWnds) Then
-		Return SetError(2, 0, 0)
-	EndIf
-
-	Local $Count, $tWnds
-
-	If $iStart < 0 Then
-		$iStart = 0
-	EndIf
-	If ($iEnd < 0) Or ($iEnd > UBound($aWnds) - 1) Then
-		$iEnd = UBound($aWnds) - 1
-	EndIf
-	$Count = $iEnd - $iStart + 1
-	If $Count < 1 Then
-		Return SetError(1, 0, 0)
-	EndIf
-	$tWnds = DllStructCreate('hwnd[' & $Count & ']')
-	If @error Then
-		Return SetError(1, 0, 0)
-	EndIf
-	$Count = 1
-	For $i = $iStart To $iEnd
-		DllStructSetData($tWnds, 1, $aWnds[$i], $Count)
-		$Count += 1
-	Next
+Func _WinAPI_CascadeWindows($aWnds, $tRECT = 0, $hParent = 0, $iFlags = 0, $iStart = 0, $iEnd = -1)
+
+	Local $Count, $tWnds = 0
+
+	If IsArray($aWnds) Then
+		If $iStart < 0 Then
+			$iStart = 0
+		EndIf
+		If ($iEnd < 0) Or ($iEnd > UBound($aWnds) - 1) Then
+			$iEnd = UBound($aWnds) - 1
+		EndIf
+		$Count = $iEnd - $iStart + 1
+		If $Count < 1 Then
+			Return SetError(1, 0, 0)
+		EndIf
+		$tWnds = DllStructCreate('hwnd[' & $Count & ']')
+		If @error Then
+			Return SetError(1, 0, 0)
+		EndIf
+		$Count = 1
+		For $i = $iStart To $iEnd
+			DllStructSetData($tWnds, 1, $aWnds[$i], $Count)
+			$Count += 1
+		Next
+	Else
+		If $aWnds Then
+			Return SetError(2, 0, 0)
+		EndIf
+	EndIf
 
 	Local $Ret = DllCall('user32.dll', 'ushort', 'CascadeWindows', 'hwnd', $hParent, 'uint', $iFlags, 'ptr', DllStructGetPtr($tRECT), 'uint', $Count - 1, 'ptr', DllStructGetPtr($tWnds))
 
 EndFunc   ;==>_WinAPI_CoInitialize
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_ColorAdjustLuma
+; Description....: Changes the luminance of a RGB value.
+; Syntax.........: _WinAPI_ColorAdjustLuma ( $iRGB, $iPercent [, $fScale] )
+; Parameters.....: $iRGB     - The initial RGB value.
+;                  $iPercent - The luminance of the total range, in percent, or absolute luminance.
+;                  $fScale   - Specifies how to use the $iPercent parameter, valid values:
+;                  |TRUE     - The $iPercent specifies how much to increment or decrement the current luminance, $iPercent can range from -1000 to +1000.
+;                  |FALSE    - The $iPercent specifies the absolute luminance, $iPercent can range 0 to 1000. Available luminance values range
+;                              from 0 to a maximum. If the requested value is negative or exceeds the maximum, the luminance will be set to
+;                              either zero or the maximum value, respectively.
+; Return values..: Success   - The modified RGB value.
+;                  Failure   - (-1) and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: None
+; Related........:
+; Link...........: @@MsdnLink@@ ColorAdjustLuma
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_ColorAdjustLuma($iRGB, $iPercent, $fScale = 1)
+
+	If $fScale Then
+		$iPercent = Floor($iPercent * 10)
+	EndIf
+
+	Local $Ret = DllCall('shlwapi.dll', 'dword', 'ColorAdjustLuma', 'dword', __RGB($iRGB), 'int', $iPercent, 'int', $fScale)
+
+	If @error Then
+		Return SetError(1, 0, -1)
+	EndIf
+	Return __RGB($Ret[0])
+EndFunc   ;==>_WinAPI_ColorAdjustLuma
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_ColorHLSToRGB
 ; Description....: Converts colors from hue-luminance-saturation (HLS) to RGB format.
 ; Syntax.........: _WinAPI_ColorHLSToRGB ( $iHue, $iLuminance, $iSaturation )
 ; Parameters.....: $iHue        - HLS hue value.
 ;                  $iLuminance  - HLS luminance value.
 ;                  $iSaturation - HLS saturation value.
-; Return values..: Success      - Returns the RGB value.
+; Return values..: Success      - The RGB value.
 ;                  Failure      - (-1) and sets the @error flag to non-zero.
 ; Author.........: Yashied
 ; Modified.......:
 EndFunc   ;==>_WinAPI_CreateBrushIndirect
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_CreateBuffer
+; Description....: Allocates a block of memory from the internal library heap.
+; Syntax.........: _WinAPI_CreateBuffer ( $iLenght [, $pBuffer [, $fAbort]] )
+; Parameters.....: $iLenght  - The required buffer length, in bytes.
+;                  $pBuffer  - A pointer to a buffer that to be replaced by a new buffer. If this parameter is a valid buffer pointer,
+;                              the memory will be reallocated for a new buffer. However, a new memory is allocated at a different
+;                              location. Therefore, you should always use a pointer that returns this function. If this parameter is
+;                              0, omitted, or an invalid buffer pointer, the function just allocates a new memory.
+;                  $fAbort   - Specifies whether to exit the script if not enough memory, valid values:
+;                  |TRUE     - Displaying an error message and exit the script with code 1. (Default)
+;                  |FALSE    - Continue the script and return an error.
+; Return values..: Success   - A pointer to the new buffer.
+;                  Failure   - 0 and sets the @error flag to non-zero (if an exceptions is not set).
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: When a buffer is no longer needed, you must destroy it by calling the _WinAPI_FreeMemory() function.
+; Related........:
+; Link...........: None
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_CreateBuffer($iLenght, $pBuffer = 0, $fAbort = 1)
+	$pBuffer = __HeapReAlloc($pBuffer, $iLenght, $fAbort)
+	If @error Then
+		Return SetError(@error, 0, 0)
+	EndIf
+	Return $pBuffer
+EndFunc   ;==>_WinAPI_CreateBuffer
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_CreateCaret
 ; Description....: Creates a new shape for the system caret and assigns ownership of the caret to the specified window.
 ; Syntax.........: _WinAPI_CreateCaret ( $hWnd, $hBitmap [, $iWidth [, $iHeight]] )
 ; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_CreateFileEx
 ; Description....: Creates or opens a file or I/O device.
-; Syntax.........: _WinAPI_CreateFileEx ( $sFile, $iCreation, $iAccess, $iShare [, $iFlagsAndAttributes [, $tSecurity [, $hTemplate]]] )
+; Syntax.........: _WinAPI_CreateFileEx ( $sFile, $iCreation [, $iAccess [, $iShare [, $iFlagsAndAttributes [, $tSecurity [, $hTemplate]]]]] )
 ; Parameters.....: $sFile               - The name of the file or device to be created or opened.
 ;                  $iCreation           - The action to take on a file or device that exists or does not exist. This parameter must be
 ;                                         one of the following values, which cannot be combined.
 ; Example........: Yes
 ; ===============================================================================================================================
 
-Func _WinAPI_CreateFileEx($sFile, $iCreation, $iAccess, $iShare, $iFlagsAndAttributes = 0, $tSecurity = 0, $hTemplate = 0)
+Func _WinAPI_CreateFileEx($sFile, $iCreation, $iAccess = 0, $iShare = 0, $iFlagsAndAttributes = 0, $tSecurity = 0, $hTemplate = 0)
 
 	Local $Ret = DllCall('kernel32.dll', 'ptr', 'CreateFileW', 'wstr', $sFile, 'dword', $iAccess, 'dword', $iShare, 'ptr', DllStructGetPtr($tSecurity), 'dword', $iCreation, 'dword', $iFlagsAndAttributes, 'ptr', $hTemplate)
 
 
 ; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_CreateString
-; Description....: Copies a specified string to the memory and returns its pointer.
-; Syntax.........: _WinAPI_CreateString ( $sString [, $pString [, $iLenght [, $fUnicode]]] )
+; Description....: Copies a specified string to the newly allocated memory block and returns its pointer.
+; Syntax.........: _WinAPI_CreateString ( $sString [, $pString [, $iLenght [, $fUnicode [, $fAbort]]]] )
 ; Parameters.....: $sString  - The source string to be copied.
 ;                  $pString  - A pointer to a string that to be replaced by a new string. If this parameter is a valid string pointer,
 ;                              the memory will be reallocated for a new string. However, a new memory is allocated at a different
 ;                  $fUnicode - Specifies whether a string is Unicode or ASCII code of a character, valid values:
 ;                  |TRUE     - Unicode. (Default)
 ;                  |FALSE    - ASCII.
-; Return values..: A pointer to a null-terminated string, @extended returns the lenght of the string buffer, in TCHARs
-;                 (not including the null-terminating character).
+;                  $fAbort   - Specifies whether to exit the script if not enough memory, valid values:
+;                  |TRUE     - Displaying an error message and exit the script with code 1. (Default)
+;                  |FALSE    - Continue the script and return an error.
+; Return values..: A pointer to the new null-terminated string, @extended returns the lenght of the string buffer, in TCHARs
+;                  (not including the null-terminating character).
 ; Author.........: Yashied
 ; Modified.......:
 ; Remarks........: When a string is no longer needed, you must destroy it by calling the _WinAPI_FreeMemory() function.
 ; Example........: Yes
 ; ===============================================================================================================================
 
-Func _WinAPI_CreateString($sString, $pString = 0, $iLenght = -1, $fUnicode = 1)
+Func _WinAPI_CreateString($sString, $pString = 0, $iLenght = -1, $fUnicode = 1, $fAbort = 1)
 
 	Local $Size
 
 	If $fUnicode Then
 		$Size *= 2
 	EndIf
-	$pString = __HeapReAlloc($pString, $Size)
+	$pString = __HeapReAlloc($pString, $Size, $fAbort)
+	If @error Then
+		Return SetError(@error, 0, 0)
+	EndIf
 	DllStructSetData(DllStructCreate(__Iif($fUnicode, 'wchar', 'char') & '[' & ($iLenght + 1) & ']', $pString), 1, $sString)
 	Return SetError(0, $iLenght, $pString)
 EndFunc   ;==>_WinAPI_CreateString
 EndFunc   ;==>_WinAPI_DefSubclassProc
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_DefWindowProcW
+; Description....: Calls the default window procedure to provide default processing for any window messages.
+; Syntax.........: _WinAPI_DefWindowProcW ( $hWnd, $iMsg, $wParam, $lParam )
+; Parameters.....: $hWnd     - A handle to the window procedure that received the message.
+;                  $iMsg     - The message.
+;                  $wParam   - Additional message-specific information. The content of this parameter depends on the message.
+;                  $lParam   - Additional message-specific information. The content of this parameter depends on the message.
+; Return values..: Success   - The result of the message processing and depends on the message sent.
+;                  Failure   - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: None
+; Related........:
+; Link...........: @@MsdnLink@@ DefWindowProc
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_DefWindowProcW($hWnd, $iMsg, $wParam, $lParam)
+
+	Local $Ret = DllCall('user32.dll', 'lresult', 'DefWindowProcW', 'hwnd', $hWnd, 'uint', $iMsg, 'wparam', $wParam, 'lparam', $lParam)
+
+	If @error Then
+		Return SetError(1, 0, 0)
+	EndIf
+	Return $Ret[0]
+EndFunc   ;==>_WinAPI_DefWindowProcW
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_DeleteEnhMetaFile
 ; Description....: Deletes an enhanced-format metafile or an enhanced-format metafile handle.
 ; Syntax.........: _WinAPI_DeleteEnhMetaFile ( $hEmf )
 			['DWORD_PTR', __Iif(@AutoItX64, 8, 4)], _
 			['WPARAM',    __Iif(@AutoItX64, 8, 4)]]
 
+	If $hParent Then
+		GUISetState(@SW_DISABLE, $hParent)
+	EndIf
 	If $fTop Then
 		$iStyle = BitOR($iStyle, 0x00000008)
 	EndIf
-	GUISetState(@SW_DISABLE, $hParent)
 	$__Dlg = GUICreate($sTitle, 570, 620, -1, -1, 0x80C70000, $iStyle, $hParent)
 	$LV = GUICtrlCreateListView('#|Member|Offset|Type|Size|Value', 0, 0, 570, 620, 0x0000000D, __Iif($__WINVER < 0x0600, 0x00010031, 0x00010030))
 	$hLV = GUICtrlGetHandle($LV)
 		OnAutoItExitUnregister('__Quit')
 	EndIf
 	__Quit()
-	GUISetState(@SW_ENABLE, $hParent)
-	GUIDelete()
+	If $hParent Then
+		GUISetState(@SW_ENABLE, $hParent)
+	EndIf
+	GUIDelete($__Dlg)
 	Opt('GUIDataSeparatorChar', $Opt1)
 	Opt('GUIOnEventMode', $Opt2)
 	Opt('GUICloseOnESC', $Opt3)
 ; Modified.......:
 ; Remarks........: The duplicate handle refers to the same object as the original handle. Therefore, any changes to the object are
 ;                  reflected through both handles. For example, if you duplicate a file handle, the current file position is always
-;                  the same for both handles. For file handles to have different file positions, use the _WinAPI_CreateFile()
+;                  the same for both handles. For file handles to have different file positions, use the _WinAPI_CreateFileEx()
 ;                  function to create file handles that share access to the same file.
 ; Related........:
 ; Link...........: @@MsdnLink@@ DuplicateHandle
 ; Example........: Yes
 ; ===============================================================================================================================
 
+#cs
+
 Func _WinAPI_DuplicateHandle($hProcess, $hSource, $hTarget, $iAccess = 0, $iOptions = 2, $fInherit = 0)
 
 	Local $Ret = DllCall('kernel32.dll', 'int', 'DuplicateHandle', 'ptr', $hProcess, 'ptr', $hSource, 'ptr', $hTarget, 'ptr*', 0, 'dword', $iAccess, 'int', $fInherit, 'dword', $iOptions)
 	Return $Ret[4]
 EndFunc   ;==>_WinAPI_DuplicateHandle
 
+#ce
+
 ; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_DwmEnableBlurBehindWindow
 ; Description....: Enables the blur effect on a specified window.
 ; Name...........: _WinAPI_EnumSystemLocales
 ; Description....: Enumerates the locales that are either installed on or supported by an operating system.
 ; Syntax.........: _WinAPI_EnumSystemLocales ( $iFlag )
-; Parameters.....: $iFlag  - Flags specifying the locale identifiers to enumerate. This parameter can have one of the
+; Parameters.....: $iFlag  - The flag specifying the locale identifiers to enumerate. This parameter can have one of the
 ;                            following values.
 ;
 ;                            $LCID_INSTALLED
 EndFunc   ;==>_WinAPI_EnumSystemLocales
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_EnumUILanguages
+; Description....: Enumerates the user interface languages that are available on the operating system.
+; Syntax.........: _WinAPI_EnumUILanguages ( [$iFlag] )
+; Parameters.....: $iFlag  - The flag identifying the language format. This parameter must be 0 (Windows XP) or one of the
+;                            following values (Windows Vista or later).
+;
+;                            $MUI_LANGUAGE_ID
+;                            $MUI_LANGUAGE_NAME
+;
+; Return values..: Success - The array of the UI language identifiers or language names.
+;                  Failure - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: None
+; Related........:
+; Link...........: @@MsdnLink@@ EnumUILanguages
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_EnumUILanguages($iFlag = 0)
+
+	Local $hEnumProc = DllCallbackRegister('__EnumUILanguagesProc', 'int', 'ptr;lparam')
+	Local $Ret, $ID = 1, $Error = 1
+
+	If $__WINVER >= 0x0600 Then
+		If BitAND($iFlag, 0x0008) Then
+			$ID = 0
+		EndIf
+	Else
+		$iFlag = 0
+	EndIf
+	Dim $__Data[101] = [0]
+	$Ret = DllCall('kernel32.dll', 'int', 'EnumUILanguagesW', 'ptr', DllCallbackGetPtr($hEnumProc), 'dword', $iFlag, 'lparam', $ID)
+	If (@error) Or (Not $Ret[0]) Then
+		$__Data = 0
+	Else
+		$Error = 0
+		If $__Data[0] Then
+			__Inc($__Data, -1)
+		Else
+			$__Data = 0
+		EndIf
+	EndIf
+	DllCallbackFree($hEnumProc)
+	Return SetError($Error, 0, $__Data)
+EndFunc   ;==>_WinAPI_EnumUILanguages
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_EnumWindowStations
 ; Description....: Enumerates all window stations in the current session.
 ; Syntax.........: _WinAPI_EnumWindowStations ( )
 EndFunc   ;==>_WinAPI_FatalExit
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_FileExists
+; Description....: Tests whether the specified path is existing file.
+; Syntax.........: _WinAPI_FileExists ( $sFile )
+; Parameters.....: $sFile  - The path to the file to test.
+; Return values..: Success - 1 - The path is an existing file.
+;                            0 - Otherwise.
+;                  Failure - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: The function sets the @extended flag to 1 if the specified path is an existing directory (not a file).
+; Related........:
+; Link...........: None
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_FileExists($sFile)
+	If FileExists($sFile) Then
+		If _WinAPI_PathIsDirectory($sFile) Then
+			Return SetError(0, 1, 0)
+		Else
+			If @error Then
+				Return SetError(1, 0, 0)
+			Else
+				Return 1
+			EndIf
+		EndIf
+	Else
+		Return 0
+	EndIf
+EndFunc   ;==>_WinAPI_FileExists
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_FileInUse
 ; Description....: Tests whether the specified file in use by another application.
 ; Syntax.........: _WinAPI_FileInUse ( $sFile )
 
 Func _WinAPI_FileInUse($sFile)
 
-	Local $hFile = _WinAPI_CreateFileEx($sFile, 3, 0x80000000, 0)
+	Local $hFile = _WinAPI_CreateFileEx($sFile, 3, 0x80000000)
 
 	If $hFile Then
 		_WinAPI_CloseHandle($hFile)
 EndFunc   ;==>_WinAPI_FillRgn
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_FindClose
+; Description....: Closes a file search handle.
+; Syntax.........: _WinAPI_FindClose ( $hSearch )
+; Parameters.....: $hSearch - The file search handle opened by the _WinAPI_FindFirst... functions.
+; Return values..: Success  - 1.
+;                  Failure  - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: None
+; Related........:
+; Link...........: @@MsdnLink@@ FindClose
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_FindClose($hSearch)
+
+	Local $Ret = DllCall('kernel32.dll', 'int', 'FindClose', 'ptr', $hSearch)
+
+	If (@error) Or (Not $Ret[0]) Then
+		Return SetError(1, 0, 0)
+	EndIf
+	Return 1
+EndFunc   ;==>_WinAPI_FindClose
+
+; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_FindFirstFile
+; Description....: Searches a directory for a file or subdirectory with a name that matches a specific name.
+; Syntax.........: _WinAPI_FindFirstFile ( $sPath, $pData )
+; Parameters.....: $sPath  - The directory or path, and the file name, which can include wildcard characters, for example, an asterisk
+;                            "*" or a question mark "?". If the string ends with a wildcard, period ".", or directory name, the user
+;                            must have access permissions to the root and all subdirectories on the path.
+;                  $pData  - A pointer to the $tagWIN32_FIND_DATA structure that receives information about a found file or directory.
+; Return values..: Success - The search handle, and the $tagWIN32_FIND_DATA structure contains information about the first file
+;                            or directory found.
+;                  Failure - 0 and sets the @error flag to non-zero, @extended flag may contain the system error code.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: This function opens a search handle and returns information about the first file that the file system finds with
+;                  a name that matches the specified pattern. This may or may not be the first file or directory that appears in
+;                  a directory-listing application when given the same file name string pattern.
+;
+;                  After the search handle is established, you can use it to search for other files that match the same pattern by
+;                  using the _WinAPI_FindNextFile() function.
+;
+;                  If the function fails because no more matching files can be found, the @extended flag will contain
+;                  ERROR_NO_MORE_FILES (18) system error code.
+;
+;                  When the search handle is no longer needed, close it by using the _WinAPI_FindClose() function.
+; Related........:
+; Link...........: @@MsdnLink@@ FindFirstFile
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_FindFirstFile($sPath, $pData)
+
+	Local $Ret = DllCall('kernel32.dll', 'ptr', 'FindFirstFileW', 'wstr', $sPath, 'ptr', $pData)
+
+	If @error Then
+		Return SetError(1, 0, 0)
+	Else
+		If $Ret[0] = Ptr(-1) Then
+			Return SetError(1, _WinAPI_GetLastError(), 0)
+		EndIf
+	EndIf
+	Return $Ret[0]
+EndFunc   ;==>_WinAPI_FindFirstFile
+
+; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_FindNextFile
+; Description....: Continues a file or directory search.
+; Syntax.........: _WinAPI_FindNextFile ( $hSearch, $pData )
+; Parameters.....: $hSearch - The search handle returned by a previous call to the _WinAPI_FindFirstFile() function.
+;                  $pData   - A pointer to the $tagWIN32_FIND_DATA structure that receives information about a found file or directory.
+; Return values..: Success  - 1.
+;                  Failure  - 0 and sets the @error flag to non-zero, @extended flag may contain the system error code.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: The order in which the search returns the files, such as alphabetical order, is not guaranteed. If the data
+;                  must be sorted, the application must do the ordering after obtaining all the results.
+;
+;                  If the function fails because no more matching files can be found, the @extended flag will contain
+;                  ERROR_NO_MORE_FILES (18) system error code.
+; Related........:
+; Link...........: @@MsdnLink@@ FindNextFile
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_FindNextFile($hSearch, $pData)
+
+	Local $Ret = DllCall('kernel32.dll', 'int', 'FindNextFileW', 'ptr', $hSearch, 'ptr', $pData)
+
+	If @error Then
+		Return SetError(1, 0, 0)
+	Else
+		If Not $Ret[0] Then
+			Return SetError(1, _WinAPI_GetLastError(), 0)
+		EndIf
+	EndIf
+	Return 1
+EndFunc   ;==>_WinAPI_FindNextFile
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_FindResource
 ; Description....: Determines the location of a resource with the specified type and name in the specified module.
 ; Syntax.........: _WinAPI_FindResource ( $hInstance, $sType, $sName )
 Func _WinAPI_FindTextDlg($hOwner, $sFindWhat = '', $iFlags = 0, $pFindProc = 0, $lParam = 0)
 
 	$__Text = __HeapReAlloc($__Text, 2 * $__Buff)
+	If @error Then
+		Return SetError(1, 0, 0)
+	EndIf
 	DllStructSetData(DllStructCreate('wchar[' & $__Buff & ']', $__Text), 1, StringLeft($sFindWhat, $__Buff - 1))
 	$__FR = DllStructCreate($tagFINDREPLACE)
 	DllStructSetData($__FR, 'Size', DllStructGetSize($__FR))
 
 ; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_FreeMemory
-; Description....: Frees a memory block allocated by some _WinAPI_* functions.
+; Description....: Frees a memory block in the internal library heap.
 ; Syntax.........: _WinAPI_FreeMemory ( $pMemory )
-; Parameters.....: $pMemory - A pointer to a memory block to be freed.
-; Return values..: Success  - 1.
-;                  Failure  - 0 and sets the @error flag to non-zero.
-; Author.........: Yashied
-; Modified.......:
-; Remarks........: None
+; Parameters.....: $pMemory - A pointer to the valid memory block to be freed.
+; Return values..: Success  - 1.
+;                  Failure  - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: The _WinAPI_FreeMemory() function accepts only the pointers returned by some _WinAPI_* functions (see description).
 ; Related........:
 ; Link...........: None
 ; Example........: Yes
 
 Func _WinAPI_GetDriveBusType($sDrive)
 
-	Local $hFile = _WinAPI_CreateFileEx('\\.\' & $sDrive, 3, 0, 0)
+	Local $hFile = _WinAPI_CreateFileEx('\\.\' & $sDrive, 3)
 
 	If Not $hFile Then
 		Return SetError(1, 0, -1)
 ; Name...........: _WinAPI_GetDriveGeometryEx
 ; Description....: Retrieves extended information about the disk's geometry.
 ; Syntax.........: _WinAPI_GetDriveGeometryEx ( $iDrive )
-; Parameters.....: $iDrive - The drive letter to retrieve information, in the format D:, E:, etc.
+; Parameters.....: $iDrive - The physical drive number (0, 1, 2, etc) to retrieve information.
 ; Return values..: Success - The array containing the following information:
 ;
 ;                            [0] - The number of cylinders.
 
 Func _WinAPI_GetDriveGeometryEx($iDrive)
 
-	Local $hFile = _WinAPI_CreateFileEx('\\.\PhysicalDrive' & $iDrive, 3, 0x80000000, 0x01)
+	Local $hFile = _WinAPI_CreateFileEx('\\.\PhysicalDrive' & $iDrive, 3, 0, 0x01)
 
 	If Not $hFile Then
 		Return SetError(1, 0, 0)
 
 Func _WinAPI_GetDriveNumber($sDrive)
 
-	Local $hFile = _WinAPI_CreateFileEx('\\.\' & $sDrive, 3, 0, 0)
+	Local $hFile = _WinAPI_CreateFileEx('\\.\' & $sDrive, 3)
 
 	If Not $hFile Then
 		Return SetError(1, 0, 0)
 EndFunc   ;==>_WinAPI_GetFileInformationByHandle
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_GetFileSize
+; Description....: Retrieves the size of the specified file.
+; Syntax.........: _WinAPI_GetFileSize ( $hFile )
+; Parameters.....: $hFile  - A handle to the file. The handle must have been created with either the $GENERIC_READ or $GENERIC_WRITE
+;                            access right or equivalent.
+; Return values..: Success - The file size, in bytes.
+;                  Failure - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: None
+; Related........:
+; Link...........: None
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_GetFileSize($hFile)
+
+    Local $Ret = DllCall('kernel32.dll', 'int', 'GetFileSizeEx', 'ptr', $hFile, 'int64*', 0)
+
+    If (@error) Or (Not $Ret[0]) Then
+        Return SetError(1, 0, 0)
+    EndIf
+    Return $Ret[2]
+EndFunc   ;==>_WinAPI_GetFileSize
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_GetFileSizeOnDisk
 ; Description....: Retrieves the file allocation size on disk.
 ; Syntax.........: _WinAPI_GetFileSizeOnDisk ( $sFile )
 	$tIOSB = DllStructCreate('ptr;ulong_ptr')
 	$Ret = DllCall('ntdll.dll', 'uint', 'ZwQueryInformationFile', 'ptr', $hFile, 'ptr', DllStructGetPtr($tIOSB), 'ptr', DllStructGetPtr($tFNI), 'ulong', DllStructGetSize($tFNI), 'uint', 9)
 	If @error Then
-		Return SetError(1, 0, 0)
+		Return SetError(1, 0, '')
 	Else
 		If $Ret[0] Then
 			Return SetError(1, $Ret[0], 0)
 	EndIf
 	$Lenght = DllStructGetData($tFNI, 1)
 	If Not $Lenght Then
-		Return SetError(2, 0, 0)
+		Return SetError(2, 0, '')
 	EndIf
 	Return DllStructGetData(DllStructCreate('wchar[' & ($Lenght / 2) & ']', DllStructGetPtr($tFNI, 2)), 1)
 EndFunc   ;==>_WinAPI_GetFinalPathNameByHandle
 EndFunc   ;==>_WinAPI_GetMapMode
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_GetMemorySize
+; Description....: Retrieves the size of a memory block allocated from the internal library heap.
+; Syntax.........: _WinAPI_GetMemorySize ( $pMemory )
+; Parameters.....: $pMemory - A pointer to the valid memory block whose size to be retrieved.
+; Return values..: Success  - The size of the specified memory block, in bytes.
+;                  Failure  - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: The _WinAPI_GetMemorySize() function accepts only the pointers returned by some _WinAPI_* functions (see description).
+; Related........:
+; Link...........: None
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_GetMemorySize($pMemory)
+
+	Local $Result = __HeapSize($pMemory)
+
+	If @error Then
+		Return SetError(@error, 0, 0)
+	EndIf
+	Return $Result
+EndFunc   ;==>_WinAPI_GetMemorySize
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_GetMessageExtraInfo
 ; Description....: Retrieves the extra message information for the current thread.
 ; Syntax.........: _WinAPI_GetMessageExtraInfo ( )
 ;
 ;                  This function requires Windows Vista with SP1 or later.
 ; Related........:
-; Link...........: @@MsdnLink@@ DeleteFile
+; Link...........: @@MsdnLink@@ GetPhysicallyInstalledSystemMemory
 ; Example........: Yes
 ; ===============================================================================================================================
 
 EndFunc   ;==>_WinAPI_GetPosFromRect
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_GetPriorityClass
+; Description....: Retrieves the priority class for the specified process.
+; Syntax.........: _WinAPI_GetPriorityClass ( [$PID] )
+; Parameters.....: $PID    - The PID of the process. Default (0) is the current process.
+; Return values..: Success - The priority class of the specified process ($*_PRIORITY_CLASS).
+;                  Failure - 0 and sets the @error flag to non-zero.
+; Author.........: KaFu
+; Modified.......: Yashied
+; Remarks........: None
+; Related........:
+; Link...........: @@MsdnLink@@ GetPriorityClass
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_GetPriorityClass($PID = 0)
+
+	If Not $PID Then
+		$PID = @AutoItPID
+	EndIf
+
+	Local $hProcess = DllCall('kernel32.dll', 'ptr', 'OpenProcess', 'dword', __Iif($__WINVER < 0x0600, 0x00000400, 0x00001000), 'int', 0, 'dword', $PID)
+
+	If (@error) Or (Not $hProcess[0]) Then
+		Return SetError(1, 0, 0)
+	EndIf
+
+	Local $Ret = DllCall('kernel32.dll', 'dword', 'GetPriorityClass', 'ptr', $hProcess[0])
+
+	If (@error) Or (Not $Ret[0]) Then
+		$Ret = 0
+	EndIf
+	_WinAPI_CloseHandle($hProcess[0])
+	If Not IsArray($Ret) Then
+		Return SetError(1, 0, 0)
+	EndIf
+	Return $Ret[0]
+EndFunc   ;==>_WinAPI_GetPriorityClass
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_GetProcAddress
 ; Description....: Retrieves the address of a function from the specified dynamic-link library (DLL).
 ; Syntax.........: _WinAPI_GetProcAddress ( $hModule, $sProc )
 EndFunc   ;==>_WinAPI_GetSystemDefaultLCID
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_GetSystemDefaultUILanguage
+; Description....: Retrieves the language identifier for the system default UI language of the operating system.
+; Syntax.........: _WinAPI_GetSystemDefaultUILanguage ( )
+; Parameters.....: None
+; Return values..: Success - The language identifier.
+;                  Failure - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: None
+; Related........:
+; Link...........: @@MsdnLink@@ GetSystemDefaultUILanguage
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_GetSystemDefaultUILanguage()
+
+	Local $Ret = DllCall('kernel32.dll', 'dword', 'GetSystemDefaultUILanguage')
+
+	If @error Then
+		Return SetError(1, 0, 0)
+	EndIf
+	Return $Ret[0]
+EndFunc   ;==>_WinAPI_GetSystemDefaultUILanguage
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_GetSystemDEPPolicy
 ; Description....: Gets the data execution prevention (DEP) policy setting for the system.
 ; Syntax.........: _WinAPI_GetSystemDEPPolicy ( )
 EndFunc   ;==>_WinAPI_GetUserDefaultLCID
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_GetUserDefaultUILanguage
+; Description....: Returns the language identifier for the user UI language for the current user.
+; Syntax.........: _WinAPI_GetUserDefaultUILanguage ( )
+; Parameters.....: None
+; Return values..: Success - The language identifier.
+;                  Failure - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: If Multilingual User Interface (MUI) is not installed on the operating system, the function returns the default
+;                  computer user interface language.
+; Related........:
+; Link...........: @@MsdnLink@@ GetUserDefaultUILanguage
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_GetUserDefaultUILanguage()
+
+	Local $Ret = DllCall('kernel32.dll', 'dword', 'GetUserDefaultUILanguage')
+
+	If @error Then
+		Return SetError(1, 0, 0)
+	EndIf
+	Return $Ret[0]
+EndFunc   ;==>_WinAPI_GetUserDefaultUILanguage
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_GetUserObjectInformation
 ; Description....: Retrieves information about the specified window station or desktop object.
 ; Syntax.........: _WinAPI_GetUserObjectInformation ( $hObject, $iIndex )
 EndFunc   ;==>_WinAPI_IsLoadKBLayout
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_IsMemory
+; Description....: Determines whether the specified pointer points to the memory block in the internal library heap.
+; Syntax.........: _WinAPI_IsMemory ( $pMemory )
+; Parameters.....: $pMemory - A pointer to the memory block that to be tested.
+; Return values..: Success  - 1 - The specified pointer is a valid memory pointer.
+;                             0 - Otherwise.
+;                  Failure  - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: The _WinAPI_IsMemory() function accepts only the pointers returned by some _WinAPI_* functions (see description),
+;                  otherwise always returns zero.
+; Related........:
+; Link...........: None
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_IsMemory($pMemory)
+
+	Local $Result = __HeapValidate($pMemory)
+
+	If @error Then
+		Return SetError(@error, 0, 0)
+	EndIf
+	Return $Result
+EndFunc   ;==>_WinAPI_IsMemory
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_IsNetworkAlive
 ; Description....: Determines whether or not a local system is connected to a network, and identifies the type of network connection.
 ; Syntax.........: _WinAPI_IsNetworkAlive ( )
 EndFunc   ;==>_WinAPI_IsRectEmpty
 
 ; #FUNCTION# ====================================================================================================================
-; Name...........: _WinAPI_IsString
-; Description....: Determines whether the specified pointer is a valid string pointer.
-; Syntax.........: _WinAPI_IsString ( $pString )
-; Parameters.....: $pString - A pointer to the memory to test.
-; Return values..: Success  - 1 - The specified pointer points to the memory block that contains a string.
-;                             0 - Otherwise.
-;                  Failure  - 0 and sets the @error flag to non-zero.
-; Author.........: Yashied
-; Modified.......:
-; Remarks........: This function accepts only the pointers returned by _WinAPI_CreateString() function, otherwise always returns zero.
-; Related........:
-; Link...........: None
-; Example........: Yes
-; ===============================================================================================================================
-
-Func _WinAPI_IsString($pString)
-
-	Local $Result = __HeapValidate($pString)
-
-	If @error Then
-		Return SetError(@error, @extended, 0)
-	EndIf
-	Return $Result
-EndFunc   ;==>_WinAPI_IsString
-
-; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_IsThemeActive
 ; Description....: Tests if a visual style for the current application is active.
 ; Syntax.........: _WinAPI_IsThemeActive ( )
 
 Func _WinAPI_IsWritable($sDrive)
 
-	Local $hFile = _WinAPI_CreateFileEx('\\.\' & $sDrive, 3, 0, 0)
+	Local $hFile = _WinAPI_CreateFileEx('\\.\' & $sDrive, 3)
 
 	If Not $hFile Then
 		Return SetError(1, 0, 0)
 
 Func _WinAPI_LZNTCompress($tInput, ByRef $tOutput, $fMaximum = 0)
 
-	Local $tBuffer, $tWorkSpace, $Ret, $Format = 0x0002
+	Local $pBuffer[2] = [0, 0], $Ret, $Size, $Format = 0x0002, $Error = -1
 
 	$tOutput = 0
 	If $fMaximum Then
 		$Format = BitOR($Format, 0x0102)
 	EndIf
-	$Ret = DllCall('ntdll.dll', 'uint', 'RtlGetCompressionWorkSpaceSize', 'ushort', $Format, 'ulong*', 0, 'ulong*', 0)
-	If @error Then
-		Return SetError(1, 0, 0)
-	Else
-		If $Ret[0] Then
-			Return SetError(1, $Ret[0], 0)
-		EndIf
-	EndIf
-	$tWorkSpace = DllStructCreate('byte[' & $Ret[2] & ']')
-	$tBuffer = DllStructCreate('byte[' & (2 * DllStructGetSize($tInput)) & ']')
-	$Ret = DllCall('ntdll.dll', 'uint', 'RtlCompressBuffer', 'ushort', $Format, 'ptr', DllStructGetPtr($tInput), 'ulong', DllStructGetSize($tInput), 'ptr', DllStructGetPtr($tBuffer), 'ulong', DllStructGetSize($tBuffer), 'ulong', 4096, 'ulong*', 0, 'ptr', DllStructGetPtr($tWorkSpace))
-	If @error Then
-		Return SetError(1, 0, 0)
-	Else
-		If $Ret[0] Then
-			Return SetError(1, $Ret[0], 0)
-		EndIf
-	EndIf
-	$tOutput = DllStructCreate('byte[' & $Ret[7] & ']')
-	If Not _WinAPI_MoveMemory(DllStructGetPtr($tOutput), DllStructGetPtr($tBuffer), $Ret[7]) Then
+	$Size = DllStructGetSize($tInput)
+	If @error Then
+		Return SetError(1, 0, 0)
+	EndIf
+	Do
+		$Ret = DllCall('ntdll.dll', 'uint', 'RtlGetCompressionWorkSpaceSize', 'ushort', $Format, 'ulong*', 0, 'ulong*', 0)
+		If @error Then
+			ExitLoop
+		Else
+			If $Ret[0] Then
+				$Error = $Ret[0]
+				ExitLoop
+			EndIf
+		EndIf
+		$pBuffer[0] = __HeapAlloc(4 * $Size)
+		If @error Then
+			ExitLoop
+		EndIf
+		$pBuffer[1] = __HeapAlloc($Ret[2])
+		If @error Then
+			ExitLoop
+		EndIf
+		$Ret = DllCall('ntdll.dll', 'uint', 'RtlCompressBuffer', 'ushort', $Format, 'ptr', DllStructGetPtr($tInput), 'ulong', $Size, 'ptr', $pBuffer[0], 'ulong', 4 * $Size, 'ulong', 4096, 'ulong*', 0, 'ptr', $pBuffer[1])
+		If @error Then
+			ExitLoop
+		Else
+			If $Ret[0] Then
+				$Error = $Ret[0]
+				ExitLoop
+			EndIf
+		EndIf
+		$tOutput = DllStructCreate('byte[' & $Ret[7] & ']')
+		If _WinAPI_MoveMemory(DllStructGetPtr($tOutput), $pBuffer[0], $Ret[7]) Then
+			$Error = 0
+		EndIf
+	Until 1
+	For $i = 0 To 1
+		__HeapFree($pBuffer[$i])
+	Next
+	If $Error Then
 		$tOutput = 0
-		Return SetError(1, 0, 0)
+		Switch $Error
+			Case -1
+				Return SetError(1, 0, 0)
+			Case Else
+				Return SetError(1, $Error, 0)
+		EndSwitch
 	EndIf
 	Return $Ret[7]
 EndFunc   ;==>_WinAPI_LZNTCompress
 ; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_LZNTDecompress
 ; Description....: Decompresses an input data.
-; Syntax.........: _WinAPI_LZNTDecompress ( $tInput, ByRef $tOutput [, $iBufferSize] )
+; Syntax.........: _WinAPI_LZNTDecompress ( $tInput, ByRef $tOutput, $iBufferSize )
 ; Parameters.....: $tInput      - "byte[n]" or any other structure that contains the data to be decompressed.
 ;                  $tOutput     - "byte[n]" structure that is created by this function, and contain the decompressed data.
-;                  $iBufferSize - The size of the buffer which are used for decompressing, in bytes. Default is 8388608 (8 MB).
+;                  $iBufferSize - The size of the buffer which are used for decompressing, in bytes. In most cases, the buffer size
+;                                 should be several times (not less x2) larger than the size of the input data.
 ; Return values..: Success      - The size of the decompressed data, in bytes.
 ;                  Failure      - 0 and sets the @error flag to non-zero, @extended flag may contain the NTSTATUS code.
 ; Author.........: Trancexx
 ; Example........: Yes
 ; ===============================================================================================================================
 
-Func _WinAPI_LZNTDecompress($tInput, ByRef $tOutput, $iBufferSize = 8388608)
-
-	Local $tBuffer, $Ret
+Func _WinAPI_LZNTDecompress($tInput, ByRef $tOutput, $iBufferSize)
+
+	Local $pBuffer, $Ret, $Error = -1
 
 	$tOutput = 0
-	$tBuffer = DllStructCreate('byte[' & $iBufferSize & ']')
-	If @error Then
-		Return SetError(1, 0, 0)
-	EndIf
-	$Ret = DllCall('ntdll.dll', 'uint', 'RtlDecompressBuffer', 'ushort', 0x0002, 'ptr', DllStructGetPtr($tBuffer), 'ulong', $iBufferSize, 'ptr', DllStructGetPtr($tInput), 'ulong', DllStructGetSize($tInput), 'ulong*', 0)
-	If @error Then
-		Return SetError(1, 0, 0)
-	Else
-		If $Ret[0] Then
-			Return SetError(1, $Ret[0], 0)
-		EndIf
-	EndIf
-	$tOutput = DllStructCreate('byte[' & $Ret[6] & ']')
-	If Not _WinAPI_MoveMemory(DllStructGetPtr($tOutput), DllStructGetPtr($tBuffer), $Ret[6]) Then
+	If (Not IsDllStruct($tInput)) Or (Not $iBufferSize) Then
+		Return SetError(1, 0, 0)
+	EndIf
+	$pBuffer = __HeapAlloc($iBufferSize)
+	If @error Then
+		Return SetError(1, 0, 0)
+	EndIf
+	Do
+		$Ret = DllCall('ntdll.dll', 'uint', 'RtlDecompressBuffer', 'ushort', 0x0002, 'ptr', $pBuffer, 'ulong', $iBufferSize, 'ptr', DllStructGetPtr($tInput), 'ulong', DllStructGetSize($tInput), 'ulong*', 0)
+		If @error Then
+			ExitLoop
+		Else
+			If $Ret[0] Then
+				$Error = $Ret[0]
+				ExitLoop
+			EndIf
+		EndIf
+		$tOutput = DllStructCreate('byte[' & $Ret[6] & ']')
+		If _WinAPI_MoveMemory(DllStructGetPtr($tOutput), $pBuffer, $Ret[6]) Then
+			$Error = 0
+		EndIf
+	Until 1
+	__HeapFree($pBuffer)
+	If $Error Then
 		$tOutput = 0
-		Return SetError(1, 0, 0)
+		Switch $Error
+			Case -1
+				Return SetError(1, 0, 0)
+			Case Else
+				Return SetError(1, $Error, 0)
+		EndSwitch
 	EndIf
 	Return $Ret[6]
 EndFunc   ;==>_WinAPI_LZNTDecompress
 EndFunc   ;==>_WinAPI_PathAddExtension
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_PathAppend
+; Description....: Appends one path to the end of another.
+; Syntax.........: _WinAPI_PathAppend ( $sPath, $sMore )
+; Parameters.....: $sPath  - The string to which the path is appended.
+;                  $sMore  - The path to be appended.
+; Return values..: Success - The resulting path string.
+;                  Failure - Empty string and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: This function automatically inserts a backslash between the two strings, if one is not already present.
+;
+;                  The first path cannot begin with "..\\" or ".\\" to produce a relative path string. If present, those periods are
+;                  stripped from the output string. For example, appending "path3" to "..\\path1\\path2" results in an output
+;                  of "\path1\path2\path3" rather than "..\path1\path2\path3".
+; Related........:
+; Link...........: @@MsdnLink@@ PathAppend
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_PathAppend($sPath, $sMore)
+
+	Local $Ret = DllCall('shlwapi.dll', 'int', 'PathAppendW', 'wstr', $sPath, 'wstr', $sMore)
+
+	If (@error) Or (Not $Ret[0]) Then
+		Return SetError(1, 0, '')
+	EndIf
+	Return $Ret[1]
+EndFunc   ;==>_WinAPI_PathAppend
+
+; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_PathBuildRoot
+; Description....: Creates a root path from a given drive number.
+; Syntax.........: _WinAPI_PathBuildRoot ( $iDrive )
+; Parameters.....: $iDrive - The desired drive number. It should be between 0 and 25.
+; Return values..: Success - The constructed root path.
+;                  Failure - Empty string and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: None
+; Related........:
+; Link...........: @@MsdnLink@@ PathBuildRoot
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_PathBuildRoot($iDrive)
+
+	Local $Ret = DllCall('shlwapi.dll', 'ptr', 'PathBuildRootW', 'wstr', '', 'int', $iDrive)
+
+	If (@error) Or (Not $Ret[1]) Then
+		Return SetError(1, 0, '')
+	EndIf
+	Return $Ret[1]
+EndFunc   ;==>_WinAPI_PathBuildRoot
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_PathCanonicalize
 ; Description....: Removes elements of a file path according to special strings inserted into that path.
 ; Syntax.........: _WinAPI_PathCanonicalize ( $sPath )
 				Return SetError(1, $Ret[0], 0)
 		EndSwitch
 	EndIf
-	$pBuffer = __HeapAlloc($Ret[5])
+	$pBuffer = __HeapAlloc($Ret[5], 1)
 	$Ret = DllCall('advapi32.dll', 'long', 'RegQueryMultipleValuesW', 'ulong_ptr', $hKey, 'ptr', $pValent, 'dword', $Values, 'ptr', $pBuffer, 'dword*', $Ret[5])
 	If (@error) Or ($Ret[0]) Then
 		__HeapFree($pBuffer)
 EndFunc   ;==>_WinAPI_RemoveClipboardFormatListener
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_RemoveDirectory
+; Description....: Deletes an existing empty directory.
+; Syntax.........: _WinAPI_RemoveDirectory ( $sPath )
+; Parameters.....: $sPath  - The path of the empty directory to be removed.
+; Return values..: Success - 1.
+;                  Failure - 0 and sets the @error flag to non-zero.
+; Author.........: Yashied
+; Modified.......:
+; Remarks........: The _WinAPI_RemoveDirectory() function marks a directory for deletion on close. Therefore, the directory is
+;                  not removed until the last handle to the directory is closed.
+; Related........:
+; Link...........: @@MsdnLink@@ RemoveDirectory
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_RemoveDirectory($sPath)
+
+	Local $Ret = DllCall('kernel32.dll', 'int', 'RemoveDirectoryW', 'wstr', $sPath)
+
+	If (@error) Or (Not $Ret[0]) Then
+		Return SetError(1, 0, 0)
+	EndIf
+	Return 1
+EndFunc   ;==>_WinAPI_RemoveDirectory
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_RemoveFontMemResourceEx
 ; Description....: Removes the fonts added from a memory image.
 ; Syntax.........: _WinAPI_RemoveFontMemResourceEx ( $hFont )
 ; Name...........: _WinAPI_ReOpenFile
 ; Description....: Reopens the specified file system object with different access rights, sharing mode, and flags.
 ; Syntax.........: _WinAPI_ReOpenFile ( $hFile, $iAccess, $iShare [, $iFlags] )
-; Parameters.....: $sFile   - Handle to the object to be reopened. The object must have been created by the _WinAPI_CreateFile() function.
+; Parameters.....: $sFile   - Handle to the object to be reopened. The object must have been created by the _WinAPI_CreateFileEx() function.
 ;                  $iAccess - The required access to the object. If this parameter is 0, the application can query device attributes
 ;                             without accessing the device.
 ;
 	Local $tBuff
 
 	$__Text = __HeapReAlloc($__Text, 4 * $__Buff)
+	If @error Then
+		Return SetError(1, 0, 0)
+	EndIf
 	$tBuff = DllStructCreate('wchar[' & $__Buff & '];wchar[' & $__Buff & ']', $__Text)
 	DllStructSetData($tBuff, 1, StringLeft($sFindWhat, $__Buff - 1))
 	DllStructSetData($tBuff, 2, StringLeft($sReplaceWith, $__Buff - 1))
 			DllStructSetData($tDIB, 'biYPelsPerMeter', $iYPelsPerMeter)
 		EndIf
 		_WinAPI_ReleaseDC(0, $hDC)
-		$hFile = _WinAPI_CreateFileEx($sFile, 2, 0x40000000, 0)
+		$hFile = _WinAPI_CreateFileEx($sFile, 2, 0x40000000)
 		If @error Then
 			ExitLoop
 		EndIf
 		Dim $Temp[1] = [0]
 	EndIf
 
-	Local $hFile = _WinAPI_CreateFileEx($sFile, 2, 0x40000000, 0)
+	Local $hFile = _WinAPI_CreateFileEx($sFile, 2, 0x40000000)
 
 	If @error Then
 		Return SetError(1, 0, 0)
 EndFunc   ;==>_WinAPI_SetPolyFillMode
 
 ; #FUNCTION# ====================================================================================================================
+; Name...........: _WinAPI_SetPriorityClass
+; Description....: Sets the priority class for the specified process.
+; Syntax.........: _WinAPI_SetPriorityClass ( $iPriority [, $PID] )
+; Parameters.....: $iPriority - The priority class for the process. This parameter can be one of the following values.
+;
+;                               $ABOVE_NORMAL_PRIORITY_CLASS
+;                               $BELOW_NORMAL_PRIORITY_CLASS
+;                               $HIGH_PRIORITY_CLASS
+;                               $IDLE_PRIORITY_CLASS
+;                               $NORMAL_PRIORITY_CLASS
+;                               $REALTIME_PRIORITY_CLASS
+;
+;                               Windows Vista or later
+;
+;                               $PROCESS_MODE_BACKGROUND_BEGIN
+;                               $PROCESS_MODE_BACKGROUND_END
+;
+;                  $PID       - The PID of the process. Default (0) is the current process.
+; Return values..: Success    - 1.
+;                  Failure    - 0 and sets the @error flag to non-zero.
+; Author.........: KaFu
+; Modified.......: Yashied
+; Remarks........: None
+; Related........:
+; Link...........: @@MsdnLink@@ SetPriorityClass
+; Example........: Yes
+; ===============================================================================================================================
+
+Func _WinAPI_SetPriorityClass($iPriority, $PID = 0)
+
+	If Not $PID Then
+		$PID = @AutoItPID
+	EndIf
+
+	Local $hProcess = DllCall('kernel32.dll', 'ptr', 'OpenProcess', 'dword', __Iif($__WINVER < 0x0600, 0x00000600, 0x00001200), 'int', 0, 'dword', $PID)
+
+	If (@error) Or (Not $hProcess[0]) Then
+		Return SetError(1, 0, 0)
+	EndIf
+
+	Local $Ret = DllCall('kernel32.dll', 'int', 'SetPriorityClass', 'ptr', $hProcess[0], 'dword', $iPriority)
+
+	If (@error) Or (Not $Ret[0]) Then
+		$Ret = 0
+	EndIf
+	_WinAPI_CloseHandle($hProcess[0])
+	If Not IsArray($Ret) Then
+		Return SetError(1, 0, 0)
+	EndIf
+	Return 1
+EndFunc   ;==>_WinAPI_SetPriorityClass
+
+; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_SetProcessShutdownParameters
 ; Description....: Sets a shutdown order for a process relative to the other processes in the system.
 ; Syntax.........: _WinAPI_SetProcessShutdownParameters ( $iLevel [, $fDialog] )
 ; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_ShellEmptyRecycleBin
 ; Description....: Empties the Recycle Bin on the specified drive.
-; Syntax.........: _WinAPI_ShellEmptyRecycleBin ( $sRoot [, $iFlags [, $hParent]] )
+; Syntax.........: _WinAPI_ShellEmptyRecycleBin ( [$sRoot [, $iFlags [, $hParent]]] )
 ; Parameters.....: $sRoot   - The string that contains the path of the root drive on which the Recycle Bin is located. This string
 ;                             can be formatted with the drive, folder, and subfolder names, for example "c:\windows\system\".
 ;                             If this parameter is empty string, all Recycle Bins on all drives will be emptied.
 ; Example........: Yes
 ; ===============================================================================================================================
 
-Func _WinAPI_ShellEmptyRecycleBin($sRoot, $iFlags = 0, $hParent = 0)
+Func _WinAPI_ShellEmptyRecycleBin($sRoot = '', $iFlags = 0, $hParent = 0)
 
 	Local $Ret = DllCall('shell32.dll', 'uint', 'SHEmptyRecycleBinW', 'hwnd', $hParent, 'wstr', $sRoot, 'dword', $iFlags)
 
 
 Func _WinAPI_ShellOpenFolderAndSelectItems($sPath, $aNames = 0, $iStart = 0, $iEnd = -1, $iFlags = 0)
 
-	Local $PIDL, $Ret, $tPtr = 0, $Count = 0
+	Local $PIDL, $Ret, $tPtr = 0, $Count = 0, $Obj = False
 
 	$sPath = _WinAPI_PathRemoveBackslash(_WinAPI_PathSearchAndQualify($sPath))
 	If IsArray($aNames) Then
 			Next
 		EndIf
 	EndIf
-	_WinAPI_CoInitialize()
+	If _WinAPI_CoInitialize() Then
+		$Obj = 1
+	EndIf
 	$Ret = DllCall('shell32.dll', 'uint', 'SHOpenFolderAndSelectItems', 'ptr', $PIDL, 'uint', $Count, 'ptr', DllStructGetPtr($tPtr), 'dword', $iFlags)
 	If @error Then
 		$Ret = 0
 			$Ret = $Ret[0]
 		EndIf
 	EndIf
-	_WinAPI_CoUninitialize()
+	If $Obj Then
+		_WinAPI_CoUninitialize()
+	EndIf
 	_WinAPI_CoTaskMemFree($PIDL)
 	For $i = 1 To $Count
 		$PIDL = DllStructGetData($tPtr, $i)
 ; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_ShellQueryRecycleBin
 ; Description....: Retrieves the size of the Recycle Bin and the number of items in it, for a specified drive.
-; Syntax.........: _WinAPI_ShellQueryRecycleBin ( $sRoot )
+; Syntax.........: _WinAPI_ShellQueryRecycleBin ( [$sRoot] )
 ; Parameters.....: $sRoot  - The string that contains the path of the root drive on which the Recycle Bin is located. This string
 ;                            can be formatted with the drive, folder, and subfolder names, for example "c:\windows\system\".
 ;                            If this parameter is empty string, information is retrieved for all Recycle Bins on all drives.
 ; Example........: Yes
 ; ===============================================================================================================================
 
-Func _WinAPI_ShellQueryRecycleBin($sRoot)
+Func _WinAPI_ShellQueryRecycleBin($sRoot = '')
 
 	Local $tSHQRBI = DllStructCreate('align 4;dword_ptr;int64;int64')
 
 ; Name...........: _WinAPI_ShowLastError
 ; Description....: Shows the last error code and message.
 ; Syntax.........: _WinAPI_ShowLastError ( [$sText [, $fAbort [, $iLanguage]]] )
-; Parameters.....: $sText     - The user's text to be displayed with the error message.
-;                  $fAbort    - Specifies whether to exit after displaying an error message, valid values:
-;                  |TRUE  - Exit the program after displaying a message if it indicates an error.
+; Parameters.....: $sText     - The user's text that to be displayed with the message.
+;                  $fAbort    - Specifies whether to exit the script after displaying an error message, valid values:
+;                  |TRUE  - Exit the script after displaying a message if it indicates an error.
 ;                  |FALSE - Always return normally. (Default)
 ;                  $iLanguage - The language identifier for the message.
 ; Return values..: None
 ; #FUNCTION# ====================================================================================================================
 ; Name...........: _WinAPI_TileWindows
 ; Description....: Tiles the specified child windows of the specified parent window.
-; Syntax.........: _WinAPI_TileWindows ( Const ByRef $aWnds [, $tRECT [, $hParent [, $iFlags [, $iStart [, $iEnd]]]]] )
+; Syntax.........: _WinAPI_TileWindows ( $aWnds [, $tRECT [, $hParent [, $iFlags [, $iStart [, $iEnd]]]]] )
 ; Parameters.....: $aWnds   - The array of handles to the child windows to arrange. If a specified child window is a top-level window
 ;                             with the style $WS_EX_TOPMOST or $WS_EX_TOOLWINDOW, the child window is not arranged. If this parameter
 ;                             is 0, all child windows of the specified parent window (or of the desktop window) are arranged.
 ; Example........: Yes
 ; ===============================================================================================================================
 
-Func _WinAPI_TileWindows(Const ByRef $aWnds, $tRECT = 0, $hParent = 0, $iFlags = 0, $iStart = 0, $iEnd = -1)
-
-	If Not IsArray($aWnds) Then
-		Return SetError(2, 0, 0)
-	EndIf
-
-	Local $Count, $tWnds
-
-	If $iStart < 0 Then
-		$iStart = 0
-	EndIf
-	If ($iEnd < 0) Or ($iEnd > UBound($aWnds) - 1) Then
-		$iEnd = UBound($aWnds) - 1
-	EndIf
-	$Count = $iEnd - $iStart + 1
-	If $Count < 1 Then
-		Return SetError(1, 0, 0)
-	EndIf
-	$tWnds = DllStructCreate('hwnd[' & $Count & ']')
-	If @error Then
-		Return SetError(1, 0, 0)
-	EndIf
-	$Count = 1
-	For $i = $iStart To $iEnd
-		DllStructSetData($tWnds, 1, $aWnds[$i], $Count)
-		$Count += 1
-	Next
+Func _WinAPI_TileWindows($aWnds, $tRECT = 0, $hParent = 0, $iFlags = 0, $iStart = 0, $iEnd = -1)
+
+	Local $Count, $tWnds = 0
+
+	If IsArray($aWnds) Then
+		If $iStart < 0 Then
+			$iStart = 0
+		EndIf
+		If ($iEnd < 0) Or ($iEnd > UBound($aWnds) - 1) Then
+			$iEnd = UBound($aWnds) - 1
+		EndIf
+		$Count = $iEnd - $iStart + 1
+		If $Count < 1 Then
+			Return SetError(1, 0, 0)
+		EndIf
+		$tWnds = DllStructCreate('hwnd[' & $Count & ']')
+		If @error Then
+			Return SetError(1, 0, 0)
+		EndIf
+		$Count = 1
+		For $i = $iStart To $iEnd
+			DllStructSetData($tWnds, 1, $aWnds[$i], $Count)
+			$Count += 1
+		Next
+	Else
+		If $aWnds Then
+			Return SetError(2, 0, 0)
+		EndIf
+	EndIf