📄 winmain.cpp
字号:
/* (pruninstallerstub) winmain.cpp * Copyright (C) 2006 Michael H. Overlin This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact at poster_printer@yahoo.com */#include "resource.h"#include "..\lib\printResizerCommon.h"#include "..\lib\prinstallroutines.h"#include "..\lib\prutils.h"#include "..\lib\utils.h"#include <windows.h>#include <tchar.h>#include <strsafe.h>#include <malloc.h>int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow){ BOOL bSuccess = FALSE; TCHAR atstrSysDir[MAX_PATH]; UINT uiRetCode = ::GetSystemDirectory(atstrSysDir, ARRCOUNT(atstrSysDir)); if (uiRetCode != 0) { LPTSTR lptstrRunDLLFullName = ::MakeFullFileName(atstrSysDir, TEXT("rundll32.exe")); if (lptstrRunDLLFullName != NULL) { TCHAR atstrTempFileName[MAX_PATH+1]; if (::GetFullTempFileName(atstrTempFileName, ARRCOUNT(atstrTempFileName))) { //if (::WriteResourceToFile(hInstance, atstrTempFileName, IDF_PRINTRESIZER_PRUNINSTALLERDLL, RC_BINARYTYPE/*, NULL*/)) { if (::WriteCompressedResourceToFile(hInstance, atstrTempFileName, IDF_PRINTRESIZER_PRUNINSTALLERDLL, RC_BINARYTYPE/*, NULL*/)) { TCHAR atstrThisInstance[MAX_PRINTED_DIGITS(ulong)*2 + 2]; ulong ul1 = HIWORD(hInstance); ulong ul2 = LOWORD(hInstance); HRESULT hr = ::StringCchPrintf(atstrThisInstance, ARRCOUNT(atstrThisInstance), TEXT("%lu %lu"), ul1, ul2); if (SUCCEEDED(hr)) { LPTSTR lptstrCommandLine = ::MyCatStrings( lptstrRunDLLFullName, TEXT(" "), atstrTempFileName, TEXT(",_DeleteOurself@16 "), atstrThisInstance, NULL ); if (lptstrCommandLine != NULL) { PROCESS_INFORMATION pi; STARTUPINFO si; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); ZeroMemory(&pi, sizeof(pi)); BOOL bCreated = CreateProcess( NULL, lptstrCommandLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); if (bCreated) { bSuccess = TRUE; } free(lptstrCommandLine); } } } } free(lptstrRunDLLFullName); } } int iRetValue = 0; if (!bSuccess) { ::ErrorMessage(PrintResizerComponents::eUnInstaller, NULL, TEXT("Uninstall failed.")); iRetValue = -1; } return iRetValue;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -