|
<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
|
|
|
|
|
David Thank you so much. Its much appreciated.
--Andrew
Andrew McIntyre
|
|
|
|
|
Is there a reason you posted the same question later, after this one already got replies? Twice within a minute... That's being unlucky, and a technical issue.
Here's an article that makes a window be fullscreen:
Gribble1 - CWnd goes full screen[^]
It's based on MFC - but if you have the skills to make a virtual world program, I'm sure you can decode it. MFC is a very thin wrapper after all.
Good luck,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi,
Is there any way I can get rid of the white border in full screen it makes the application look bad.
Andrew McIntyre
|
|
|
|
|
What white border?
See if the dimensions you are using match the screen size, and make sure you are drawing all the way to the edge.
Those are simple ideas, but the only ones I have!
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
I am new to this forum,
Please refer to the c++ program and the output below. I understand the program but I have a small doubt regarding the output of the program. pls help.
# include <iostream.h>
# include <conio.h>
void main ( )
{
int x[5] = {1,2,3,4,5}, y [5] = {5,4,3,2,1},
result [5] = { 0,0,0,0,0 };
int i= 0,j=0;
clrscr();
while (i++ < 5)
{
cout<<i<<"\n";
result [i] = x [i] + y [i];
}
cout <<"\n The contents of the array are: \n";
do
{
cout << "\t" << x [j];
cout<< "\t" << y [j];
cout<<"\t"<< result [j]<<"\n";
j++;
} while (j<5);
getch ( );
}
While executing the output of the program is:-
1 -1 0
2 4 -2
3 3 0
4 2 2
5 1 4
How i get the output as 1 -1 0 in the first row especially I presume the output should be 1 5 0 in the first row. Please help.
thanks
|
|
|
|
|
Your computations go into result[1..5] using x[1..5] and y[1..5]. Those arrays are sized at [0..4] so you are exceeding the bounds of the arrays. Your printout uses [0..4] which is correct.
|
|
|
|
|
Thankyou sir but pls explain how I got the first row output especially the -1 in the middle. I need the same array dimension because its given that in a text book.
|
|
|
|
|
You exceeded the bounds of the array definition, what data you fetch or corrupt when you do that is up to the "memory alignment gods". Fix the program as suggested so that you do not exceed the array boundaries and you will stop getting wierd output.
|
|
|
|
|