SHOWWINDOW, SETFOREGROUNDWIND

SHOWWINDOW, SETFOREGROUNDWIND

Postby MarcoBoschi » Fri Mar 03, 2017 3:03 pm

Dear Enrico,
I've found this your code in this group.
Is it possible to set focus too?
This code show window but focus is not activated in program MyWin.
Is it possible?

Bye
Marco


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


FUNCTION MOSTRA()

    LOCAL cTitle := "MyWin"

    SHOWWINDOW( FINDWND( cTitle ), 9 )
    SETFOREGROUNDWINDOW( FINDWND( cTitle ) )

    RETURN NIL


#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 FINDWND( cTitle )

    LOCAL hWnd := GETWINDOW( GETDESKTOPWINDOW(), GW_CHILD )

    WHILE hWnd != 0
        IF UPPER( cTitle ) $ UPPER( GETWINDOWTEXT( hWnd ) )
            RETURN hWnd
        ENDIF

        hWnd = GETWINDOW( hWnd, GW_HWNDNEXT )
    ENDDO

    RETURN NIL
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: SHOWWINDOW, SETFOREGROUNDWIND

Postby MarcoBoschi » Fri Mar 03, 2017 3:31 pm

Enrico,
problem Solved!
Many thanks Again
Marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: SHOWWINDOW, SETFOREGROUNDWIND

Postby vilian » Fri Mar 03, 2017 4:13 pm

How?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Carles and 96 guests