本文介绍了在我使用hdc之前,如何确定它是否可用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

static HDC  hdcScreen ;

hdcScreen = CreateDC (TEXT ("DISPLAY"), NULL, NULL, NULL) ;

//I saved a screen-hdc in static.
//I use it whenever I want, without creating again.



static COLORREF cr ;

GetCursorPos (&pt) ;
cr = GetPixel (hdcScreen, pt.x, pt.y) ;

//I used screen-hdc to pick color value



但是当另一个名为LockWindowUpdate(hwndScreen)的程序无法在我的程序中再次使用"hdc-screen"时.

我想知道在使用hdc之前如何确定它是否可用.无限.

请参阅: http://msdn.microsoft.com/en-us/library /dd144871(v=vs.85).aspx [ ^ ]

所以用

 HDC hdcScreen = GetDC(NULL);
// 你有东西吗
ReleaseDC(hdcScreen);


问候
Espen Harlinn



static HDC  hdcScreen ;

hdcScreen = CreateDC (TEXT ("DISPLAY"), NULL, NULL, NULL) ;

//I saved a screen-hdc in static.
//I use it whenever I want, without creating again.



static COLORREF cr ;

GetCursorPos (&pt) ;
cr = GetPixel (hdcScreen, pt.x, pt.y) ;

//I used screen-hdc to pick color value



but when Another program called LockWindowUpdate (hwndScreen), "hdc-screen" isn''t useable again in my program.

I want know How to determines if a hdc is useable , before I used it.

解决方案



这篇关于在我使用hdc之前,如何确定它是否可用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 08:43