Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Resize begin and End

97 views
Skip to first unread message

Meelis Lilbok

unread,
Sep 28, 2009, 1:41:49 PM9/28/09
to

Hi

Is it possible subclass or catch VB6 form Resize Begin and resize End
"events"?

BR;
Mex

Karl E. Peterson

unread,
Sep 28, 2009, 3:19:45 PM9/28/09
to
Meelis Lilbok wrote:
> Is it possible subclass or catch VB6 form Resize Begin and resize End
> "events"?

Yes. Watch for (the first) WM_SIZING and WM_SIZE.

If subclassing itself is the issue, see: http://vb.mvps.org/samples/HookXP
--
.NET: It's About Trust!
http://vfred.mvps.org


Meelis Lilbok

unread,
Sep 29, 2009, 1:55:06 AM9/29/09
to
Hi Karl

Yes i already found about WM_SIZING and WM_SIZE, sublassing is working fine
but...

1) I never get WM_SIZING notification
2) Using WM_SIZE i can get resize begin, but how to find out, when user ends
resizing window?

BR;
Mex

"Karl E. Peterson" <ka...@exmvps.org> kirjutas s�numis news:
eGOvkCHQ...@TK2MSFTNGP06.phx.gbl...

Dee Earley

unread,
Sep 29, 2009, 4:15:12 AM9/29/09
to
On 29/09/2009 06:55, Meelis Lilbok wrote:
> Hi Karl
>
> Yes i already found about WM_SIZING and WM_SIZE, sublassing is working
> fine but...
>
> 1) I never get WM_SIZING notification
> 2) Using WM_SIZE i can get resize begin, but how to find out, when user
> ends resizing window?

WM_SIZE is when it has finished (and during dragging if configured to do
so) and you should resize the window contents.
WM_SIZING is also sent during resizing so your code can check if the
size is ok.

There is no explicit start or end, but wm_size is the closest.

See the MSDN pages for (much) more information.


--
Dee Earley (dee.e...@icode.co.uk)
i-Catcher Development Team

iCode Systems

Nobody

unread,
Sep 29, 2009, 5:16:47 AM9/29/09
to
"Meelis Lilbok" <meelis...@deltmar.ee> wrote in message
news:6E775BB6-4D8A-4ED5...@microsoft.com...

> Hi
>
> Is it possible subclass or catch VB6 form Resize Begin and resize End
> "events"?

Why do you need to do this? Maybe there is another way to accomplish what
you are trying to do.


Meelis Lilbok

unread,
Sep 29, 2009, 7:45:19 AM9/29/09
to
Ok ill try to explain

On my form i have a unicodelistview, this listview is resized to "fill"
entire form.
Columns widths are calculated dynamically and relative to column
headers.(analogue to .NET DataGridView AutoSizeColumnsMode - Fill)
When i add manifest file to my application and listview contains many rows,
then sometimes resizing is veeery slow and flickering.
My idea was;
1) Cacth when the user begins to resize form
2) Stop dynamic colwidth calculaton
3) when user ends resizing, then calculate col. widths


sry about my poor english :)


Meelis

"Nobody" <nob...@nobody.com> kirjutas s�numis news:
uQ2RXWOQ...@TK2MSFTNGP05.phx.gbl...

Dee Earley

unread,
Sep 29, 2009, 7:56:13 AM9/29/09
to
On 29/09/2009 12:45, Meelis Lilbok wrote:
> Ok ill try to explain
>
> On my form i have a unicodelistview, this listview is resized to "fill"
> entire form.
> Columns widths are calculated dynamically and relative to column
> headers.(analogue to .NET DataGridView AutoSizeColumnsMode - Fill)
> When i add manifest file to my application and listview contains many
> rows, then sometimes resizing is veeery slow and flickering.
> My idea was;
> 1) Cacth when the user begins to resize form
> 2) Stop dynamic colwidth calculaton
> 3) when user ends resizing, then calculate col. widths

You could ignore the users preference (resize contents while resizing is
an option) and set a timer in wm_size, kill and set it again in all
subsequent attempts, then in the timer callback, do the column calculation.
This means column calculations will always be Xms after they stopped
resizing it.

Wolfgang Enzinger

unread,
Sep 29, 2009, 10:00:26 AM9/29/09
to
On Tue, 29 Sep 2009 14:45:19 +0300, Meelis Lilbok wrote:

>My idea was;
>1) Cacth when the user begins to resize form
>2) Stop dynamic colwidth calculaton
>3) when user ends resizing, then calculate col. widths

This might help:

Const WM_ENTERSIZEMOVE& = &H231
Const WM_EXITSIZEMOVE& = &H232

Wolfgang

Karl E. Peterson

unread,
Sep 29, 2009, 12:13:42 PM9/29/09
to

Bingo. Them's the ones.

Meelis Lilbok

unread,
Sep 29, 2009, 12:47:29 PM9/29/09
to
Hi and thnx to all , now i have next problem.
What i did not mention in my first posting is, this listview is on
usercontrol and is created with CreateWindowEx API and then subclassed.

I can read from MSDN about WM_ENTERSIZEMOVE

The WM_ENTERSIZEMOVE message is sent one time to a window after it enters
the moving or sizing modal loop. The window enters the moving or sizing
modal loop when the user clicks the window's title bar or sizing border, or
when the window passes the WM_SYSCOMMAND message to the DefWindowProc
function and the wParam parameter of the message specifies the SC_MOVE or
SC_SIZE value. The operation is complete when DefWindowProc returns.

is this the reason why dont get WM_ENTERSIZEMOVE,because user is not sizing
listview but usercontol on what this listview is created?


Meelis

"Meelis Lilbok" <meelis...@deltmar.ee> kirjutas sļæ½numis news:
6E775BB6-4D8A-4ED5...@microsoft.com...

Karl E. Peterson

unread,
Sep 29, 2009, 1:21:33 PM9/29/09
to
Meelis Lilbok wrote:
> is this the reason why dont get WM_ENTERSIZEMOVE,because user is not sizing
> listview but usercontol on what this listview is created?

What window are you subclassing?

That message is going to go to the form; not the listview, not the usercontrol.

Meelis Lilbok

unread,
Sep 29, 2009, 1:36:42 PM9/29/09
to
Im sublassing the listview (created with CreateWindowEx)

But i think this problem is not related to resizing.

I tested it with XP, Vista and Win 7.
Problem is only with Vista and Win7.
When i remove manifest file then it works normally with Vista and 7 too.
With XP everything works fine with manifest too.

Meelis

"Karl E. Peterson" <ka...@exmvps.org> kirjutas s�numis news:

#VZkLlSQ...@TK2MSFTNGP06.phx.gbl...

0 new messages