有没有办法区分设备上下文类型? [英] Is there a way to distinguish the device context types ?
本文介绍了有没有办法区分设备上下文类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在挂钩GDI API ExtTextOut
Hi,
I am Hooking the GDI API ExtTextOut
BOOL ExtTextOut(
__in HDC hdc,
__in int X,
__in int Y,
__in UINT fuOptions,
__in const RECT *lprc,
__in LPCTSTR lpString,
__in UINT cbCount,
__in const INT *lpDx
);
我的问题:是否有很好的可靠方法来区分设备上下文类型(HDC).特别要知道它是存储设备上下文还是显示设备上下文.
My question: Is there a good solid way to distinguish the device context types (HDC). In particular to know if it is a memory device context or a display device context.
谢谢您的努力,Momico.
Thanks for your efforts, Momico.
推荐答案
if(GetObjectType((HGDIOBJ)hdc)== OBJ_MEMDC){您有存储设备上下文}
if(GetObjectType((HGDIOBJ)hdc) == OBJ_MEMDC) { you have a memory device context }
如果GetObjectType返回OBJ_DC,则需要使用GetDeviceCaps(hdc,TECHNOLOGY)== DT_RASDISPLAY
If GetObjectType returns OBJ_DC you need to use GetDeviceCaps(hdc,TECHNOLOGY) == DT_RASDISPLAY
致谢
这篇关于有没有办法区分设备上下文类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文