Sean wrote:
Your code is obviously wrong...
...it's not obviously wrong, if I didn't test it...& again you don't EXPLAIN how it's wrong!
Sean wrote:
...my code was the correct one.
...no, your code is not "correct", it's unreadable & only works cuz obscure math is able to create this struct, try that trick with any, more complicated, struct...
Sean wrote:
Don't post about you're feeling cryptic.
...what?...that don't make sense. But what's cryptic is your code...& apparant refusal to explain anything...
Sean wrote:
...i.e., &POINTS will not work.
...WHY?...you say things & NEVER explain them...why will it fscking not work???...&POINTS is attempting to pass ByRef...POINTS is trying to pass ByVal...it should work!
Sean wrote:
...there is no way to pass binary data/integer to built-in AHK Commands, so, POINTS will not work.
...why not?...my code is near-perfect (but untested), if the PostMessage AHK Command is incapable of passing the value properly (WHY???), then I'll create a DllCall PostMessage wrapper that CAN handle it...
THIS IS NOW TESTED!!!...
Code:
WM_NCLBUTTONDOWN:=0xA1
HTRIGHT:=11
F9::
;//hwnd:=win
hwnd:=WinExist("a")
points_x:=1905
points_y:=258
points_cryptic:=points_x|points_y<<16
VarSetCapacity(points, 4, 0)
NumPut(points_x, points, 0, "Short")
NumPut(points_y, points, 2, "Short")
;//PostMessage, WM_NCLBUTTONDOWN, HTRIGHT, points_cryptic, , ahk_id %hwnd%
;//DllCall("PostMessage", "UInt", hwnd, "UInt", WM_NCLBUTTONDOWN, "UInt", HTRIGHT, "UInt", points_cryptic)
;//PostMessage(hwnd, WM_NCLBUTTONDOWN, HTRIGHT, points_cryptic)
;// These WORK!
PostMessage, WM_NCLBUTTONDOWN, HTRIGHT, points, , ahk_id %hwnd%
;//PostMessage, WM_NCLBUTTONDOWN, HTRIGHT, &points, , ahk_id %hwnd%
;//PostMessage(hwnd, WM_NCLBUTTONDOWN, HTRIGHT, points)
;//DllCall("PostMessage", "UInt", hwnd, "UInt", WM_NCLBUTTONDOWN, "UInt", HTRIGHT, "UInt", points)
;//...later...
points_x:=NumGet(points, 0, "Short")
points_y:=NumGet(points, 2, "Short")
return
/*
BOOL PostMessage(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
*/
PostMessage(p_hwnd, p_msg, p_wParam, p_lParam) {
return DllCall("PostMessage", "UInt", p_hwnd, "UInt", p_msg, "UInt", p_wParam, "UInt", p_lParam)
}
...all of these WORK!...
Code:
PostMessage, WM_NCLBUTTONDOWN, HTRIGHT, points, , ahk_id %hwnd%
;//PostMessage, WM_NCLBUTTONDOWN, HTRIGHT, &points, , ahk_id %hwnd%
;//PostMessage(hwnd, WM_NCLBUTTONDOWN, HTRIGHT, points)
;//DllCall("PostMessage", "UInt", hwnd, "UInt", WM_NCLBUTTONDOWN, "UInt", HTRIGHT, "UInt", points)
...WTF r u taking about Sean?...
The point is: your cryptic math is ONLY capable of creating REALLY simple structs & to top it off it's unreadable...& to top that off, you don't explain it...