May 09, 2024, 04:23:31 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


@IDSIZE / @IDSIZING

Started by LarryMc, October 28, 2010, 03:20:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

I need to execute some code when a window has been resized.
I know @IDSIZE / @IDSIZING will tell me when a window has been resized or is in the process of being resized.

I need to execute the code after the resizing has been completed and not while it is being resized.
That means I don't want to use @IDSIZING.

MS says @IDSIZE (WM_SIZE) is sent after the window is resized.

The reality is that the @IDSIZE  message is sent multiple times while the window is being resized(dragging a corner)

Does anyone have a slick way of implementing a delay timer to have the code execute after the resizing is indeed over?

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

sapero

October 28, 2010, 03:32:15 PM #1 Last Edit: October 28, 2010, 03:34:14 PM by sapero
Larry, catch WM_EXITSIZEMOVE message. I use it successfully to redraw the right egde of my owner-drawn listbox.
QuoteThe WM_EXITSIZEMOVE message is sent one time to a window, after it has exited 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.

LarryMc

Extract of my code:

case WM_SYSCOMMAND
   if (@wParam & 0xfff0)=SC_CLOSE then return 1
   if (@wParam & 0xfff0)=SC_MOVE then return 1
   if (@wParam & 0xfff0)=SC_MAXIMIZE then return 1
   if (@wParam & 0xfff0)=SC_MINIMIZE then return 1

case WM_SIZE
   print "wmsize"

case WM_EXITSIZEMOVE 
   print "it works"


I'm using the case WM_SYSCOMMAND  to keep the window from being closed,moved, or resized using the max/min buttons.

when I drag the lower right corner of the window I get multiple "wmsize" printed.

I NEVER get an "it works" printed out.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

sapero

Then try with the first message - WM_NCLBUTTONUP, posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. If a window has captured the mouse, this message is not posted.
wParam Specifies the hit-test value HTBORDER, HTCAPTION, HTRIGHT...