|
-
May 5th, 2002, 04:25 PM
#1
Thread Starter
Lively Member
Why ?
#include <windows.h>
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASS WndClass;
WndClass.style = 0;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
WndClass.lpfnWndProc = WndProc;
WndClass.hInstance = hInstance;
WndClass.hbrBackground = (HBRUSH) (COLOR_WINDOW +1);
WndClass.hCursor = 0;
WndClass.hIcon = 0;
WndClass.lpszMenuName = 0;
WndClass.lpszClassName = "WinProg";
RegisterClass(&WndClass);
HWND hWindow;
hWindow = CreateWindow("WinProg","Window",WS_OVERLAPPEDWINDOW,0,0,400,400,NULL,NULL,hInstance,NULL);
ShowWindow(hWindow, nCmdShow);
UpdateWindow(hWindow);
MSG Message;
while (GetMessage(&Message,NULL,0,0))
{
DispatchMessage(&Message);
}
return (Message.wParam);
}
LRESULT CALLBACK WndProc (HWND hWnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
{
switch(uiMessage)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return DefWindowProc (hWnd, uiMessage,wParam, lParam);
}
}
The window shows up fine but a dos window also pops up in the back, how do you get rid of the dos window ?
Last edited by slx47; May 5th, 2002 at 04:35 PM.
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
|