Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

WinAPIEx UDF


  • Please log in to reply
474 replies to this topic

#1 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 21 July 2009 - 10:15 PM

*
POPULAR

LAST VERSION - 3.8
03-Jul-12


MSDN_logo_new.png



This library contains the WinAPI functions are not included for unknown reasons to the native AutoIt WinAPI library. I use this UDF in nearly all of my programs, and decided to share it with the AutoIt community. I agree that over time some of these functions will be part of the native AutoIt library, but still... The library includes some undocumented, but useful functions (eg _WinAPI_GetFontResourceInfo()). The library also contains all the necessary constants to work with the appropriate functions. Most functions from this UDF intended for experienced users, but beginners will find the same lot of useful information for yourself. I will be to periodically add new functions to the library.

The archive contains WinAPIEx library, and as usual an excellent examples from me. Some examples I took from this forum and to simplify them for better understanding. For those who use SciTE (full version) I have prepared the au3.userudfs.properties and au3.user.calltips.api files to highlight functions from this UDF in your scripts. Just copy this files to ...SciTE\Properties and ...SciTE\API, respectively. I hope this UDF will be useful for many as for me. I look forward to any feedback and suggestions. Maybe somebody wants to add new WinAPI functions?

Credits

Spoiler


Available functions

Spoiler


Files to download

WinAPIEx UDF v3.8 for AutoIt 3.3.6.1
Previous downloads: 27953

Spoiler


WinAPIEx UDF v3.8 for AutoIt 3.3.8.x
Previous downloads: 14850

Spoiler

Edited by Yashied, 09 September 2013 - 09:58 PM.








#2 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,402 posts

Posted 21 July 2009 - 10:36 PM

Awesome :) , much to play without bothering MSDN ;) , this one get's 5 stars without even reading the UDF (yet)...

Edit: Awesome #2, I've never seen a custom au3.userudfs.properties, didn't even know it exits :)...

Edited by KaFu, 21 July 2009 - 10:37 PM.


#3 Kip

Kip

    Into the JavaScript

  • Active Members
  • PipPipPipPipPipPip
  • 1,690 posts

Posted 21 July 2009 - 10:42 PM

Very nice, I like the file extension example.

#4 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 21 July 2009 - 10:44 PM

Awesome :) , much to play without bothering MSDN ;) , this one get's 5 stars without even reading the UDF (yet)...

Thanks.

Edit: Awesome #2, I've never seen a custom au3.userudfs.properties, didn't even know it exits :) ...

Thanks #2. Maybe this will be useful to you.

Edited by Yashied, 21 July 2009 - 10:45 PM.


#5 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,402 posts

Posted 21 July 2009 - 10:52 PM

Thanks #2. Maybe this will be useful to you.

Looks very nice, will check it out :) !

Edited by KaFu, 21 July 2009 - 10:53 PM.


#6 Authenticity

Authenticity

    Universalist

  • MVPs
  • 2,619 posts

Posted 22 July 2009 - 12:38 AM

Thank you very much for the share. In case any one like me like the hinting call tip using parameterized string:

