Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to retrieve Hdc Form
Message
 
To
29/03/1999 06:30:03
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00202924
Message ID:
00202927
Views:
20
>Is anybody know,...
>
>How to retrieve hdc (Handle of Device context) of a Form or Control object,.. ?
>
>Because when I was using VB hdc is part of a form or control object properties,...
>
>Any suggestion,..??

Hi Mesa,

While VFP's native controls aren't real windows and don't have window handle, the forms are. You can get the window handle of a VFP form by using the Foxtools library like this:
lnhWnd = _WhTohWnd(_WFindTitl(_SCREEN.ActiveForm.Caption))
* Or
lnhWnd = _WhTohWnd(_WOnTop())
Once you have the window handle you can get the device context using the Win32 call GetWindowDC
DECLARE INTEGER GetWindowDC IN Win32API;
  INTEGER hwnd
lnhDC = GetWindowDC(lnhWnd)
hth,
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform