00001 00006 /* 00007 * CC PDF Converter: Windows PDF Printer with Creative Commons license support 00008 * Excel to PDF Converter: Excel PDF printing addin, keeping hyperlinks AND Creative Commons license support 00009 * Copyright (C) 2007-2010 Guy Hachlili <[email protected]>, Cogniview LTD. 00010 * 00011 * This file is part of CC PDF Converter / Excel to PDF Converter 00012 * 00013 * CC PDF Converter and Excel to PDF Converter are free software; 00014 * you can redistribute them and/or modify them under the terms of the 00015 * GNU General Public License as published by the Free Software Foundation; 00016 * either version 2 of the License, or (at your option) any later version. 00017 * 00018 * CC PDF Converter and Excel to PDF Converter are is distributed in the hope 00019 * that they will be useful, but WITHOUT ANY WARRANTY; without even the implied 00020 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 00025 */ 00026 00027 #include "stdafx.h" 00028 #include "CCPrintInstallFunctions.h" 00029 00031 HANDLE ghModule = NULL; 00032 00040 BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) 00041 { 00042 switch (ul_reason_for_call) 00043 { 00044 case DLL_PROCESS_ATTACH: 00045 // Initial module load for this process; keep the handle 00046 ghModule = hModule; 00047 break; 00048 } 00049 return TRUE; 00050 } 00051 00059 LONG APIENTRY InstallPrinter(HWND hwnd, LPLONG lpIValue, LPTSTR installPath) 00060 { 00061 CCPDFPrinterInstaller installer(hwnd); 00062 return installer.DoInstall((HMODULE)ghModule, installPath) ? 0 : 1; 00063 } 00064 00072 LONG APIENTRY RemovePrinter(HWND hwnd, LPLONG lpIValue, LPSTR lpszValue) 00073 { 00074 CCPDFPrinterInstaller installer(hwnd); 00075 return installer.DoRemove() ? 0 : 1; 00076 } 00077 00085 LONG APIENTRY IsInstalled(HWND hwnd, LPLONG lpIValue, LPSTR lpszValue) 00086 { 00087 CCPDFPrinterInstaller installer(hwnd); 00088 return installer.IsPrinterInstalled() ? 0 : 1; 00089 }