Plain Text         
_WinAPI_AddFontResource ($sFont) (required: #include <WinAPIEx.au3>) _WinAPI_AnimateWindow ($hWnd, $iFlags [, $iDuration]) (required: #include <WinAPIEx.au3>) _WinAPI_BringWindowToTop ($hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_CloseWindow ($hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_CopyFileEx ($sSource, $sDestination, $pProgressRoutine [, $iFlags]) (required: #include <WinAPIEx.au3>) _WinAPI_CopyImage ($hImage [, $iType [, $xDesired [, $yDesired [, $iFlags]]]]) (required: #include <WinAPIEx.au3>) _WinAPI_CreateIcon ($hInstance, $iWidth, $iHeight, $iPlanes, $iBitsPixel, $hANDBits, $hXORBits) (required: #include <WinAPIEx.au3>) _WinAPI_CreateIconIndirect ($hBitmap, $hMask [, $XHotspot [, $YHotspot [, $iFlag]]]) (required: #include <WinAPIEx.au3>) _WinAPI_DrawAnimatedRects ($hWnd, $iAnim, $tRectFrom, $tRectTo) (required: #include <WinAPIEx.au3>) _WinAPI_DrawBitmap ($hDC, $iX, $iY, $hBitmap) (required: #include <WinAPIEx.au3>) _WinAPI_DuplicateBitmap ($hBitmap) (required: #include <WinAPIEx.au3>) _WinAPI_DuplicateIcon ($hIcon) (required: #include <WinAPIEx.au3>) _WinAPI_EjectMedia ($sDrive) (required: #include <WinAPIEx.au3>) _WinAPI_EmptyWorkingSet ([$iPID=0]) (required: #include <WinAPIEx.au3>) _WinAPI_EnumResourceNames ($hModule, $sType, $pEnumFunc [, $lParam]) (required: #include <WinAPIEx.au3>) _WinAPI_EnumResourceTypes ($hModule, $pEnumFunc [, $lParam]) (required: #include <WinAPIEx.au3>) _WinAPI_ExtractAssociatedIcon ($hInstance, $sIcon, $iIndex) (required: #include <WinAPIEx.au3>) _WinAPI_FatalExit ($iCode) (required: #include <WinAPIEx.au3>) _WinAPI_FindResource ($hInstance, $sResName, $sResType) (required: #include <WinAPIEx.au3>) _WinAPI_FindResourceEx ($hInstance, $sResName, $sResType, $iResLang) (required: #include <WinAPIEx.au3>) _WinAPI_FreeHandle ($hObject) (required: #include <WinAPIEx.au3>) _WinAPI_FreeIcon ($hIcon) (required: #include <WinAPIEx.au3>) _WinAPI_FreeObject ($hObject) (required: #include <WinAPIEx.au3>) _WinAPI_FreeResource ($hResData) (required: #include <WinAPIEx.au3>) _WinAPI_GetActiveWindow () (required: #include <WinAPIEx.au3>) _WinAPI_GetBitmapDimension ($hBitmap) (required: #include <WinAPIEx.au3>) _WinAPI_GetBkColor ($hDC) (required: #include <WinAPIEx.au3>) _WinAPI_GetClassLong ($hWnd, $nIndex) (required: #include <WinAPIEx.au3>) _WinAPI_GetCompression ($sPath) (required: #include <WinAPIEx.au3>) _WinAPI_GetDriveBusType ($sDrive) (required: #include <WinAPIEx.au3>) _WinAPI_GetDriveGeometryEx ($iDrive) (required: #include <WinAPIEx.au3>) _WinAPI_GetDriveNumber ($sDrive) (required: #include <WinAPIEx.au3>) _WinAPI_GetDriveType ([$sDrive='']) (required: #include <WinAPIEx.au3>) _WinAPI_GetFontResourceInfo ($sFont) (required: #include <WinAPIEx.au3>) _WinAPI_GetForegroundWindow () (required: #include <WinAPIEx.au3>) _WinAPI_GetHandleInformation ($hObject) (required: #include <WinAPIEx.au3>) _WinAPI_GetIconBitmap ($hIcon) (required: #include <WinAPIEx.au3>) _WinAPI_GetIconDimension ($hIcon) (required: #include <WinAPIEx.au3>) _WinAPI_GetIconMask ($hIcon) (required: #include <WinAPIEx.au3>) _WinAPI_GetKeyboardLayout ($hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_GetKeyboardLayoutList () (required: #include <WinAPIEx.au3>) _WinAPI_GetKeyboardState () (required: #include <WinAPIEx.au3>) _WinAPI_GetKeyNameText ($lParam) (required: #include <WinAPIEx.au3>) _WinAPI_GetKeyState ($vkCode) (required: #include <WinAPIEx.au3>) _WinAPI_GetLayeredWindowAttributes ($hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_GetTextColor ($hDC) (required: #include <WinAPIEx.au3>) _WinAPI_GetTextMetrics ($hDC) (required: #include <WinAPIEx.au3>) _WinAPI_GetThemeColor ($hWnd, $sClass, $iPart, $iState, $iProp) (required: #include <WinAPIEx.au3>) _WinAPI_GetVersionEx () (required: #include <WinAPIEx.au3>) _WinAPI_GetWorkArea () (required: #include <WinAPIEx.au3>) _WinAPI_GlobalSize ($hMem) (required: #include <WinAPIEx.au3>) _WinAPI_InvalidateRect ($hWnd [, $tRECT [, $iFlag]]) (required: #include <WinAPIEx.au3>) _WinAPI_InvalidateRgn ($hWnd [, $hRgn [, $iFlag]]) (required: #include <WinAPIEx.au3>) _WinAPI_IsChild ($hWndParent, $hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_IsDoorOpen ($sDrive) (required: #include <WinAPIEx.au3>) _WinAPI_IsIconic ($hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_IsNetworkAlive () (required: #include <WinAPIEx.au3>) _WinAPI_IsPressed ( [, $iFrom [, $iTo]]) (required: #include <WinAPIEx.au3>) _WinAPI_IsWindowEnabled ($hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_IsWritable ($sDrive) (required: #include <WinAPIEx.au3>) _WinAPI_IsZoomed ($hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_keybd_event ($vkCode, $iScanCode, $iFlag, $iExtraInfo) (required: #include <WinAPIEx.au3>) _WinAPI_KillTimer ($hWnd, $iTimerId) (required: #include <WinAPIEx.au3>) _WinAPI_LoadMedia ($sDrive) (required: #include <WinAPIEx.au3>) _WinAPI_LoadResource ($hInstance, $hResInfo) (required: #include <WinAPIEx.au3>) _WinAPI_LockResource ($hResData) (required: #include <WinAPIEx.au3>) _WinAPI_LockWorkStation () (required: #include <WinAPIEx.au3>) _WinAPI_OpenIcon ($hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_PrivateExtractIcon ($sIcon, $iIndex, $iWidth, $iHeight) (required: #include <WinAPIEx.au3>) _WinAPI_RemoveFontResource ($sFont) (required: #include <WinAPIEx.au3>) _WinAPI_RestartDialog ( [, $sText [, $iFlags [, $hParent]]]) (required: #include <WinAPIEx.au3>) _WinAPI_SetActiveWindow ($hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_SetClassLong ($hWnd, $nIndex, $dwNewLong) (required: #include <WinAPIEx.au3>) _WinAPI_SetCompression ($sPath, $iCompression) (required: #include <WinAPIEx.au3>) _WinAPI_SetForegroundWindow ($hWnd) (required: #include <WinAPIEx.au3>) _WinAPI_SetHandleInformation ($hObject, $iMask, $iFlags) (required: #include <WinAPIEx.au3>) _WinAPI_SetKeyboardLayout ($hWnd, $sLayout) (required: #include <WinAPIEx.au3>) _WinAPI_SetKeyboardState ($tState) (required: #include <WinAPIEx.au3>) _WinAPI_SetLayeredWindowAttributes ($hWnd, $iRGB, $iAlpha, $iFlags) (required: #include <WinAPIEx.au3>) _WinAPI_SetParent ($hWndChild, $hWndParent) (required: #include <WinAPIEx.au3>) _WinAPI_SetTimer ($hWnd, $iTimerId, $iElapse, $pTimerFunc) (required: #include <WinAPIEx.au3>) _WinAPI_Shell_NotifyIcon ($iMessage, $tNOTIFYICONDATA) (required: #include <WinAPIEx.au3>) _WinAPI_ShellAbout ($sTitle, $sName, $sText [, $hIcon [, $hParent]]) (required: #include <WinAPIEx.au3>) _WinAPI_SHExtractIcons ($sIcon, $iIndex, $iWidth, $iHeight) (required: #include <WinAPIEx.au3>) _WinAPI_SHGetFileInfo ($sPath, $iFlags [, $iAttributes]) (required: #include <WinAPIEx.au3>) _WinAPI_ShowOwnedPopups ($hWnd, $iFlag) (required: #include <WinAPIEx.au3>) _WinAPI_SizeofResource ($hInstance, $hResInfo) (required: #include <WinAPIEx.au3>) _WinAPI_SwitchColor ($iColor) (required: #include <WinAPIEx.au3>) _WinAPI_SwitchToThisWindow ($hWnd [, $iFlag]) (required: #include <WinAPIEx.au3>) _WinAPI_ValidateRect ($hWnd [, $tRECT [, $iFlag]]) (required: #include <WinAPIEx.au3>) _WinAPI_ValidateRgn ($hWnd [, $hRgn [, $iFlag]]) (required: #include <WinAPIEx.au3>)


..hope you find it helpful.

#7 Datenshi

Datenshi

    Prodigy

  • Active Members
  • PipPipPip
  • 179 posts

Posted 22 July 2009 - 09:22 PM

Good contribution, well done!

#8 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,758 posts

Posted 22 July 2009 - 11:28 PM

Nice! Five stars.

But better will be to prepare/post this on Trac (as feature request) in form for standard WinAPI include file.
I have added some API functions there too.

#9 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 23 July 2009 - 12:39 AM

This is Great! 5* from me! Thankyou!

#10 WideBoyDixon

WideBoyDixon

    Code Monkey

  • Active Members
  • PipPipPipPipPipPip
  • 381 posts

Posted 23 July 2009 - 08:44 AM

This is fantastic! Can't remember which ones I'm getting credit for but that's old age for you. A couple of possible additions:

AutoIt         
; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_GetLocalTime ; Description ...: Gets the local time ; Syntax.........: _WinAPI_GetLocalTime() ; Parameters ....: ; Return values .: Success       - Array with eight values ;                                   0 - Year ;                                   1 - Month ;                                   2 - Day of week ;                                   3 - Day ;                                   4 - Hour ;                                   5 - Minute ;                                   6 - Second ;                                   7 - Milliseconds ; Author ........: WideBoyDixon ; Modified.......: ; Remarks .......: ; Related .......: _WinAPI_GetSystemTime ; Link ..........; ; Example .......; ; =============================================================================================================================== Func _WinAPI_GetLocalTime()     Local $aRet[8], $SystemTime = DllStructCreate("ushort[8]")     DllCall("kernel32.dll", "none", "GetLocalTime", "ptr", DllStructGetPtr($SystemTime))     For $i = 1 To 8         $aRet[$i - 1] = DllStructGetData($SystemTime, 1, $i)     Next     Return $aRet EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_GetSystemTime ; Description ...: Gets the system time ; Syntax.........: _WinAPI_GetSystemTime() ; Parameters ....: ; Return values .: Success       - Array with eight values ;                                   0 - Year ;                                   1 - Month ;                                   2 - Day of week ;                                   3 - Day ;                                   4 - Hour ;                                   5 - Minute ;                                   6 - Second ;                                   7 - Milliseconds ; Author ........: WideBoyDixon ; Modified.......: ; Remarks .......: ; Related .......: _WinAPI_GetLocalTime ; Link ..........; ; Example .......; ; =============================================================================================================================== Func _WinAPI_GetSystemTime()     Local $aRet[8], $SystemTime = DllStructCreate("ushort[8]")     DllCall("kernel32.dll", "none", "GetSystemTime", "ptr", DllStructGetPtr($SystemTime))     For $i = 1 To 8         $aRet[$i - 1] = DllStructGetData($SystemTime, 1, $i)     Next     Return $aRet EndFunc


WBD

#11 WideBoyDixon

WideBoyDixon

    Code Monkey

  • Active Members
  • PipPipPipPipPipPip
  • 381 posts

Posted 23 July 2009 - 08:55 AM

Sorry! Just found a couple more which I use in order to provide support for translation of my applications:

AutoIt         
; =============================================================================================================================== ; _WinAPI_GetLocaleInfo() ; =============================================================================================================================== Global Const $LOCALE_NOUSEROVERRIDE         = 0x80000000   ;// do not use user overrides Global Const $LOCALE_USE_CP_ACP             = 0x40000000   ;// use the system ACP Global Const $LOCALE_RETURN_NUMBER          = 0x20000000   ;// return number instead of string ;  The following LCTypes are mutually exclusive in that they may NOT be used in combination with each other. Global Const $LOCALE_ILANGUAGE              = 0x00000001   ;// language id Global Const $LOCALE_SLANGUAGE              = 0x00000002   ;// localized name of language Global Const $LOCALE_SENGLANGUAGE           = 0x00001001   ;// English name of language Global Const $LOCALE_SABBREVLANGNAME        = 0x00000003   ;// abbreviated language name Global Const $LOCALE_SNATIVELANGNAME        = 0x00000004   ;// native name of language Global Const $LOCALE_ICOUNTRY               = 0x00000005   ;// country code Global Const $LOCALE_SCOUNTRY               = 0x00000006   ;// localized name of country Global Const $LOCALE_SENGCOUNTRY            = 0x00001002   ;// English name of country Global Const $LOCALE_SABBREVCTRYNAME        = 0x00000007   ;// abbreviated country name Global Const $LOCALE_SNATIVECTRYNAME        = 0x00000008   ;// native name of country Global Const $LOCALE_IDEFAULTLANGUAGE       = 0x00000009   ;// default language id Global Const $LOCALE_IDEFAULTCOUNTRY        = 0x0000000A   ;// default country code Global Const $LOCALE_IDEFAULTCODEPAGE       = 0x0000000B   ;// default oem code page Global Const $LOCALE_IDEFAULTANSICODEPAGE   = 0x00001004   ;// default ansi code page Global Const $LOCALE_IDEFAULTMACCODEPAGE    = 0x00001011   ;// default mac code page Global Const $LOCALE_SLIST                  = 0x0000000C   ;// list item separator Global Const $LOCALE_IMEASURE               = 0x0000000D   ;// 0 = metric, 1 = US Global Const $LOCALE_SDECIMAL               = 0x0000000E   ;// decimal separator Global Const $LOCALE_STHOUSAND              = 0x0000000F   ;// thousand separator Global Const $LOCALE_SGROUPING              = 0x00000010   ;// digit grouping Global Const $LOCALE_IDIGITS                = 0x00000011   ;// number of fractional digits Global Const $LOCALE_ILZERO                 = 0x00000012   ;// leading zeros for decimal Global Const $LOCALE_INEGNUMBER             = 0x00001010   ;// negative number mode Global Const $LOCALE_SNATIVEDIGITS          = 0x00000013   ;// native ascii 0-9 Global Const $LOCALE_SCURRENCY              = 0x00000014   ;// local monetary symbol Global Const $LOCALE_SINTLSYMBOL            = 0x00000015   ;// intl monetary symbol Global Const $LOCALE_SMONDECIMALSEP         = 0x00000016   ;// monetary decimal separator Global Const $LOCALE_SMONTHOUSANDSEP        = 0x00000017   ;// monetary thousand separator Global Const $LOCALE_SMONGROUPING           = 0x00000018   ;// monetary grouping Global Const $LOCALE_ICURRDIGITS            = 0x00000019   ;// # local monetary digits Global Const $LOCALE_IINTLCURRDIGITS        = 0x0000001A   ;// # intl monetary digits Global Const $LOCALE_ICURRENCY              = 0x0000001B   ;// positive currency mode Global Const $LOCALE_INEGCURR               = 0x0000001C   ;// negative currency mode Global Const $LOCALE_SDATE                  = 0x0000001D   ;// date separator Global Const $LOCALE_STIME                  = 0x0000001E   ;// time separator Global Const $LOCALE_SSHORTDATE             = 0x0000001F   ;// short date format string Global Const $LOCALE_SLONGDATE              = 0x00000020   ;// long date format string Global Const $LOCALE_STIMEFORMAT            = 0x00001003   ;// time format string Global Const $LOCALE_IDATE                  = 0x00000021   ;// short date format ordering Global Const $LOCALE_ILDATE                 = 0x00000022   ;// long date format ordering Global Const $LOCALE_ITIME                  = 0x00000023   ;// time format specifier Global Const $LOCALE_ITIMEMARKPOSN          = 0x00001005   ;// time marker position Global Const $LOCALE_ICENTURY               = 0x00000024   ;// century format specifier (short date) Global Const $LOCALE_ITLZERO                = 0x00000025   ;// leading zeros in time field Global Const $LOCALE_IDAYLZERO              = 0x00000026   ;// leading zeros in day field (short date) Global Const $LOCALE_IMONLZERO              = 0x00000027   ;// leading zeros in month field (short date) Global Const $LOCALE_S1159                  = 0x00000028   ;// AM designator Global Const $LOCALE_S2359                  = 0x00000029   ;// PM designator Global Const $LOCALE_ICALENDARTYPE          = 0x00001009   ;// type of calendar specifier Global Const $LOCALE_IOPTIONALCALENDAR      = 0x0000100B   ;// additional calendar types specifier Global Const $LOCALE_IFIRSTDAYOFWEEK        = 0x0000100C   ;// first day of week specifier Global Const $LOCALE_IFIRSTWEEKOFYEAR       = 0x0000100D   ;// first week of year specifier Global Const $LOCALE_SDAYNAME1              = 0x0000002A   ;// long name for Monday Global Const $LOCALE_SDAYNAME2              = 0x0000002B   ;// long name for Tuesday Global Const $LOCALE_SDAYNAME3              = 0x0000002C   ;// long name for Wednesday Global Const $LOCALE_SDAYNAME4              = 0x0000002D   ;// long name for Thursday Global Const $LOCALE_SDAYNAME5              = 0x0000002E   ;// long name for Friday Global Const $LOCALE_SDAYNAME6              = 0x0000002F   ;// long name for Saturday Global Const $LOCALE_SDAYNAME7              = 0x00000030   ;// long name for Sunday Global Const $LOCALE_SABBREVDAYNAME1        = 0x00000031   ;// abbreviated name for Monday Global Const $LOCALE_SABBREVDAYNAME2        = 0x00000032   ;// abbreviated name for Tuesday Global Const $LOCALE_SABBREVDAYNAME3        = 0x00000033   ;// abbreviated name for Wednesday Global Const $LOCALE_SABBREVDAYNAME4        = 0x00000034   ;// abbreviated name for Thursday Global Const $LOCALE_SABBREVDAYNAME5        = 0x00000035   ;// abbreviated name for Friday Global Const $LOCALE_SABBREVDAYNAME6        = 0x00000036   ;// abbreviated name for Saturday Global Const $LOCALE_SABBREVDAYNAME7        = 0x00000037   ;// abbreviated name for Sunday Global Const $LOCALE_SMONTHNAME1            = 0x00000038   ;// long name for January Global Const $LOCALE_SMONTHNAME2            = 0x00000039   ;// long name for February Global Const $LOCALE_SMONTHNAME3            = 0x0000003A   ;// long name for March Global Const $LOCALE_SMONTHNAME4            = 0x0000003B   ;// long name for April Global Const $LOCALE_SMONTHNAME5            = 0x0000003C   ;// long name for May Global Const $LOCALE_SMONTHNAME6            = 0x0000003D   ;// long name for June Global Const $LOCALE_SMONTHNAME7            = 0x0000003E   ;// long name for July Global Const $LOCALE_SMONTHNAME8            = 0x0000003F   ;// long name for August Global Const $LOCALE_SMONTHNAME9            = 0x00000040   ;// long name for September Global Const $LOCALE_SMONTHNAME10           = 0x00000041   ;// long name for October Global Const $LOCALE_SMONTHNAME11           = 0x00000042   ;// long name for November Global Const $LOCALE_SMONTHNAME12           = 0x00000043   ;// long name for December Global Const $LOCALE_SMONTHNAME13           = 0x0000100E   ;// long name for 13th month (if exists) Global Const $LOCALE_SABBREVMONTHNAME1      = 0x00000044   ;// abbreviated name for January Global Const $LOCALE_SABBREVMONTHNAME2      = 0x00000045   ;// abbreviated name for February Global Const $LOCALE_SABBREVMONTHNAME3      = 0x00000046   ;// abbreviated name for March Global Const $LOCALE_SABBREVMONTHNAME4      = 0x00000047   ;// abbreviated name for April Global Const $LOCALE_SABBREVMONTHNAME5      = 0x00000048   ;// abbreviated name for May Global Const $LOCALE_SABBREVMONTHNAME6      = 0x00000049   ;// abbreviated name for June Global Const $LOCALE_SABBREVMONTHNAME7      = 0x0000004A   ;// abbreviated name for July Global Const $LOCALE_SABBREVMONTHNAME8      = 0x0000004B   ;// abbreviated name for August Global Const $LOCALE_SABBREVMONTHNAME9      = 0x0000004C   ;// abbreviated name for September Global Const $LOCALE_SABBREVMONTHNAME10     = 0x0000004D   ;// abbreviated name for October Global Const $LOCALE_SABBREVMONTHNAME11     = 0x0000004E   ;// abbreviated name for November Global Const $LOCALE_SABBREVMONTHNAME12     = 0x0000004F   ;// abbreviated name for December Global Const $LOCALE_SABBREVMONTHNAME13     = 0x0000100F   ;// abbreviated name for 13th month (if exists) Global Const $LOCALE_SPOSITIVESIGN          = 0x00000050   ;// positive sign Global Const $LOCALE_SNEGATIVESIGN          = 0x00000051   ;// negative sign Global Const $LOCALE_IPOSSIGNPOSN           = 0x00000052   ;// positive sign position Global Const $LOCALE_INEGSIGNPOSN           = 0x00000053   ;// negative sign position Global Const $LOCALE_IPOSSYMPRECEDES        = 0x00000054   ;// mon sym precedes pos amt Global Const $LOCALE_IPOSSEPBYSPACE         = 0x00000055   ;// mon sym sep by space from pos amt Global Const $LOCALE_INEGSYMPRECEDES        = 0x00000056   ;// mon sym precedes neg amt Global Const $LOCALE_INEGSEPBYSPACE         = 0x00000057   ;// mon sym sep by space from neg amt Global Const $LOCALE_FONTSIGNATURE          = 0x00000058   ;// font signature Global Const $LOCALE_SISO639LANGNAME        = 0x00000059   ;// ISO abbreviated language name Global Const $LOCALE_SISO3166CTRYNAME       = 0x0000005A   ;// ISO abbreviated country name Global Const $LOCALE_IDEFAULTEBCDICCODEPAGE = 0x00001012   ;// default ebcdic code page Global Const $LOCALE_IPAPERSIZE             = 0x0000100A   ;// 0 = letter, 1 = a4, 2 = legal, 3 = a3 Global Const $LOCALE_SENGCURRNAME           = 0x00001007   ;// english name of currency Global Const $LOCALE_SNATIVECURRNAME        = 0x00001008   ;// native name of currency Global Const $LOCALE_SYEARMONTH             = 0x00001006   ;// year month format string Global Const $LOCALE_SSORTNAME              = 0x00001013   ;// sort name Global Const $LOCALE_IDIGITSUBSTITUTION     = 0x00001014   ;// 0 = none, 1 = context, 2 = native digit ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_GetLocaleInfo ; Description ...: Gets local specific info ; Syntax.........: _WinAPI_GetLocaleInfo($iLocale, $iLCType) ; Parameters ....: $iLocale      - Identifies a valid Windows locale ;                  $iLCType      - Identifies the information to be retrieved ; Return values .: Success       - String containing the requested information ;                  Failure       - Empty string with @error set to 1 ; Author ........: WideBoyDixon ; Modified.......: ; Remarks .......: ; Related .......: _WinAPI_GetUserDefaultLCID ; Link ..........; ; Example .......; ; =============================================================================================================================== Func _WinAPI_GetLocaleInfo($iLocale, $iLCType)     Local $aResult = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", $Locale, "long", $LCType, "ptr", 0, "long", 0)     If @error Then Return SetError(1, 0, "")     Local $lpBuffer = DllStructCreate("char[" & $aResult[0] & "]")     $aResult = DllCall("kernel32.dll", "long", "GetLocaleInfo", "long", $Locale, "long", $LCType, "ptr", DllStructGetPtr($lpBuffer), "long", $aResult[0])     If @error Or ($aResult[0] = 0) Then Return SetError(1, 0, "")     Return SetError(0, 0, DllStructGetData($lpBuffer, 1)) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_GetUserDefaultLCID ; Description ...: Gets local specific info ; Syntax.........: _WinAPI_GetUserDefaultLCID() ; Parameters ....: ; Return values .: Success       - The default LCID for the user ;                  Failure       - Zero with @error set to 1 ; Author ........: WideBoyDixon ; Modified.......: ; Remarks .......: ; Related .......: _WinAPI_GetLocaleInfo ; Link ..........; ; Example .......; ; =============================================================================================================================== Func _WinAPI_GetUserDefaultLCID()     Local $aResult = DllCall("kernel32.dll", "long", "GetUserDefaultLCID") ; Get the default LCID for this user     If @error Then Return SetError(1, 0, 0)     Return SetError(0, 0, $aResult[0]) EndFunc


Would be great to have those in there too :)

