Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restore all minimized windows?

Status
Not open for further replies.

TimV

IS-IT--Management
Mar 28, 2002
21
US
Is there an API call to restore all minimized windows? I actually only want to restore a particular program I find running, but I haven't found a way to do that either...

Thanks,

Tim
 
TimV,

if you want to restore particular window or ALL windows, the method stays the same :

a) find the window handle
b) see if it's minimized
c) restore window via that handle

Windows API has 2 convenient functions who will do the trick
a) findwindow
b) isiconic
c) showwindow

here's an example :

Code:
procedure restoremywindow;
var hwnd : integer;
begin
 // find window with windowtitle 'MyWindowTitle'
 hwnd:=FindWindow(nil,Pchar('MyWindowTitle'));
 // only restore window when it is not minimized
 if IsIconic(hwnd) then 
  ShowWindow(hwnd,SW_RESTORE);
end

Cheers!!!
 
Thanks! This is exactly what I need. You are making me look like I know what I'm doing!!!

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top