Retrieving all the open windows' titles

Retrieving all the open windows' titles

Postby Mdandrea » Wed Dec 20, 2006 8:37 pm

Good day

I remember seeing somewhere a sample of code that retrieves all the open windows' title text. I just don't remember how to do it or where it was. If anyone has code I would appreciate it.


TIA

MD'Andrea
Mdandrea
 
Posts: 21
Joined: Wed Nov 23, 2005 12:24 am

Re: Retrieving all the open windows' titles

Postby Enrico Maria Giordano » Wed Dec 20, 2006 9:08 pm

Here it is:

Code: Select all  Expand view
#include "Fivewin.ch"


#define GW_HWNDFIRST 0
#define GW_HWNDLAST  1
#define GW_HWNDNEXT  2
#define GW_HWNDPREV  3
#define GW_OWNER     4
#define GW_CHILD     5


FUNCTION MAIN()

    LOCAL hWnd := GETFOREGROUNDWINDOW()

    WHILE hWnd != 0
        IF GETWINDOW( hWnd, GW_OWNER ) = 0 .AND. ISWINDOWVISIBLE( hWnd ) .AND. !EMPTY( GETWINDOWTEXT( hWnd ) )
            ? GETWINDOWTEXT( hWnd )
        ENDIF

        hWnd = GETWINDOW( hWnd, GW_HWNDNEXT )
    ENDDO

    RETURN NIL


DLL32 STATIC FUNCTION GETFOREGROUNDWINDOW() AS LONG;
      PASCAL FROM "GetForegroundWindow" LIB "user32.dll"


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Mdandrea » Fri Dec 22, 2006 2:42 am

Thank you !
Mdandrea
 
Posts: 21
Joined: Wed Nov 23, 2005 12:24 am


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 3 guests