Using Win32 functions in Visual FoxPro Image Gallery
Window
..msdn
CloseWindow
CreateWindow
CreateWindowEx
DestroyWindow
EndTask
FindWindow
FindWindowEx
GetAncestor
GetClientRect
GetDesktopWindow
GetForegroundWindow
GetGUIThreadInfo
GetParent
GetShellWindow
GetWindow
GetWindowInfo
GetWindowPlacement
GetWindowRect
GetWindowText
GetWindowTextLength
GetWindowThreadProcessId
InternalGetWindowText
IsChild
IsIconic
IsWindow
IsWindowVisible
IsZoomed
MoveWindow
RealGetWindowClass
SetForegroundWindow
SetLayeredWindowAttributes
SetParent
SetWindowPos
SetWindowText
ShowWindow
SwitchToThisWindow
Code examples:
An alternative way of setting Form.Closable to False
Comparing dimensions of the VFP main window with _SCREEN properties
Copying picture of the active form to the Clipboard using Enhanced Metafile API functions
GDI+: copying to the Clipboard (a) image of active FoxPro window/form, (b) image file
GDI+: saving image of FoxPro form to graphics file (BMP, GIF, JPG, PNG, TIF)
GDI+: sending image of FoxPro form to printer
GetFocus returns a HWND value
How to copy the image of a form to the Clipboard using Bitmap API functions
How to create transparent areas inside a form -- punching holes in the form
How to make a VFP form fading out when released (GDI version)
How to make a VFP form fading out when released (GDI+ version)
How to print FoxPro form
How to print FoxPro form -- II
Listing child windows for the Windows desktop
Retrieving geometrical parameters of the system desktop window
Retrieving top-child window for the VFP form
Scanning a hierarchy of child windows down from the Windows Desktop
Storing screen shot of a form to bitmap file
Storing screen shot of a form to enhanced metafile (*.emf)
Scanning a hierarchy of child windows down from the Windows Desktop

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
 
DO decl
 
LOCAL hParent, hWindow, cTitle, cRect
hParent = GetDesktopWindow()
hWindow = 0
 
CREATE CURSOR cs (winhandle I,;
    x0 I, y0 I, x1 I, y1 I, wintitle C(200))
 
DO WHILE .T.
    STORE REPLICATE(CHR(0),255) TO cClass, cTitle
    hWindow = FindWindowEx(hParent, hWindow,;
        Null, Null)
 
    IF hWindow = 0
    * 123=ERROR_INVALID_NAME
    * 127=ERROR_PROC_NOT_FOUND
        ? "Exit on error:", GetLastError()
        EXIT
    ELSE
        cTitle = GetWinText(hWindow)
        cRect = GetWinRect(hWindow)
        INSERT INTO cs VALUES (hWindow,;
            buf2dword(SUBSTR(cRect, 1,4)),;
            buf2dword(SUBSTR(cRect, 5,4)),;
            buf2dword(SUBSTR(cRect, 9,4)),;
            buf2dword(SUBSTR(cRect, 13,4)),;
            cTitle)
    ENDIF
ENDDO
 
SELECT cs
GO TOP
BROWSE NORMAL NOWAIT
* end of main
 
FUNCTION GetWinText(hWindow)
    LOCAL cBuffer
    cBuffer = REPLICATE(CHR(0), 255)
    = GetWindowText(hWindow, @cBuffer, LEN(cBuffer))
RETURN STRTRAN(cBuffer, CHR(0), "")
 
FUNCTION GetWinRect(hWindow)
    LOCAL cBuffer
    cBuffer = REPLICATE(CHR(0), 16)
    = GetWindowRect(hWindow, @cBuffer)
RETURN cBuffer
 
PROCEDURE decl
    DECLARE INTEGER GetLastError IN kernel32
    DECLARE INTEGER GetDesktopWindow IN user32
 
    DECLARE INTEGER FindWindowEx IN user32;
        INTEGER hwndParent, INTEGER hwndChildAfter,;
        STRING @lpszClass, STRING @lpszWindow
 
    DECLARE INTEGER GetWindowText IN user32;
        INTEGER hWnd, STRING @lpString, INTEGER nMaxCount
 
    DECLARE INTEGER GetWindowRect IN user32;
        INTEGER hWnd, STRING lpRect
 
FUNCTION buf2dword(lcBuffer)
RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ;
    BitLShift(Asc(SUBSTR(lcBuffer, 2,1)),  8) +;
    BitLShift(Asc(SUBSTR(lcBuffer, 3,1)), 16) +;
    BitLShift(Asc(SUBSTR(lcBuffer, 4,1)), 24)
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1681 bytes  
Created: 2001-07-16 12:00:00  
Modified: 2004-12-24 12:04:29  
Visits in 7 days: 110  
Listed functions:
FindWindowEx
GetDesktopWindow
GetLastError
GetWindowRect
GetWindowText
Printer friendly API declarations
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)
3.14 hrs.Example: 'Loading a string resource from an executable file'
3.37 hrs.Example: 'Creating a window using CreateWindowEx function'
 Example: 'Displaying bitmap using the AlphaBlend function'
20.56 hrs.Example: 'Playing WAV sounds simultaneously'
 Function: 'AttachVirtualDisk'
20.7 hrs.Function: 'SetDlgItemInt'
1 day(s)Example: 'How to extract frames from AVI files'
 
Function group: 'Shell Functions'
 Example: 'How to delete IE cookies, clear IE history and delete files in Temporary Internet Files directory'
 Example: 'StrDup returns a pointer to the duplicate of a source VFP string'
Google
Advertise here!