Defining position and size of Word-window

Post Reply
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Defining position and size of Word-window

Post by driessen »

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

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

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Window TOP, LEFT, BOTTOM, RIGHT

Post by ukoenig »

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
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

Enrico,

Thanks for your answer.

I tried SetWindowPos() by using this code :

Code: Select all

      	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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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

EMG
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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

EMG
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

Enrico,

I used SetWindowPos() this way :

Code: Select all

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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

#define SWP_NOSIZE 1
#define SWP_NOMOVE 2
Try

Code: Select all

#define SWP_NOZORDER 4
instead.

EMG
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

Enrico,

Thanks for your suggestion, but unfortunately no luck.

I used this code :

Code: Select all

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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

Code: Select all

SetWindowPos(wWnd,-1,US->UWORDTOP,US->UWORDLEF,US->UWORDWID,US->UWORDHEI,4)
EMG
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

PROBLEM SOLVED !!!

Post by driessen »

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Post Reply