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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows - Minimize certain open window ?

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
Hi,

Is there a way to minimize a certain Application window?
Have failed to achieve it with Win32::GUI::Hide so far - do dnot know how to find the handle to pass to the function.
thanks

Long live king Moshiach !
 
If your application doesn't have control over it, not sure how this would be possible, can find the POD for the module you mentioned, it's not available on CPAN

Can you post some of the code you tried?

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
#Hide dos window
use Win32::GUI;


#Hide dos window
my $perlwin = Win32::GUI::GetPerlWindow();
Win32::GUI::Hide($perlwin);

#Win32::GUI::Hide(Adobe Acrobat Professional);


But how to pass the correct $perlwin param to the function for any Window on the system ?

Long live king Moshiach !
 
Is it hide or minimise that this does. I'm not sure that you'd be able to hide windows you didn't create. I.e. when you create a window, you can get it's handle, so no harm, no foul. But hiding other application windows, nyyeeerg.

Could be wrong though, and it's happened in the past. If you need this kind of functionality, you need to ask yourself, is this really the kind of interface where I need to make decisions for my users, and what if there's more than one window?

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Paul - Win32::GUI is in cpan, it's a pretty common module that is asked about.


FindWindow( CLASSNAME, TITLE )

After you find it you should be able to hide it.

You might look around the old posts as there are a few people who specifically use it on here.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
OK

NOw managing to close almost any window with the following codeusing different titles matching open windows:

#Hide window
use Win32::GUI;
use Win32;

my $computer = Win32::NodeName;
my $window_handle = Win32::GUI::FindWindow( "","Kodak NexStation front end - POSNXP7 \[operator\]");
#my $window_handle = Win32::GUI::FindWindow( "","Windows Task Manager");
Win32::GUI::CloseWindow($window_handle);


However,just the window I really neeed to close does not close.
It has title as above - "Kodak NexStation front end - POSNXP7 \[operator\]"

Will appreciate any ideas .
thanks

Long live king Moshiach !
 
is it really [operator] ? Try using single quotes instead of qouble so you don't have to escape that stuff. I would check and see if that is really the exact name of that window.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Thanks,

the question is HOW to find the exact title of the window.
I could not use single quotes since I'm parsing the computer name param inside ...

Long live king Moshiach !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top