winmain.cpp

来自「虚拟打印机」· C++ 代码 · 共 67 行

CPP
67
字号
/* * * (ppinstaller) winmain.cpp * * */#include "winmain.h"#include "prinstaller.h"#include "..\lib\printResizerCommon.h"#include "..\lib\prutils.h"#include "..\lib\types.h"#include <windows.h>#include <commctrl.h>#include <shlobj.h>int APIENTRY wWinMain(	HINSTANCE hInstance,	HINSTANCE hPrevInstance,	LPWSTR	  lpCmdLine,	int       nCmdShow) {	// 7/12	if ( ! ::IsWinVersionOK() ) {		tstring tstrMessage = TEXT("The installer you downloaded is for ");		tstrMessage += PRINTRESIZER_OSFOR;		tstrMessage += TEXT("\n\nYou can check the web site to see if there is a version for your OS.\n\n");		tstrMessage += PRINTRESIZER_URL;		::ErrorExit( ::PrintResizerComponents::eInstaller, NULL, tstrMessage.c_str() );	}	if (! ::IsScreenResolutionOK()) {		tstring tstrMessage = TEXT("A minimum screen resolution of ");		tstrMessage += PRINTRESIZER_MINSCREENRES;		tstrMessage += TEXT(" is required.");		::ErrorExit(PrintResizerComponents::eInstaller, NULL, tstrMessage.c_str());	}	// DEBUG / FIX	static BOOL b = STATICBOOLBREAK;	if (b) {		::DebugBreak();	}	::CoInitialize(0);	InitCommonControls();	HMODULE hLib = ::LoadLibrary(TEXT("Riched32.dlL"));	// 6/2 CAN'T ALLOCATE WINDOWS OR DIALOGS ON THE STACK! THEY ARE DELETED AUTOMATICALLY IN THE WND-PROCS	::InstallerDialogWindow *pidw = new ::InstallerDialogWindow(hInstance);	pidw->DoCreateDialog( (HWND) NULL );	pidw->ShowWindow(SW_NORMAL);		MSG msg;	while (GetMessage(&msg, NULL, 0, 0)) {		MyProcessMessage(msg);	}	::CoUninitialize();	return (int) msg.wParam;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?