Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using an Event Object. Part A: running an application that creates an Event object
Using Custom FTP class (DEFINE CLASS ftp As Custom)
Using Multimedia Command Strings to play MIDI files
Winsock: initializing the service in the VFP application
Enumerating MIDI output devices
Pocket PC: creating new database in the Object Store and copying Contacts Database records into it
Reading data from INI files
Retrieving configuration information for the specified server (Win98/Me)
Retrieving geometrical parameters of the system desktop window
Accessing a CD device (cdaudio) with Multimedia Command Strings
Current directory of the application
Managing Cookies
Copying files as a transacted operation (Vista)
GDI+: converting text strings to images and saving in a graphics file
How to hide your program from the Close Program dialog (Win9* only)
Retrieving the IP-to-physical address mapping table
Saving available locale records into a cursor
GDI+: loading image file, drawing on it, saving the result to another file
Obtaining the bounding rectangle for the specified device context
Retrieving the rectangle area where the mouse cursor is confined
Retrieving window and menu help context identifiers
Current System information
Retrieving top-child window for the VFP form
Simple MAPI: how to pick an email recipient from Outlook Express address book
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: 54  
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.226.5.29)
4 sec.Example: 'Adding a background image to VFP report (VFP9, ReportListener)'
3.37 hrs.Example: 'How to detect if additional monitor is connected and active'
Language: 'C#'
 Example: 'How to retrieve adapter information for the local computer (including MAC address)'
4.85 hrs.Example: 'How to play AVI file on the _screen'
 Example: 'Scanning a hierarchy of child windows down from the Windows Desktop'
7.99 hrs.Example: 'Loading a string resource from an executable file'
8.22 hrs.Example: 'Creating a window using CreateWindowEx function'
 Example: 'Displaying bitmap using the AlphaBlend function'
1 day(s)Example: 'Playing WAV sounds simultaneously'
 Function: 'AttachVirtualDisk'
Google
Advertise here!