cppman Posted September 13, 2007 Share 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 Link to comment Share on other sites More sharing options...
Siao Posted September 13, 2007 Share 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" Link to comment Share on other sites More sharing options...
cppman Posted September 13, 2007 Author Share Posted September 13, 2007 That doesn't work... Miva OS Project Link to comment Share on other sites More sharing options...
Siao Posted September 13, 2007 Share 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" Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now