Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Determining if an Active Network Connection is Available
How to control Adobe Reader 9.0 (SDI mode) from VFP application
How to download a file from HTTP server using URL Monikers functions
Using the GradientFill function
Using the IsWindowEnabled function
Winsock: how to retrieve a service information corresponding to a port
Accessing examples contained in this reference through Web Services
Customizing the frame of top-level form: removing the standard frame (VFP9, Vista)
Reading Internet Query options
Retrieving the priority class for the current process
Yet another modal dialog: now HTML-based
GDI+: Drawing a Pie Chart
GDI+: printing vertical text on VFP reports via generated images (VFP8)
How to start the screen saver and how to find whether the screen saver is active
Obtaining a handle to the desktop associated with the calling thread
Passing data records between VFP applications via the Clipboard
Printing text on the main VFP window
Returning some basic information for the specified INF file
Verifying a file using the Authenticode policy provider
WAV file recorder
An alternative way of setting Form.Closable to False
Displaying the drive type value
How to display a Task Dialog (Vista)
How to get Special Folders paths
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: 56  
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 (54.234.42.16)
3.7 hrs.Example: 'URL: splitting into its component parts'
 Function: 'GetFileSizeEx'
3.92 hrs.Function: 'SetTextColor'
 Function: 'EnumDeviceDrivers'
Function group: 'Performance Monitoring'
5.16 hrs.Function: 'GetWindowInfo'
Function group: 'Window'
 Example: 'Moving shortcut to a specified position on the Windows Desktop'
5.61 hrs.Function: 'capGetDriverDescription'
Function group: 'Windows Multimedia'
14.04 hrs.Example: 'Enumerating ODBC Data Sources available on the local computer'
 Example: 'How to make a VFP form fading out when released (GDI+ version)'
Language: 'Visual FoxPro'
20.45 hrs.
Function group: 'GDI+ Bitmap'
Google
Advertise here!