Could somebody show me how to use FindWindow based on the last 30 or so characters of the title string?
Could somebody show me how to use FindWindow based on the last 30 or so characters of the title string?
Don't know, just make your own function with the GetTopWindow,
GetNextWindow, IsWindow and GetWindowText functions.
Cheers,
Monster
I'm not sure if you can use this. The FindWindow function requires 2 parameters, the class name and the window name. So it needs the full window text in order to find a window with that title. If you only have one instance of your window running, just set the window name paramater to NULL:
HWND hWndToFind=FindWindow(MyWndClassName,NULL);
where 'MyWndClassName' is the class name of your target window.
which should return the handle to the wnd of 'MyWndClassName'.
If all you have to work with is the last 30 characters of a wnd then maybe you need to use 'EnumWindows' or 'EnumDesktopWindows'. In this scenario you would enumerate through all the desktop windows, interrogate their titles and test for a match with those '30 or so last characters'.
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.