Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the handle of an untitled FoxPro window ?
Message
From
01/07/1998 12:49:03
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00112915
Message ID:
00113456
Views:
35
>The problem is that VFP has a number of window handles (something like 8 if you start VFP with just the standard tool bar and command window). So finding the right one, if it doesn't have a caption, is, at best, a tricky proposition. I can tell you this, the window will be a child of the VFP desktop window. This is not the value returned by MainhWnd() in Foxtools. The desktop is a child of that window. The earliest that you can retrieve the value is in the .Load event. If you make the window handle a property of the form, you can use _WhTohWnd(_WOntop()) there and pass that value to the function.


I am working, in FoxPro 2.6, George. Using WinSpy, it looks like the window is a child of the window returned by FOXWINDOW() (==MainhWnd() ?).

>Just out of curiousity, may I ask what you're trying to do?

I have a toolbar managed by a DLL. If I just let the DLL create its own window to display the toolbar, I have several display problem due to the fact that this window is not known by FoxPro (the floating FoxPro windows can then be moved *under* the toolbar !).

If however I ask the DLL to display the toolbar in a window created by FoxPro everything is fine. As I want the toolbar to appear as a standard toolbar under my menu, I do not want any title for this window and therefore I cannot retrieve it easily from my FLL (C code). I also need the handle of the window to resize precisely its height so that it fits the buttons height. FoxPro coordinates system (character based) doe not allow me to do that.

As I said, activating the FoxPro window in my FoxPro program before calling the toolbar creation function does the trick with the help of _WhTohWnd(_WOntop()). I just hoped that I could pass the window handle as argument...
--Noel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform