|
-
January 18th, 2009, 11:49 PM
#1
Full Screen Mode.
Ok, I have searched google/yahoo for a while and i have not been able to find a working example of how to make the application go into full screen mode. such as if a user pressed alt+enter
help please.
-Thank you
-
January 19th, 2009, 12:07 AM
#2
Re: Full Screen Mode.
Basically, the idea is like this
calculate(detect) the maximum of pixel in terms of horizontal and vertical, follow by resize it to the maximum pixel the monitor allowed.
I think there are few library that help you do it.
Thanks for your help.
-
January 19th, 2009, 12:29 AM
#3
Re: Full Screen Mode.
 Originally Posted by Peter_APIIT
Basically, the idea is like this
calculate(detect) the maximum of pixel in terms of horizontal and vertical, follow by resize it to the maximum pixel the monitor allowed.
I think there are few library that help you do it.
That has absolutely nothing to do with the question...
Full Screen (non-windowed) mode is a fairly specialized case, but there is plenty of information on MSDN
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
January 21st, 2009, 08:22 AM
#4
Re: Full Screen Mode.
this is the emulation of alt+enter
Code:
#include <windows.h>
void fullscreen() {
keybd_event(VK_MENU, 0x38, 0, 0);
keybd_event(VK_RETURN, 0x1c, 0, 0);
keybd_event(VK_MENU, 0x38, KEYEVENTF_KEYUP, 0);
keybd_event(VK_RETURN, 0x1c, KEYEVENTF_KEYUP, 0);
}
-
January 21st, 2009, 10:20 AM
#5
Re: Full Screen Mode.
>> this is the emulation of alt+enter
Don't use hard-coded constants like that.
Code:
// Simulate ALT-ENTER keystrokes
void AltEnter()
{
// NOTE: This method only works if the console window has the keyboard
// focus and the user isn't hitting keys on the keyboard.
SetForegroundWindow(GetConsoleWindow());
keybd_event(VK_MENU, MapVirtualKey(VK_MENU, 0), 0, 0);
keybd_event(VK_RETURN, MapVirtualKey(VK_RETURN, 0), 0, 0);
keybd_event(VK_RETURN, MapVirtualKey(VK_RETURN, 0), KEYEVENTF_KEYUP, 0);
keybd_event(VK_MENU, MapVirtualKey(VK_MENU, 0), KEYEVENTF_KEYUP, 0);
}//AltEnter
There's no need to simulate key strokes on XP and up.
http://msdn.microsoft.com/en-us/libr...28(VS.85).aspx
gg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|