Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Retrieving IP statistics for the computer
Validating URLs using moniker functions
How to get Special Folders paths
Monitoring changes in a directory
Monitoring changes occurring within a directory
Testing if a connection to an Url can be established
Using the DeleteFile
Comparing file times
GetFocus returns a HWND value
Retrieveing information about the active window (even if it is not owned by the calling process)
Winsock: retrieving the standard host name and IP address for the local machine
Creating a device context for the specified printer
Get the power status of your laptop computer
How to display advanced Task Dialog (Vista)
Retrieving graphic capabilities of default printer
Using the GradientFill function
Validating the heap of the calling process
Drawing icons associated with the VFP main window
GDI+: how to make VFP controls visually shake and shudder
How to delete IE cookies, clear IE history and delete files in Temporary Internet Files directory
How to find which fonts Windows uses for drawing captions, menus and message boxes
Playing WAV sounds simultaneously
Pocket PC: Folder Viewer
Printing text on the main VFP window
Using IsChild() for testing ThisForm.ShowWindow property

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Before you begin:
Push the button to display the Parent-Child state for the form.
 
PUBLIC objForm
objForm = CreateObject("Tform")
objForm.Visible = .T.
 
DEFINE CLASS Tform As FORM
Autocenter = .T.
*ShowWindow = 0  && a child form placed in the main VFP window
*ShowWindow = 1  && a child form of the active top-level form
ShowWindow = 2  && a top-level form in which child forms can be placed
 
ADD OBJECT cmd As CommandButton WITH;
LEFT=10, TOP=10, WIDTH=80, HEIGHT=24, CAPTION="Diag"
 
PROCEDURE  Load
    THIS.decl
 
PROCEDURE  cmd.Click
    LOCAL lcMsg
    IF IsChild (GetActiveWindow(), GetFocus()) = 1
        lcMsg = "This form is a child window to the main VFP window"
    ELSE
        lcMsg = "This form is NOT a child window to the main VFP window"
    ENDIF
    = MessageB ("ThisForm.ShowWindow=" +;
        LTRIM(STR(ThisForm.ShowWindow)) + Chr(13) + lcMsg)
 
PROCEDURE  decl
    DECLARE INTEGER GetFocus IN user32
    DECLARE INTEGER GetActiveWindow IN user32
    DECLARE INTEGER IsChild IN user32 INTEGER hWndParent, INTEGER hwnd
 
ENDDEFINE
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
953 bytes  
Created: 2001-12-08 14:15:24  
Modified: 2001-12-08 14:29:01  
Visits in 7 days: 60  
Listed functions:
GetActiveWindow
GetFocus
IsChild
Printer friendly API declarations
My comment:
This example shows that the ShowWindow property of the form really affects the Parent-Child relationship between the form and the main VFP window.

Among other consequences of this statement there is the one: you can not successfully apply the Win32 SetMenu function to a form with its ShowWindow property other than 2.
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (184.72.184.104)
4 sec.Example: 'How to find which fonts Windows uses for drawing captions, menus and message boxes'
48.57 min.Function: 'DragDetect'
4.84 hrs.Function: 'GetDeviceCaps'
5.09 hrs.Function: 'AVIStreamReadFormat'
 Example: 'Obtaining list of tables stored in an ODBC Data Source'
10.9 hrs.Function: 'GdipDrawRectangle'
 Function: 'SetWindowLong'
11.59 hrs.Example: 'Round FoxPro form'
 Example: 'Detecting changes in connections to removable drives (VFP9)'
Language: 'C#'
 Example: 'GDI+: converting image file to another graphics format'
Google
Advertise here!