|
What does your call to CreateWindow() and ShowWindow() look like?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
<br />
hwnd = CreateWindowEx(<br />
WS_EX_CLIENTEDGE,<br />
g_szClassName,<br />
"My Project",<br />
WS_OVERLAPPEDWINDOW,<br />
CW_USEDEFAULT, CW_USEDEFAULT, 1062, 735,<br />
NULL, NULL, hInstance, NULL);
Andrew McIntyre
|
|
|
|
|
MrMcIntyre wrote: CW_USEDEFAULT, CW_USEDEFAULT, 1062, 735,
Have you changed these numbers (which are screen coordinates, not pixels) to see what the effect is? You can use CW_USEDEFAULT for all four arguments.
What about ShowWindow() ? You should be using SW_MAXIMIZE .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Can you show me how my code for the full screen should look like.
Andrew McIntyre
|
|
|
|
|
Can you show how you are calling ShowWindow() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I am just going out for a while. As soon as I get back I will post the code.
Andrew McIntyre
|
|
|
|
|
Do you want me to post the entire source code
Andrew McIntyre
|
|
|
|
|
Not really. I was really just trying to get you to focus in on a specific area of your code.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
<br />
ShowWindow(hwnd, nCmdShow);<br />
UpdateWindow(hwnd);
Andrew McIntyre
|
|
|
|
|
MrMcIntyre wrote: ShowWindow(hwnd, nCmdShow);
But you are not using SW_MAXIMIZE . Did you not like my suggestion?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I don't want it to maximize, I want it to launch into full screen.
Andrew McIntyre
|
|
|
|
|
Like a kiosk, or a video game? If so, you'll need to use the WS_POPUP style instead of WS_OVERLAPPEDWINDOW . You'll also have to assign 0 to lpszMenuName .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Yeah, so you don't see the caption bar and the border.
So how will I use the WS_POPUP as code if someone could write a small bit of code just so I understand where to put it if you know what I mean.
Andrew McIntyre
|
|
|
|
|
MrMcIntyre wrote: So how will I use the WS_POPUP as code...
Since I suggested using WS_POPUP instead of WS_OVERLAPPEDWINDOW , can you find in your code where WS_OVERLAPPEDWINDOW is currently being used and replace it with WS_POPUP ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Here it my code for the Create Window part, to see if I have done it right.
<br />
hwnd = CreateWindowEx(<br />
WS_EX_CLIENTEDGE,<br />
g_szClassName,<br />
"iWorld",<br />
WS_POPUP<br />
CW_USEDEFAULT, CW_USEDEFAULT, 1062, 735,<br />
NULL, NULL, hInstance, NULL);
Andrew McIntyre
|
|
|
|
|
Aside from the missing comma, what you have is right. To save confusion, you might want to use CW_USEDEFAULT or 0 for arguments 5-8.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
The code ran successfully. But the application did not cover the entire screen in full screen it was just a client with no border to the top left.
I would like the full screen to cover the entire screen if you know what I mean.
Andrew McIntyre
|
|
|
|
|
|
I created a Win32 app with just the two changes I mentioned and it was indeed full screen.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
David, I don't really understand the 5-8 argument part. I solved the other one.
"To save confusion, you might want to use CW_USEDEFAULT or 0 for arguments 5-8."
Andrew McIntyre
|
|
|
|
|
See here and here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
You mean you don't want to see the caption bar of the window, and the border of the window?
|
|
|
|
|
This is a disaster. Here is the entire source code for the win32.
<br />
#include <windows.h><br />
<br />
const char g_szClassName[] = "My Project";<br />
<br />
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)<br />
{<br />
switch(msg)<br />
{<br />
case WM_CLOSE:<br />
DestroyWindow(hwnd);<br />
break;<br />
case WM_DESTROY:<br />
PostQuitMessage(0);<br />
break;<br />
default:<br />
return DefWindowProc(hwnd, msg, wParam, lParam);<br />
}<br />
return 0;<br />
}<br />
<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,<br />
LPSTR lpCmdLine, int nCmdShow)<br />
{<br />
WNDCLASSEX wc;<br />
HWND hwnd;<br />
MSG Msg;<br />
<br />
<br />
wc.cbSize = sizeof(WNDCLASSEX);<br />
wc.style = 0;<br />
wc.lpfnWndProc = WndProc;<br />
wc.cbClsExtra = 0;<br />
wc.cbWndExtra = 0;<br />
wc.hInstance = hInstance;<br />
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);<br />
wc.hCursor = LoadCursor(NULL, IDC_ARROW);<br />
wc.hbrBackground = (HBRUSH)GetStockObject ( BLACK_BRUSH );<br />
wc.lpszMenuName = 0;<br />
wc.lpszClassName = g_szClassName;<br />
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);<br />
<br />
<br />
if(!RegisterClassEx(&wc))<br />
{<br />
MessageBox(NULL, "Window Registration Failed!", "iWorld",<br />
MB_ICONEXCLAMATION | MB_OK);<br />
return 0;<br />
}<br />
<br />
<br />
hwnd = CreateWindowEx(<br />
WS_EX_CLIENTEDGE,<br />
g_szClassName,<br />
"My Project",<br />
WS_POPUP,<br />
SW_MAXIMIZE. <br />
NULL, NULL, hInstance, NULL);<br />
<br />
<br />
if(hwnd == NULL)<br />
{<br />
MessageBox(NULL, "Window Creation Failed!", "Error!",<br />
MB_ICONEXCLAMATION | MB_OK);<br />
return 0;<br />
}<br />
<br />
<br />
<br />
<br />
ShowWindow(hwnd, nCmdShow);<br />
UpdateWindow(hwnd);<br />
<br />
<br />
while(GetMessage(&Msg, NULL, 0, 0) > 0)<br />
{<br />
TranslateMessage(&Msg);<br />
DispatchMessage(&Msg);<br />
}<br />
return Msg.wParam;<br />
}<br />
<br />
Andrew McIntyre
|
|
|
|
|
MrMcIntyre wrote: hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
"My Project",
WS_POPUP,
SW_MAXIMIZE. <<---
NULL, NULL, hInstance, NULL);
Surely this does not compile for you.
It should be:
hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, g_szClassName, "My Project", WS_POPUP,
0, 0, 0, 0,
(HWND) NULL, (HMENU) NULL, hInstance, NULL);
MrMcIntyre wrote: ShowWindow(hwnd, nCmdShow);
ShowWindow(hwnd, SW_MAXIMIZE);
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|