cppman 2 Posted September 13, 2007 Hi everyone. I have been curious for a while now, how would it be possible for me to call a dll function that does not take a pointer to a structure? For example, I am trying to call the WindowFromPoint function. However it's prototype is like this. HWND WindowFromPoint(POINT Point);As you can see it isn't LPPOINT so setting the type to "ptr" is out of the question..So far I can make this out to be:$hWnd = DLLCall("user32.dll", "hWnd", "WindowFromPoint", "what goes here?", "the structure goes here")Any ideas? Miva OS Project Share this post Link to post Share on other sites
Siao 6 Posted September 13, 2007 (edited) Well, if it's not a ptr, then try to pass the point coordinates directly: $hWnd = DLLCall("user32.dll", "hwnd", "WindowFromPoint", "long", $x, "long", $y) Edited September 13, 2007 by Siao "be smart, drink your wine" Share this post Link to post Share on other sites
cppman 2 Posted September 13, 2007 That doesn't work... Miva OS Project Share this post Link to post Share on other sites
Siao 6 Posted September 13, 2007 (edited) O RLY? $x = 10 $y = 10 Run("notepad.exe", "", @SW_MAXIMIZE) WinWaitActive("Untitled - Notepad") $hwnd1 = WinGetHandle("Untitled - Notepad") $ret = DLLCall("user32.dll", "hwnd", "WindowFromPoint", "long", $x, "long", $y) $hwnd2 = $ret[0] MsgBox(0, '', $hwnd1 & @CRLF & $hwnd2) WinClose("Untitled - Notepad") Edited September 13, 2007 by Siao "be smart, drink your wine" Share this post Link to post Share on other sites