minimize a window

Windows specific forum
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

minimize a window

Post by PB&J Lover »

How do you force a window to minimize when you do something like RUNPROGRAM()?

Thanks
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Code: Select all

RunProgram ("NotePad.exe")
ShowWindow_(GetForegroundWindow_(),#SW_MINIMIZED)
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

minimizing

Post by PB&J Lover »

I'm getting a "constant not found error."

Which window will that minimize?

The window I want to minimize is the program window that launches the other app. I should have been more clear.

Thanks.
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Sorry.

Use this...

Code: Select all

RunProgram ("NotePad.exe")
ShowWindow_(GetForegroundWindow_(),#SW_SHOWMAXIMIZED	)
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

minimize

Post by PB&J Lover »

Cool.

I fixed it. It was

ShowWindow_(GetForegroundWindow_(),#SW_SHOWMINIMIZED)

and it works now.

Thanks!
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

I fixed it
???
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

Post by PB&J Lover »

Yes, I wanted to MINIMIZE the window. You first example was missing the SHOW part of the constant.

I wasn't clear, but it works now. Thanks.
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
Post Reply