Obtains an application instance handle for use in DllCall’s when required.
DllHinst(partial-winname )
(s) partial-winname the initial part of, or an entire, window name.
(i) an application instance handle.
Use this function to return a valid application instance handle (hInst) of the application owning the specified window.
Note: "Partial-winname" is the initial part of a window name, and may be a complete window name. It is case-sensitive. You should specify enough characters so that "partial-windowname" matches only one existing window. If it matches more than one window, the most recently accessed window which it matches will be used. The windowname "" may be used as a shorthand way of referring to the WIL parent application window.
binbuf=BinaryAlloc(100) hInst=DllHinst("") dllname=StrCat(DirWindows(1),"KERNEL32.DLL") DllCall(dllname,word:"GetModuleFileNameA",long:hInst, lpbinary:binbuf, long:100) ; Note DllCalls do not set EOD point in buffer. ; EOD Point MUST be set manually with BinaryEODSet BinaryEodSet(binbuf, 100) ; a=BinaryPeekStr(binbuf, 0, 100) BinaryFree(binbuf) Message("Window module filename is", a)
Binary Operations, DllCall, DllCallbackCreate, DllCallbackDestroy, DllCall Additional information, DllHwnd, IntControl 46