The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Grincheux on November 15, 2005, 05:51:36 PM

Title: Scroll Bars
Post by: Grincheux on November 15, 2005, 05:51:36 PM
Hello, :eek

I have a dialog box with vertical and horizontal scrollbars.
The scrollbars are using for displaying part of loaded image.

When the user resize the dialog box I treat the WM_SIZE message.
During the statement of this message I call EnableScrollBar, ShowScrollBar and SetScrollInfos and it seems it generates
WM_SIZE message too. So the original WM_SIZE message never finished.

How can I set the scroll bars in this case ?

Thanks.
Title: Re: Scroll Bars
Post by: Tedd on November 15, 2005, 06:17:21 PM
Check the "hwnd" of the WM_SIZE message?
Or you may have to use MoveWindow to tell the scrollbar to move/size without generating wm_size messages (not that I'm sure why it's doing that anyway.)
Title: Re: Scroll Bars
Post by: Grincheux on November 15, 2005, 07:01:08 PM
In the WM_SIZE message if I use these functions, it genertaes an other WM_SIZE message.

Here is the code :

push   ESB_DISABLE_BOTH
push   SB_BOTH
push   DWord Ptr [hWnd]
push   OFFSET $ + 10
jmp   EnableScrollBar

after EnableScrollBar, I receive an other WM_SIZE message.

I don't kknow how to do
Title: Re: Scroll Bars
Post by: Grincheux on November 15, 2005, 07:12:51 PM
Do I have to treat the WM_SIZE for resizing nested scroll bars ?

When the user resizes the window do I receive a WM_xSCROLL message ? or the same ?

In this case during the process of this message I use the previous functions ?
Title: Re: Scroll Bars
Post by: Manos on November 15, 2005, 07:38:53 PM
What type of Scrollbars you use ?
System scrollbars or scrollbar controls ?

Manos.
Title: Re: Scroll Bars
Post by: Grincheux on November 15, 2005, 07:41:54 PM
I use system scrollbars.
Title: Re: Scroll Bars
Post by: Manos on November 15, 2005, 07:52:42 PM
When you use system scrollbars,the system automatic resize the scrollbars
and place these in the correct place.
The only think that you have to do is to use: SetScrollInfo in WM_SIZE.

Manos.