int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { MSG msg; HACCEL hAccel; UNREFERENCED_PARAMETER(hPrevInstance); if (ProcessCmdLine(lpCmdLine)) { return 0; } /* Initialize global strings */ LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadStringW(hInstance, IDC_REGEDIT_FRAME, szFrameClass, MAX_LOADSTRING); LoadStringW(hInstance, IDC_REGEDIT, szChildClass, MAX_LOADSTRING); switch (GetUserDefaultUILanguage()) { case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT): SetProcessDefaultLayout(LAYOUT_RTL); break; default: break; } /* Store instance handle in our global variable */ hInst = hInstance; /* Perform application initialization */ if (!InitInstance(hInstance, nCmdShow)) { return 0; } hAccel = LoadAcceleratorsW(hInstance, MAKEINTRESOURCEW(ID_ACCEL)); /* Main message loop */ while (GetMessageW(&msg, NULL, 0, 0)) { if (!TranslateAcceleratorW(hFrameWnd, hAccel, &msg) && !TranslateChildTabMessage(&msg)) { TranslateMessage(&msg); DispatchMessageW(&msg); } } ExitInstance(hInstance); return (int)msg.wParam; }
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { MSG msg; HACCEL hAccel; UNREFERENCED_PARAMETER(hPrevInstance); if (ProcessCmdLine(lpCmdLine)) { return 0; } /* Initialize global strings */ LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_REGEDIT_FRAME, szFrameClass, MAX_LOADSTRING); LoadString(hInstance, IDC_REGEDIT, szChildClass, MAX_LOADSTRING); /* Store instance handle in our global variable */ hInst = hInstance; /* Perform application initialization */ if (!InitInstance(hInstance, nCmdShow)) { return FALSE; } hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(ID_ACCEL)); /* Main message loop */ while (GetMessage(&msg, (HWND)NULL, 0, 0)) { if (!TranslateAccelerator(hFrameWnd, hAccel, &msg) && !TranslateChildTabMessage(&msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } ExitInstance(hInstance); return (int) msg.wParam; }
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; HACCEL hAccel; if (ProcessCmdLine(lpCmdLine)) { return 0; } /* Initialize global strings */ LoadStringW(hInstance, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle)); LoadStringW(hInstance, IDS_REGISTRY_DEFAULT_VALUE, g_pszDefaultValueName, COUNT_OF(g_pszDefaultValueName)); /* Store instance handle in our global variable */ hInst = hInstance; /* Perform application initialization */ if (!InitInstance(hInstance, nCmdShow)) { return FALSE; } hAccel = LoadAcceleratorsW(hInstance, MAKEINTRESOURCEW(IDC_REGEDIT)); /* Main message loop */ while (GetMessageW(&msg, NULL, 0, 0)) { if (!TranslateAcceleratorW(hFrameWnd, hAccel, &msg) && !TranslateChildTabMessage(&msg)) { TranslateMessage(&msg); DispatchMessageW(&msg); } } ExitInstance(); return msg.wParam; }