hello all,
I am attempting to write a simple programe that will imitate pressing a button on a third party application. so far i have this:
// astro rocks
BOOL CALLBACK FindButttonPush(HWND hWnd, LPARAM lParam)
{
if(GetDlgCtrlID(hWnd) == 1000){
*(HWND *)lParam = hWnd;
return FALSE;
}
return TRUE;
}
int click()
{
int i;
HWND hWndManager, hWndClick = NULL;
hWndManager = FindWindow("SWBF2SERVERMANAGER", NULL);
if(!hWndManager) return 0;
EnumChildWindows(hWndManager, FindButttonPush, (LPARAM)&hWndClick);
if(!hWndClick) return 0;
SendMessage(hWndClick, BM_CLICK,0,0);
return 1;
}
The code compile perfectly. The promlem is that it doesnt do what it is suppose to be doing. it is suppose to press a button in an application but it is also inside a panel.
Any help would be greatly apreciated.