Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Comparing file times
Creating a device context for the specified printer
Get the power status of your laptop computer
GetFocus returns a HWND value
How to display advanced Task Dialog (Vista)
Retrieveing information about the active window (even if it is not owned by the calling process)
How to find which fonts Windows uses for drawing captions, menus and message boxes
Loading a string resource from an executable file
Playing WAV sounds simultaneously
Removing FTP directory
Retrieving graphic capabilities of default printer
Storing the environment strings in cursor
Using the GradientFill function
Validating the heap of the calling process
Drawing icons associated with the VFP main window
GDI+: how to make VFP controls visually shake and shudder
Printing text on the main VFP window
Testing Transparent Menu Class with top-level form (requires VFP9)
How to generate GUID values
Obtaining OS memory performance information
Pocket PC: Folder Viewer
Reading metrics for the currently selected font
Configuring DEVMODE structure for a printer
Setting properties of the window: caption and user-defined value
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: 61  
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 (184.72.91.94)
4 sec.Function: 'EnumJobs'
6 sec.Function: 'SetThreadExecutionState'
1.05 hrs.Function: 'IsMenu'
 Function: 'GetCapture'
2.78 hrs.Function: 'CreateProcessWithLogonW'
Function group: 'Process and Thread'
2.79 hrs.Example: 'Extended MessageBox Class'
4.12 hrs.Example: 'Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera'
Language: 'Visual FoxPro'
9.59 hrs.Example: 'How to play AVI file on the _screen'
 Function: 'PathIsNetworkPath'
Function group: 'Shell Lightweight Utility APIs -- Path Functions'
 
Function group: 'Error Handling'
Google
Advertise here!