SendMessage to another Application
Code:
string lpszParentClass = "SciCalc";
string lpszParentWindow = "Rekenmachine"; //Dutch translation Calculator
string lpszClass = "Button";
IntPtr hwnd = FindWindow(lpszParentClass, lpszParentWindow);
IntPtr childhwnd = FindWindowEx(hwnd, IntPtr.Zero, lpszClass, "5");
SendMessage(childhwnd, (int)VKeys.VK_2, 0, 0); //VKeys.VK_2 = 0x32
SendMessage(childhwnd, (int)VKeys.VK_2, 0, 0);
Supposed to press the button five on MS Calculator.
It doesn't give any errors but it just doesnt work.
What did I do wrong?
Re: SendMessage to another Application
Re: SendMessage to another Application
if you do get the correct hwnd from find window, try using post message instead of send message