sodiumpaul
Programmer
I've been trying to get the handle of a Button within my application. The main form launches another form ( floating toolBox).
I've used the following code with the Ms Calc app to prove this code works - it does:
int hwnd;
int comp;
hwnd = FindWindow(null, "Calculator");
comp = FindWindowEx(hwnd, 0, "Button", "1");
MessageBox.Show(comp.ToString()); //works
However, when I do the same with my app (main form finding button on floating toolbox started from main form (therefore, not a child form), it does not work. hwnd = FindWindow(null, "toolbox"); -> finds handle. FindWindowEx section does not find the button on my toolbox (label "1"). I've also created a simple, independent, form with one button, started this app and run my main app to test....this also did not work. Is this something to do with VS?
Please, please help!
Thankyou.