您好我使用Delphi 2010 + Windows XP,您可以在Delphi中调用Windows XP中的照片打印向导.
上面这个提示只适用于Windows 7
谢谢.
MSDN包含以下示例代码:
static const CLSID CLSID_PrintPhotosDropTarget =
{0x60fd46de, 0xf830, 0x4894, {0xa6, 0x28, 0x6f, 0xa8, 0x1b, 0xc0, 0x19, 0x0d}};
// A data object that contains the list of photos to print.
IDataObject* pDataObject;
// Create the Photo Printing Wizard drop target.
CComPtr<IDropTarget> spDropTarget;
hr = CoCreateInstance(CLSID_PrintPhotosDropTarget,
NULL,
CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(&spDropTarget));
// Drop the data object onto the drop target.
POINTL pt = {0};
DWORD dwEffect = DROPEFFECT_LINK | DROPEFFECT_MOVE | DROPEFFECT_COPY;
spDropTarget->DragEnter(pDataObject, MK_LBUTTON, pt, &dwEffect);
spDropTarget->Drop(pDataObject, MK_LBUTTON, pt, &dwEffect);
Run Code Online (Sandbox Code Playgroud)
Delphi代码是这样的:
uses
ActiveX, ComObj;
const
CLSID_PrintPhotosDropTarget: TGUID = '{60FD46DE-F830-4894-A628-6FA81BC0190D}';
procedure InvokePhotoPrintingWizard;
var
Effect: LongInt;
Position: TPoint;
DataObject: IDataObject;
DropTarget: IDropTarget;
begin
// create the Photo Printing Wizard drop target
OleCheck(CoCreateInstance(CLSID_PrintPhotosDropTarget, nil,
CLSCTX_INPROC_SERVER, IDropTarget, DropTarget));
// drop the data object onto the drop target
Position.X := 0;
Position.Y := 0;
Effect := DROPEFFECT_LINK or DROPEFFECT_MOVE or DROPEFFECT_COPY;
OleCheck(DropTarget.DragEnter(DataObject, MK_LBUTTON, Position, Effect));
OleCheck(DropTarget.Drop(DataObject, MK_LBUTTON, Position, Effect));
end;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
416 次 |
| 最近记录: |