WBD

Edited by WideBoyDixon, 23 July 2009 - 08:55 AM.


#12 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 23 July 2009 - 09:51 AM

Can't remember which ones I'm getting credit for but that's old age for you.

Do you remember this?

:)

EDIT:

_WinAPI_GetLocalTime() and _WinAPI_GetSystemTime() already exist (Date.au3).
_WinAPI_GetLocaleInfo() and _WinAPI_GetUserDefaultLCID() - agreed, thanks for that.

Edited by Yashied, 23 July 2009 - 01:10 PM.


#13 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 24 July 2009 - 04:38 PM

The library has been updated.

Added functions

_WinAPI_DeregisterShellHookWindow
_WinAPI_FileTimeToLocalFileTime
_WinAPI_FileTimeToSystemTime
_WinAPI_GetIdleTime
_WinAPI_GetLocaleInfo
_WinAPI_GetModuleFileNameEx
_WinAPI_GetProcessCreationTime
_WinAPI_GetTickCount
_WinAPI_GetThemeAppProperties
_WinAPI_GetUserDefaultLCID
_WinAPI_IsThemeActive
_WinAPI_PickIconDlg
_WinAPI_RegisterShellHookWindow
_WinAPI_SetFilePointerEx
_WinAPI_SetThemeAppProperties
_WinAPI_SHFormatDrive
_WinAPI_SHGetSpecialFolderPath


