Jump to content

Question about minimizing applications


 Share

Recommended Posts

Hello all,

I have a question about calling minimizing a window using WinSetState and @SW_MINIMIZE. Certain applications do not seem to minimize to the taskbar. Instead, they minimize to a little title-bar thingy that floats above the task bar. This happens whenever I try to minimze PSPad (and some others). Has anyone seen this or have any idea what I'm doing wrong?

Thanks for the help!

We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.

Link to comment
Share on other sites

Yep, that's exactly what is happening. I'm using WinSetState($title, "", @SW_MINIMIZE) and not GUISetState(@SW_MINIMIZE, $win), and I'm calling it on an existing window (not one I opened using AutoIt).

We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.

Link to comment
Share on other sites

Ah, I see now. I'm getting the title of the current active window by calling $title = WinGetTitle("") and $title is getting set to the child window, not the parent. Two questions:

1) Is there any way to get to the parent window?

2) Is there any way to tell if I have the child window?

We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.

Link to comment
Share on other sites

Valuater's example provided above should illustrate it.

#include<guiconstants.au3>

WinMinimizeAll()

$Dummy_win = GUICreate("")
$win = GUICreate("My GUI", -1, -1, -1, -1, -1, -1, $Dummy_win)
GUISetState()

sleep(5000)

GUISetState(@SW_MINIMIZE, $win)

Sleep(5000)

here $Dummy_win is the handle to the dummy window and $win is the handle of dummy's child.

to get to the parent window just use that handle, say

GUISetState(@SW_MINIMIZE, $Dummy_win)

and to do stuff on the child use the child's handle

GUISetState(@SW_MINIMIZE, $win)

I think Window handles are unique during a windows session, so they are much more reliable than using window titles. You could always have 2 windows with the same title, but each has its own unique handle.

Hope it helped.

IVAN

Link to comment
Share on other sites

I think I may still be missing something. I'm not actually creating the window I'm trying to minimize. I'm calling WinGetTitle("") to get the name of the active window and am trying to minimize that one. Apparenly, WinGetTitle() is sending me the name of child window. I don't know how to get the name of the parent window from there.

Thanks for all the help!

We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...