Minimize Code( z order )

The Partridge Family were neither partridges nor a family. Discuss.
cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Minimize Code( z order )

Post by cameron » July 6th, 2013, 9:46 pm

Hi I need to find a way to minimize the game with a code. For example I have Made a button class so that I click on it and it does a specified task I already made a button to exit calling exit( 0 ). But, what is the code for minimize and the code for maximize may be useful as well. Thanks all.
Last edited by cameron on July 8th, 2013, 5:40 pm, edited 1 time in total.
Computer too slow? Consider running a VM on your toaster.

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Minimize Code

Post by LuX » July 6th, 2013, 9:54 pm

Here you have a full list of states you can put the window in: http://msdn.microsoft.com/en-us/library ... s.85).aspx
You are probably looking for "ShowWindow ( hWnd, SW_MINIMIZE );"
ʕ •ᴥ•ʔ

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: Minimize Code

Post by cameron » July 6th, 2013, 10:02 pm

Thanks LuX, but slight problem I have a fullscreen window and I cant get it back to screen. Any suggestions?
Computer too slow? Consider running a VM on your toaster.

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: Minimize Code

Post by cameron » July 6th, 2013, 10:05 pm

Something that would work like alt + tab would work nice.
Computer too slow? Consider running a VM on your toaster.

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Minimize Code

Post by LuX » July 6th, 2013, 11:07 pm

Alt+Tab doesn't minimize the window, just change target, eg. the Z order of the window. For that effect you would have to change the Z order: http://msdn.microsoft.com/en-us/library ... s.85).aspx
ʕ •ᴥ•ʔ

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: Minimize Code

Post by cameron » July 7th, 2013, 12:55 am

Thanks LuX works great :).
Computer too slow? Consider running a VM on your toaster.

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: Minimize Code

Post by LuisR14 » July 7th, 2013, 3:20 am

well Alt+Enter works for taking it out of fullscreen (already embedded in Dx9/10/11) :)
(tho it isn't code per-se, since user hits them keys xP)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: Minimize Code

Post by cameron » July 8th, 2013, 5:38 pm

Is there any way to change the z order of a window if it is clicked on in the task bar?
Computer too slow? Consider running a VM on your toaster.

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: Minimize Code( z order )

Post by LuisR14 » July 8th, 2013, 8:07 pm

you would have to intercept the WM_ACTIVATE message and do the z-order code if the window is being activated :) (meaning if LOWORD(wparam) == WA_ACTIVE)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: Minimize Code( z order )

Post by cameron » July 8th, 2013, 8:22 pm

I am not good with win32 stuff where would be a good place to do it?
Computer too slow? Consider running a VM on your toaster.

Post Reply