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
Printable View
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
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
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);
}
>> this is the emulation of alt+enter
Don't use hard-coded constants like that.
There's no need to simulate key strokes on XP and up.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
http://msdn.microsoft.com/en-us/libr...28(VS.85).aspx
gg