thanks, I got it.. I essentially used that.. my code is
Code:
// check if a window is the one you're looking for
BOOL CALLBACK checkWindow(HWND hwnd,LPARAM param)
{
// where to copy the window title
char window_title[128] = {0};
// politely ask the target window to copy its title into our buffer
SendMessageA(hwnd,WM_GETTEXT,sizeof(window_title),(LPARAM)(char*)window_title);
// if the target window title is bigger than the current window title, null terminate the target window title,
// otherwise, null terminate the current window title
((sizeof(target_windowtitle)>sizeof(window_title)) ? target_windowtitle[sizeof(window_title)-1] : window_title[sizeof(target_windowtitle)-1]) = 0;
// search for our wanted title inside the passed title,
// and if it's found...
if(!strcmp(lowercase(window_title),lowercase(target_windowtitle)))
{
// cast our parameter to a pointer and set its target to the current window (AKA success)
*(HWND*)param = hwnd;
// stop checking the windows
return false;
}
// otherwise keep checking windows
else return true;
}