Prevent box resize

Started by erezpaz, January 28, 2017, 08:13:28 AM

Previous topic - Next topic

erezpaz

Hi

I create a box with information and want to prevent users from changing the size of it with the mouse (drag one of the corners).

BoxesUp("200, 200, 800, 800", @NORMAL)

Can you help?
Thanks

td

This  works on the main box.  You would need to get the window handle of any secondary boxes before calling the UDF on one.

Code (winbatch) Select
#definefunction RemoveWindowStyle(hWnd, nStyle)
   hUser32 = DllLoad('user32.dll')
   GWL_STYLE = -16 ; Offset for the Window Style value.
   nCurStyle = dllcall(hUser32,long:"GetWindowLongA",long:hWnd,long:GWL_STYLE)
   nCurStyle &= (~nStyle)
   nResult   = dllcall(hUser32,long:"SetWindowLongA",long:hWnd,long:GWL_STYLE,long:nCurStyle)
   DllFree(hUser32)
   return nResult
#endfunction


nStyle = 262144 ; Thick frame style
BoxesUp("200, 200, 800, 800", @NORMAL)
hBox = DllHwnd("")
RemoveWindowStyle(hBox, nStyle)
TimeDelay(5)


"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade