Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How do I minimize an application's window? (Win32)

by alftheo (Scribe)
on Feb 12, 2001 at 12:39 UTC ( [id://57859]=note: print w/replies, xml ) Need Help??


in reply to How do I minimize an application's window? (Win32)

Win32::GUI has a function to minimize a window. The tricky part is finding the window you want to minimize; it might not be the only window in the application.

use Win32::GUI; my $title_part = shift; my $class_part = shift; $title_part or die "Supply title substring\n"; $class_part ||= ''; my $perlwindow = GUI::GetPerlWindow(); for ( my $window = GUI::GetWindow( GUI::GetDesktopWindow(), GW_CHILD ); $window; $window = GUI::GetWindow( $window, GW_HWNDNEXT ) ) { next if $window == $perlwindow; my $title = GUI::Text($window); my $class = GUI::GetClassName($window); if ( $title =~ /$title_part/ and $class =~ /$class_part/ ) { warn "Minimizing $title: $class\n"; GUI::Minimize($window); } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://57859]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found