Yashied

WinAPIEx UDF

480 posts in this topic

No, it's there where it was before. Post #1

:D

Sometimes my body is on earth but not my mind :D

Too much work caused abnormal behavour...

Sorry.

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites



#62 ·  Posted (edited)

The library has been updated.

v1.9

Added functions

_WinAPI_CharToOem

_WinAPI_CreateFileEx

_WinAPI_EnumProcessThreads

_WinAPI_EnumProcessWindows

_WinAPI_IntersectRect

_WinAPI_IsRectEmpty

_WinAPI_MoveFileEx

_WinAPI_OemToChar

_WinAPI_ShareFolderDlg

_WinAPI_SubtractRect

+ few examples

Edited by Yashied

Share this post


Link to post
Share on other sites

#65 ·  Posted (edited)

Share this post


Link to post
Share on other sites

#66 ·  Posted (edited)

Ran into a problem after I upgraded to 3.3.1.3.

Get the following error.

C:\Program Files\AutoIt3\Beta\Include\WinAPIEx.au3(5633,53) : WARNING: $tagTEXTMETRIC: possibly used before declaration.
    Local $tTEXTMETRIC = DllStructCreate($tagTEXTMETRIC)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Edited by kjcdude

Share this post


Link to post
Share on other sites

Ran into a problem after I upgraded to 3.3.1.3.

Get the following error.

C:\Program Files\AutoIt3\Beta\Include\WinAPIEx.au3(5633,53) : WARNING: $tagTEXTMETRIC: possibly used before declaration.
    Local $tTEXTMETRIC = DllStructCreate($tagTEXTMETRIC)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

I do not know why in the latest Beta removed $tagTEXTMETRIC global constant from the StructureConstants.au3. Anyway, I fixed that. See first post.

Share this post


Link to post
Share on other sites

Wow,

What an ocean of work. Thanks a lot, Yashied. You've got a ton of good stuff on this site.

I found this script while looking for functions similar to Holger's_MenuIcons. From what I can tell your script provides a more modern approach of accomplishing the same thing. Is that right?

BTW, I think I found an error in the _WinAPI_SHGetFileInfo example. It tries calling itself rather than _WinAPI_ShellGetFileInfo.

For $i = 1 To $Ext[0]
    $tSHFILEINFO = _WinAPI_SHGetFileInfo($Ext[$i],...

Your script is way over my head so I may be wrong. If that's the case feel free to have a good laugh around the water cooler at my expense. :)

Keep on coding, man! You're on fire!!

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

#71 ·  Posted (edited)

Hi Yashied,

I actually had to change it to _WinAPI_ShellGetFileInfo to get it to work. (1.8 I doesn't have "_WinAPI_SHGetFileInfo()")

Anyhow, it worked like a champ, and fast!

BTW, there are a few of us on the board who have been stuck trying to create a multi-state PNG button. Is there a func in this library that might help? Your _SetImage looks really close but I read somewhere that you didn't design it to be dynamic. Is WinApiEX our savior?

:)

Edit: _SetBitmap --> SetImage

Edited by Dolemite50

Share this post


Link to post
Share on other sites

Hi Yashied,

Thank you for this excellent contribution.

You may want to change the documentation of the function _WinAPI_GetProcAddress($hModule, $sProc).

; Syntax.........: _WinAPI_GetProcAddress ( $hModule, $sProc )

; Parameters.....: $hModule - Handle to the DLL module that contains the function.

; $sProc - The function name.

The description of $hModule is misleading. Feeding a "DLL handle" as returned by DllOpen (as seems implied) won't work.

Local $hDll = DllOpen($sDllFilename)

Local $pFct = _WinAPI_GetProcAddress($hDll, $sProc) <-- failure

Windows GetProcAddress needs an actual _address_ typically obtained by LoadLibrary[W] while AutoIt DllOpen returns an integer handle.

Local $RetVal = DllCall("kernel32.dll", "ptr", "LoadLibraryW", "wstr", $sDllFilename)

Local $pFct = _WinAPI_GetProcAddress($RetVal[0], $sProc)

Also you may want to use LoadLibraryW and wstr just in case there are non-ANSI characters in the path.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#74 ·  Posted (edited)

I disagree. Usage of the windows api and dll calls implies some understanding OF the windows api. That parameter description is directly from MSDN. Instead, the documentation of DllOpen should be more clear that the return value is a pseudo handle (NOT a real handle) that is only to be used with AutoIt internal dll functions, not UDFs.

Edited by wraithdu

Share this post


Link to post
Share on other sites

I disagree. Usage of the windows api and dll calls implies some understanding OF the windows api. That parameter description is directly from MSDN. Instead, the documentation of DllOpen should be more clear that the return value is a pseudo handle (NOT a real handle) that is only to be used with AutoIt internal dll functions, not UDFs.

Of course you're right. The real problem is AutoIt using the term handle for something else.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

The library has been updated.

v2.0

Added functions

_WinAPI_AdjustTokenPrivileges

_WinAPI_ColorHLSToRGB

_WinAPI_ColorRGBToHLS

_WinAPI_IsValidLocale

_WinAPI_LoDWord

_WinAPI_LookupPrivilegeName

_WinAPI_LookupPrivilegeValue

_WinAPI_HiDWord

_WinAPI_OpenProcessToken

_WinAPI_RegCloseKey

_WinAPI_RegCopyTree

_WinAPI_RegCreateKey

_WinAPI_RegDeleteEmptyKey

_WinAPI_RegDeleteKey

_WinAPI_RegDeleteTree

_WinAPI_RegEnumKey

_WinAPI_RegEnumValue

_WinAPI_RegFlushKey

_WinAPI_RegisterHotKey

_WinAPI_RegOpenKey

_WinAPI_RegQueryInfoKey

_WinAPI_RegQueryLastWriteTime

_WinAPI_RegQueryValue

_WinAPI_RegRestoreKey

_WinAPI_RegSaveKey

_WinAPI_RegSetValue

_WinAPI_UnionStruct

_WinAPI_UnregisterHotKey

+ few examples

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Nicely done, Yashied! I really appreciate the good examples.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now