Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Enumerating data formats currently available on the clipboard
Custom GDI+ class
Mapping and disconnecting network drives
Winsock: sending email messages (SMTP, port 25)
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Converting Unicode data from the Clipboard to a character string using a given code page
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
Disk in drive A:
How to display the Properties dialog box for a file (ShellExecuteEx)
Enumerating network resources
Detecting changes in connections to removable drives (VFP9)
How to download a file from the FTP server using FtpGetFile
Using EnumPrinters function to enumerate locally installed printers
Splash Screen for the VFP application
Using Font and Text functions
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
How to play AVI file on the _screen
Retrieving the name of the network resource associated with a local device
Subclassing CommandButton control to create BackColor property
Vertical Label control
Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
Creating a console window for Visual FoxPro application
Running a regular FoxPro form while main VFP window is minimized

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:
This code changes a parent window for the given form to the Windows Desktop.
 
PUBLIC objForm
objForm = CreateObject("Tform")
objForm.Visible = .T.
 
DEFINE CLASS Tform As Form
AutoCenter=.T.
PROTECTED formstatus
 
PROCEDURE  Init
    THIS.formstatus = 0
 
PROCEDURE  Activate
    IF THIS.formstatus = 1
        RETURN
    ENDIF
 
    DECLARE INTEGER GetDesktopWindow IN user32
    DECLARE INTEGER GetFocus IN user32
    DECLARE INTEGER SetParent IN user32;
        INTEGER hWndChild, INTEGER hWndNewParent
 
    LOCAL hForm, hDesktop
    hDesktop = GetDesktopWindow()
    hForm = GetFocus()
 
    * if successfully changing the parent window for this form
    * then minimizing the main VFP window
 
    IF SetParent (hForm, hDesktop) <> 0
        THIS.formstatus = 1
        _SCREEN.WindowState = 1
    ENDIF
 
ENDDEFINE
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
706 bytes  
Created: 2002-01-10 19:57:05  
Modified: 2002-01-10 20:05:25  
Visits in 7 days: 54  
Listed functions:
GetDesktopWindow
GetFocus
SetParent
Printer friendly API declarations
My comment:
It makes the form less dependent on the main VFP window. Its icon even appears on the Windows toolbar.

As I can see some more adjustments should be done to the form through the SetWindowLong function, since it is not possible to put it on top when it is hidden by other windows.
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 (107.20.129.212)
34.73 min.Example: 'Writing to INI file'
1.77 hrs.Function: 'GdipResetWorldTransform'
 Function: 'GetMenu'
2.81 hrs.Function: 'GdipSetTextRenderingHint'
 Example: 'Testing Transparent Menu Class with top-level form (requires VFP9)'
4.96 hrs.Example: 'Reading the structure of VFP main menu'
 Example: 'Placing an arbitrary rectangular area of main VFP window on the Clipboard'
6.47 hrs.Example: 'Retrieving file information for the VFP executable running'
 Example: 'How to print FoxPro form'
6.92 hrs.Pwd
Google
Advertise here!