Advertisement

Winmain

Started by May 03, 2001 03:10 AM
2 comments, last by Junghans 23 years, 9 months ago
Hello, How to include winmain in c++ style (object ) ?? Thanks
JunGhans
could you be more specific please?

Arkon
[QSoft Systems]
Advertisement
WinMain is the main function in a windows program
WinProc is the function which handles windows messages.

Example

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
{

//your code here

}

If you mean do register a Windowsclass do the folowing for ex.
You put this in your main function

WNDCLASSEX wcx;

ZeroMemory(&wcx, sizeof(WNDCLASSEX));
wcx.cbSize = sizeof(WNDCLASSEX);
wcx.lpfnWndProc = MainWindowProc;
wcx.hInstance = GetModuleHandle(NULL);
wcx.hIcon = LoadIcon(wcx.hInstance, MAKEINTRESOURCE(IDR_MAIN));
wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wcx.lpszClassName = "SampleWindowClass";
wcx.lpszMenuName = MAKEINTRESOURCE(IDR_MAIN);
RegisterClassEx(&wcx);






as far as i know, it''s not possible to declare WinMain() as a (static or normal) class method

This topic is closed to new replies.

Advertisement