/** * Yet another app gets born! */ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { MSG msg; HACCEL hAccelTable; WSAData wsaData; if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) { MessageBox(NULL, "WSAStartup (sockets) failed.", "A FREAKING SERIOUS ERROR", MB_ICONEXCLAMATION | MB_OK); PostQuitMessage(0); } InitCommonControls(); myRegisterClass(hInstance, "myWinClass", (WNDPROC)WndProc, IDC_WAAPIX); myRegisterClass(hInstance, "myAboutBoxClass", (WNDPROC)aboutBoxProc, 0); //creating the VAPIX object vapix = new Vapix(); //struct for opening the browser memset(&execInfo, '\0', sizeof(execInfo)); execInfo.nShow = SW_SHOWNORMAL; execInfo.cbSize = sizeof(execInfo); //creating the http handler httpReader = new HttpReader(); if (!showMainWnd (hInstance, nCmdShow)) { MessageBox(NULL, strcat(itoc((int)GetLastError()), "\r\n\r\nError creating main window"), "Cataclysmic error!", MB_ICONEXCLAMATION | MB_OK); return FALSE; } //use for language files? or make own and remove this? hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_WAAPIX); //doing the same shit that's been done for 30 years while (GetMessage(&msg, NULL, 0, 0)) { if (IsDialogMessage(hWnd, &msg) != 0) continue; else if (IsDialogMessage(hWnd, &msg) != 0) continue; if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } //free up memory delete vapix; delete httpReader; //gerrarre!!! return (int) msg.wParam; }
int WINAPI _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); MSG msg; HACCEL hAccelTable; myRegisterClass(hInstance); // Perform application initialization: if (!initInstance (hInstance, nCmdShow)) { return FALSE; } hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_MAIN)); // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return (int) msg.wParam; }