Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the easiest way to get Window handle value?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00051377
Message ID:
00052125
Views:
69
>Hi Paul!
>
>Yes, I was wrong ;), but what does mean when the different instances of one
>child form (shown in toplevel form) have the same handle? May be the child
>window in VFP are just painted too ?
>
>>In VFP controls are only painted on forms. So, you can't get a handle to
>>button's window (because there is no such window). The lowest level that
>>still has a window is the Form.

Vladimir and Vlad,

In an attempt to solve this mystery, I used the old SPY.EXE program that came with C/C++ 7.0. What I found out was surprising.

Using GetTopWindow with the FoxPro window handle didn't return the handle of the command window, but rather the filler that's created to make the tool bar go all the way across the top of the main window. SPY also reported a different handle for the toolbar, the frame of the command window, the command window entry area, and the status bar.

I also created a form with a command button, and the FoxHWnd control. The form had one handle, the command button another, and the FoxHWnd control yet another. I guess the only way to reliably get a value for a form is to use the FoxHWnd control.

In thinking about this, it makes sense. It was also rather humbling, it that it makes me realize that I don't know as much about the inner workings of Windows as I though I did.

George
George

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

Click here to load this message in the networking platform