Calculator

hWnd

Internally, the Windows operating systems manage all windows objects and many controls (which are really windows internally) using what are called "handles." A handle is just a numeric reference to a particular window. Certain Windows API functions expect a window handle, or hWnd. Prior to VFP 7, Visual FoxPro internally managed all of the forms and controls in a Visual FoxPro application, and did not bother with the overhead of creating the Windows structures needed to provide a handle.. Now, you simply have to ask a form for its hWnd property.

Usage

nhWnd = oObject.hWnd()
Only four kinds of objects have hWnd properties: forms, toolbars, and the _SCREEN and _VFP objects. hWnd contains a numeric value representing the window handle. This value can be passed to API calls that manipulate windows.

Example

* AnimateWindow is an API that applies animation effects when * Windows are opened or closed. DECLARE AnimateWindow IN Win32API ;     LONG Thehwnd, LONG TimeInMilliSeconds, LONG Flags oForm = CREATEOBJECT("Form")   * When the flag is 1, it "rolls" the form on from left to right. AnimateWindow(oForm.hWnd, 500, 1)   * Try this with flags of 2, 5 and 16; and vary the number * of milliseconds for some cool effects. * A word of caution for this API: This window misbehaves. * oForm.Hide now claims to be read-only, and oForm.Visible  * accepts values but doesn't change. Test your code using APIs * like these thoroughly before putting it into production.

See Also

Declare-DLL, Form, FoxTools, _SCREEN, Toolbar, _VFP


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net