Code:
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow)
{
WNDCLASSEX wc;
HWND hwnd;
MSG msg;
LONG errorcode;
char error[20] = {0};
g_hInst = hInstance;
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon (GetModuleHandle(NULL), MAKEINTRESOURCE(ID_GRAPHICO));
wc.hIconSm = (HICON)LoadImage (GetModuleHandle(NULL), MAKEINTRESOURCE(ID_GRAPHICO), IMAGE_ICON, 16, 16, 0);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.lpszMenuName = MAKEINTRESOURCE(ID_GRAPH_MENU);
wc.lpszClassName = g_szClassName;
wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
if (!RegisterClassEx(&wc))
{
MessageBox(NULL, "There was a problem registering the window class.\nProgram creation has failed.",
"Error!", MB_OK | MB_ICONERROR);
errorcode = GetLastError();
_itoa(errorcode, error, 10);
MessageBox(NULL, error, "Error code", MB_OK);
return (0);
}
hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, g_szClassName, "Graphing Calculator - Shibby Inc. ©",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 325, 475, HWND_DESKTOP, NULL, hInstance, NULL);
if (hwnd == NULL)
{
MessageBox(NULL, "There was a problem creating the window.\nProgram creation has failed.",
"Error!", MB_OK | MB_ICONERROR);
errorcode = GetLastError();
_itoa(errorcode, error, 10);
MessageBox(NULL, error, "Error code", MB_OK);
return (0);
}
ShowWindow(hwnd, iCmdShow);
UpdateWindow(hwnd);
// The Great and Mighty Message Loop
while (GetMessage(&msg, NULL, 0, 0) > 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
? any ideas ?