Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Scanning a hierarchy of child windows down from the Windows Desktop
The SQLGetProp() creates a bridge between Visual FoxPro and the ODBC API
Converting path to original case
Returning some basic information for the specified INF file
The original LoadPicture() function in VFP returns valid handles to bitmaps, icons, cursors, and metafiles
Using SQLBrowseConnect to connect to a data source through a number of iterative calls (SQL Server)
Using the MessageBox Win32 function
Winsock: how to retrieve the protocol information corresponding to a protocol name
Enumerating print processors and supporting data types installed on the specified server
Extracting the name and extension parts of a path string
How to hide your program from the Close Program dialog (Win9* only)
Validating URLs using moniker functions
Disabling drawing in the VFP form
Retrieving configuration information for the specified server (Win98/Me)
Accessing Windows Control Panel from VFP Application
Converting characters in a URL into corresponding escape sequences and backwards
Creating two-byte hashes for a list of URLs
Finding the path to the VFP executable running
Retrieving window and menu help context identifiers
Simple MAPI: how to resolve a name to unique address list entry
Using the IsWindowEnabled function
Another way to go online (it is not about choosing an ISP)
Copying files as a transacted operation (Vista)
How to display the port-configuration dialog box for a port on the specified server
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: 64  
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-2017 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.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.145.117.60)
20 sec.Banners
30 sec.
Function group: 'Remote Application Programming (RAPI)'
40 sec.Function: 'GdipGetImageWidth'
Function group: 'GDI+ Image'
51 sec.Function: 'waveOutWrite'
Function group: 'Windows Multimedia'
1.02 min.Function: 'GdipRotateMatrix'
Function group: 'GDI+ Matrix'
1.18 min.Function: 'recvfrom'
Function group: 'Windows Sockets 2 (Winsock)'
1.32 min.Function: 'SCardListReaderGroups'
Function group: 'Authentication'
1.48 min.Function: 'FtpPutFile'
Function group: 'Internet Functions (WinInet)'
1.62 min.Function: 'waveInGetNumDevs'
Function group: 'Windows Multimedia'
1.75 min.Example: 'Obtaining names of local and global groups for current user (WinNT/XP/2K)'
Google
Advertise here!