+ Examples

Edited by Yashied, 24 July 2009 - 04:44 PM.


#14 wraithdu

wraithdu

    this noise inside my head

  • MVPs
  • 2,412 posts

Posted 24 July 2009 - 05:26 PM

Additions off the top of my head: GetProcAddress

_WinAPI_GetForegroundWindow() already exists in WinAPI.au3. Who knows why SetForegroundWindow() isn't in there also...

#15 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 27 July 2009 - 02:51 PM

The library has been updated.

Added functions

_WinAPI_EnumResourceLanguagesToArray
_WinAPI_EnumResourceNamesToArray
_WinAPI_EnumResourceTypesToArray
_WinAPI_GetFontResourceInfoEx
_WinAPI_GetProcAddress


#16 Malkey

Malkey

  • MVPs
  • 1,523 posts

Posted 28 July 2009 - 04:03 AM

Should you ever get the function header info completed and submit these for inclusion into the WinAPI.au3 include file, you should be aware that some of these functions have close relatives already present in existing UDF files.

_WinAPI_FileTimeToLocalFileTime similar as _Date_Time_FileTimeToLocalFileTime

_WinAPI_FileTimeToSystemTime similar as _Date_Time_FileTimeToSystemTime

_WinAPI_FreeHandle similar as _WinAPI_CloseHandle

