May 03, 2001 12:21 PM
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);
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);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement