/*下面是用户可自定义的扩展功能代码*/
case IDM_PRINTERSETUP: //设置打印机
pd.lStructSize = sizeof(PRINTDLG);
pd.hwndOwner = hWndFMExt;
pd.hDevMode = NULL;
pd.hDevNames = NULL;
pd.Flags = PD_RETURNDC|PD_SELECTION|PD_PRINTSETUP;
pd.nCopies = 1;
PrintDlg((LPPRINTDLG)&pd);
break;
case IDM_SELECTFONT: //选择字体
fnt.lStructSize = sizeof(CHOOSEFONT);
fnt.hwndOwner = hWndFMExt;
fnt.hDC = NULL;
fnt.lpLogFont = &lf;
fnt.Flags = CF_SCREENFONTS|CF_EFFECTS;
fnt.rgbColors = RGB(0,255,255);
fnt.lCustData = 0L;
fnt.nFontType = SCREEN_FONTTYPE;
fnt.nSizeMin = 0;
fnt.nSizeMax = 0;
ChooseFont(&fnt);
break;
}
return;
}
/*------------End of EXTPROC_DLL.C------------*/
/*----- EXTPROC_DLL.H -----*/
#define IDM_PRINTERSETUP 101
#define IDM_SELECTFONT 102
#define EXTPROC_LOAD 200
void FAR PASCAL _export FMExtensionProc(HWND,WORD);
/*-----End of EXTPROC_DLL.H -----*/
;资源文件EXTPROC_dll.RC
#include "windows.h"
#include "extproc_dll.h"
FMExtMenu MENU DISCARDABLE
BEGIN
MENUITEM "Printer&Setup" ,IDM_PRINTERSETUP
MENUITEM "Select&Font" ,IDM_SELECTFONT
END
;End of EXTPROC_DLL.RC
;模块定义文件EXTPROC_DLL.DEF
LIBRARY EXTPROC
DESCRIPTION ''File Manager Extension DLL''
EXETYPE WINDOWS
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD SINGLE SHARED
HEAPSIZE 1024
EXPORTS
WEP @1 RESIDENTNAME
FMExtensionProc @2
;End of EXTPROC_DLL.DEF