_WinAPI_FreeIcon similar as _WinAPI_DestroyIcon

_WinAPI_FreeObject similar as _WinAPI_DeleteObject

_WinAPI_GetWorkArea similar as _WinAPI_SystemParametersInfo

_WinAPI_GlobalSize similar as _MemGlobalSize

_WinAPI_KillTimer similar as _Timer_KillTimer

Or adding examples to the existing functions in the help file would be helpful.

You do good work.
Thanks for sharing.

#17 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 28 July 2009 - 07:56 AM

Should you ever get the function header info completed and submit these for inclusion into the WinAPI.au3 include file, you should be aware that some of these functions have close relatives already present in existing UDF files.

_WinAPI_FileTimeToLocalFileTime similar as _Date_Time_FileTimeToLocalFileTime

_WinAPI_FileTimeToSystemTime similar as _Date_Time_FileTimeToSystemTime

_WinAPI_FreeHandle similar as _WinAPI_CloseHandle

_WinAPI_FreeIcon similar as _WinAPI_DestroyIcon

_WinAPI_FreeObject similar as _WinAPI_DeleteObject

_WinAPI_GetWorkArea similar as _WinAPI_SystemParametersInfo

_WinAPI_GlobalSize similar as _MemGlobalSize

_WinAPI_KillTimer similar as _Timer_KillTimer

