怎么判断句柄是屏幕还是打印机
如何判断句柄是屏幕还是打印机
目前得到了绘图的句柄,使用API编程。
无法通过
CDC* pDC = CDC::FromHandle(hDrawDC);
得到指针,进而使用IsPrinter。编译的时候提示CDC无法识别。请问还有什么别的办法?谢谢
------解决方案--------------------
int GetDeviceCaps(
hDrawDC, // handle to DC
TECHNOLOGY // index of capability
);
DT_PLOTTER Vector plotter
DT_RASDISPLAY Raster display
DT_RASPRINTER Raster printer
DT_RASCAMERA Raster camera
DT_CHARSTREAM Character stream
DT_METAFILE Metafile
DT_DISPFILE Display file
目前得到了绘图的句柄,使用API编程。
无法通过
CDC* pDC = CDC::FromHandle(hDrawDC);
得到指针,进而使用IsPrinter。编译的时候提示CDC无法识别。请问还有什么别的办法?谢谢
------解决方案--------------------
int GetDeviceCaps(
hDrawDC, // handle to DC
TECHNOLOGY // index of capability
);
DT_PLOTTER Vector plotter
DT_RASDISPLAY Raster display
DT_RASPRINTER Raster printer
DT_RASCAMERA Raster camera
DT_CHARSTREAM Character stream
DT_METAFILE Metafile
DT_DISPFILE Display file