I think title of this question is pretty clear.
const int WM_KEYDOWN = 0x100;
const int WM_KEYUP = 0x101;
const int WM_SYSCOMMAND = 0x018;
const int SC_CLOSE = 0x053;
const int WM_MOUSEMOVE = 0x200;
int WindowToFind = FindWindow(null, "Untitled - Paint");
PostMessage(WindowToFind, WM_MOUSEMOVE, 400, 500);
PostMessage(WindowToFind, WM_KEYDOWN, ((int)Keys.LButton), 0);
PostMessage(WindowToFind, WM_KEYUP, ((int)Keys.LButton), 0);
above, is current code. which does NOT work.(however postmessage DOES post actual keys like if I want to press A, it does that. However it fails on mouse, or I fail)
I also must point out that I dont even know what does lparam actually, I just used to set it to null and wparam to key. Im not even sure if im supposed to use wm_mousemove because it looks like its to "receive" rather than actually setting location. Then I read Lparam should be set to contain both x and y like 500 * 0x10000 + 500, and wparam as 0 etc., it didnt help. Googling for other ways didnt help either. I really dont care about ways, I just want to press leftmouse, on another window without focus, on certain location.