Or adding examples to the existing functions in the help file would be helpful.

You do good work.
Thanks for sharing.

_WinAPI_FileTimeToLocalFileTime(), _WinAPI_FileTimeToSystemTime(), _WinAPI_GlobalSize() - Added, because it`s used in other functions within the library.

_WinAPI_FreeHandle(), _WinAPI_FreeIcon() - Without stupid _WinAPI_Check().

_WinAPI_GetWorkArea(), _WinAPI_#Timer() - Easier to use.

Thanks anyway.

#18 UEZ

UEZ

    Never say never

  • MVPs
  • 4,969 posts

Posted 28 July 2009 - 07:58 AM

Well done again! Very useful WinApi stuff! Also 5* from me >_<

Greetings from s/w coast of Turkey :(

UEZ

 
The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯


#19 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 28 July 2009 - 08:46 AM

I suggest someone to do write a description for any functions of this library. Ofcourse, credit in the title for you.

Edited by Yashied, 10 August 2009 - 08:28 PM.


#20 kjcdude

kjcdude

    Adventurer

  • Active Members
  • PipPip
  • 142 posts

Posted 29 July 2009 - 03:39 AM

As of v3.3.1.0 _WinAPI_GetLayeredWindowAttributes() and _WinAPI_SetLayeredWindowAttributes() exist in WinAPI.au3 for those running the beta and wondering why you're getting errors.
http://www.autoitscript.com/forum/index.php?showtopic=95367&view=findpost&p=685558




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users