Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Converting Unicode data from the Clipboard to a character string using a given code page
How to download a file from the FTP server using FtpGetFile
Detecting changes in connections to removable drives (VFP9)
Winsock: sending email messages (SMTP, port 25)
Enumerating data formats currently available on the clipboard
How to play AVI file on the _screen
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
Custom FTP Class for Visual FoxPro application
Custom HttpRequest class (WinHTTP)
Deleting files into the Recycle Bin
Creating the Open dialog box to specify the drive, directory, and name of a file to open
How to activate Windows Calculator
Splash Screen for the VFP application
Custom HttpRequest class (WinINet)
Using Font and Text functions
Establishing connection using the SQLDriverConnect
Mapping and disconnecting network drives
How to display the Properties dialog box for a file (ShellExecuteEx)
How to convert a bitmap file to monochrome format (1 bpp)
Using EnumPrinters function to enumerate locally installed printers
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: 66  
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 (23.22.212.158)
1.27 hrs.Example: 'How to retrieve information about a cache entry (Internet Explorer)'
 Example: 'How to control Adobe Reader 9.0 (SDI mode) from VFP application'
 Example: 'Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera'
15.33 hrs.Example: 'WAV file recorder'
19.84 hrs.Example: 'GDI+: Color Transparency'
1 day(s)Example: 'Minimizing all running applications'
 Example: 'Establishing connection using the SQLDriverConnect'
 Example: 'Creating a mailslot'
 Example: 'Using InternetGoOnline function'
 Function: 'PeekMessage'
Google
Advertise here!