Defining position and size of Word-window

Defining position and size of Word-window

Postby driessen » Mon Dec 01, 2008 3:57 pm

Hello,

I want to define the position and size of a Word-window out of my application.

I use these functions :

1. To find which is the Word-window :
Code: Select all  Expand view
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)

2. To define the position and the size of the Word-window :
Code: Select all  Expand view
LOCAL cWnd := FindWnd("WORD")

IF !EMPTY(cWnd)

    BringWindowToTop(cWnd)

    cWnd:Top    := US->WORDTOP
    cWnd:Left   := US->WORDLEF
    cWnd:Width  := US->WORDWID
    cWnd:Height := US->WORDHEI

ENDIF


Unfortunately I got an error "No exporterd method : top".

How can I establish the positioning of a Word-window ?

Thanks a lot for any help.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Window TOP, LEFT, BOTTOM, RIGHT

Postby ukoenig » Mon Dec 01, 2008 4:52 pm

Hello,
maybe i'm wrong, but I think You need TOP, LEFT, BOTTOM, RIGHT
something like :

aRect := GETCLIENTRECT( oWnd:hWnd ) ????

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Postby driessen » Mon Dec 01, 2008 9:11 pm

Enrico,

Thanks for your answer.

I tried SetWindowPos() by using this code :
Code: Select all  Expand view
         wWnd := FindWnd("WORD")

         wWnd:Move(US->UWORDTOP,US->UWORDLEF,IF(US->UWORDWID=0,200,US->UWORDWID),IF(US->UWORDHEI=0,200,US->UWORDHEI),.T.)
         SetWindowPos(wWnd,-1,0,0,0,0,3)


But the result is an error : "NUMERIC has nog exported method: MOVE".

What can we do ?

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby Enrico Maria Giordano » Mon Dec 01, 2008 9:44 pm

wWnd is not a FWH TWindow object, it is a window handle. Try using only SetWindowPos().

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

Postby driessen » Mon Dec 01, 2008 11:29 pm

Enrico,

I already tried using SetWindowPos() only, but then nothing happens. The Word-window's sizes haven't been changed.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby Enrico Maria Giordano » Tue Dec 02, 2008 8:06 am

Please, show us a reduced and self-contained sample of how you are calling SetWindowPos().

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

Postby driessen » Tue Dec 02, 2008 8:29 am

Enrico,

I used SetWindowPos() this way :
Code: Select all  Expand view
SetWindowPos(wWnd,-1,US->UWORDTOP,US->UWORDLEF,US->UWORDWID,US->UWORDHEI,3)

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby Enrico Maria Giordano » Tue Dec 02, 2008 8:38 am

1. The first parameter must be the window handle not the window FWH object (wWnd:hWnd).

2. The value for the last parameter you used (3) means:

Code: Select all  Expand view
#define SWP_NOSIZE 1
#define SWP_NOMOVE 2


Try

Code: Select all  Expand view
#define SWP_NOZORDER 4


instead.

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

Postby driessen » Tue Dec 02, 2008 9:27 am

Enrico,

Thanks for your suggestion, but unfortunately no luck.

I used this code :
Code: Select all  Expand view
wWnd := FindWnd("WORD")

SetWindowPos(wWnd:hWnd,-1,US->UWORDTOP,US->UWORDLEF,US->UWORDWID,US->UWORDHEI,4)


I again got the error : "NUMERIC" has no exported method: hWnd.

The function FindWnd() you can find in my first message of this topic.

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby Enrico Maria Giordano » Tue Dec 02, 2008 9:37 am

Sorry, I thought that wWnd was a FWH object. Try:

Code: Select all  Expand view
SetWindowPos(wWnd,-1,US->UWORDTOP,US->UWORDLEF,US->UWORDWID,US->UWORDHEI,4)


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

PROBLEM SOLVED !!!

Postby driessen » Tue Dec 02, 2008 10:38 am

Enrico,

Thank you very, very much.

That works fine now.

You have been a great help.

Have a nice day.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests