I can get a handle to a window by title by using FindWindow, but if the window is minimized I can not get the window handle. How do you get the handle to a minimized window?
hWindow := FindWindow(nil, iWindowTitle);
I can get a handle to a window by title by using FindWindow, but if the window is minimized I can not get the window handle. How do you get the handle to a minimized window?
hWindow := FindWindow(nil, iWindowTitle);
FindWindow
does not care whether or not the window is minimized. If your call to FindWindow
returns zero then that means that there is no top-level window with that title.
To demonstrate that this is the case, open an instance of Notepad and minimize it. Then run this program:
{$APPTYPE CONSOLE}
uses
Windows;
begin
Writeln(FindWindow(nil, 'Untitled - Notepad'));
Readln;
end.
Clearly what is going on is that when the window you are hunting for is minimized, it does not have the title that you think it does. You'll likely need to use a tool like Spy++ to debug this.