Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Disk in drive A:
Enumerating print processors and supporting data types installed on the specified server
GDI+: creating scaled copy of image file
Retrieving list of available disk drives
Storing the environment strings in cursor
Using InternetGoOnline function
Comparing dimensions of the VFP main window with _SCREEN properties
Enumerating global and local group accounts on a server (WinNT/XP/2K)
GDI+: Color Transparency
GDI+: printing image file
Number of clipboard formats available
Retrieving list of all active RAS connections
Testing an ODBC connection for supporting specific functionality
Yet another modal dialog: now HTML-based
Displaying the drive type value
Drawing standard Windows icons
Finding the path to the VFP executable running
How to save registry key including its subkeys and values to a file
Printing text on the client area of the main VFP window
Reading and setting system access privileges for the current process
Reading VFP settings from the Windows Registry
Retrieving information about the main VFP window
Verifying a file using the Authenticode policy provider
Adding printer to the list of supported printers for the specified server
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: 107  
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 (50.16.108.167)
1 sec.Function: 'CeWriteFile'
13.43 min.Function: 'EnumDisplayDevices'
13.48 min.Example: 'Adding user-defined items to the Control Menu of VFP form (requires VFP9)'
13.53 min.Example: 'Retrieving information about the main VFP window'
26.98 min.Example: 'How to enumerate, add and delete shares on the local computer (WinNT/XP)'
27.03 min.Function: 'FatalAppExit'
Function group: 'Error Handling'
1.28 hrs.Function: 'GetConsoleWindow'
 Example: 'How to access a file using not its name but an alias (hard link)'
 Example: 'One more way to retrieve environment strings'
2.96 hrs.Example: 'How to print FoxPro form -- II'
Google
Advertise here!