Hi , using the code below to help with resizing.
the idea is that if the person resize the window too small it will jump back to the default size.
the problem is when this code does resize the window it always is too short.
can anyone help
thanks Paul
'------------------------------------------------------------------------------------------------------------------------
Function FRONTEND_WM_SIZE ( _
hWndForm As Dword, _ ' handle of Form
fwSizeType As Long, _ ' type of resizing request
nWidth As Long, _ ' new width of client area
nHeight As Long _ ' new height of client area
) As Long
FF_Control_GetSize(hwnd_frontend,nWidth ,nHeight)
If nWidth < 602 Or nheight <530 Then
FF_Control_SetSize(hWnd_frontend,602,530)
End If
End Function
Why bounce the window back, this always creates problems when people try to fight the "bounce", etc...plus your problem which is probably related to sizes of Caption/Titlebar or menu/statusbars.
Look at WM_GETMINMAXINFO this can be used in the CUSTOM of your form and works really nice.
I have example code, but it is on my home machine. It isn't too hard to figure out though. If you are stuck or no one else has code, I'll post it when I get home.
WM_GETMINMAXINFO may even be something Paul could add to the wish list along with the control resizing he has plans on adding...then in form properties we could setup the min and max size values.
In CUSTOM of Form:
Local MMinfo As MINMAXINFO Ptr
Select Case wMsg
Case %WM_GETMINMAXINFO
MMinfo= lParam
@mmInfo.ptMinTrackSize.x= 515
@mmInfo.ptMinTrackSize.y= 515
Sets Min Size to 515x515. I never mess with Max Size or Position...really screws things up when they Maximize or Tile Windows...even Min sizes messes up Tiles if too big.
Thanks for handling this question Roger.
As Roger's post shows, there is nothing in FireFly that can not be handled through the CUSTOM message handler. There is no requirement for the FireFly user to have to use the individual message handlers (e.g. WM_COMMAND, WM_NOTIFY, etc...). You can everything through the CUSTOM handler if you wish - and I believe that Roger does this in his programs.
Yup, I use Create and Destroy Functions in the drop down just because it is easy to seperate things better and to let FF do its cleanup. Everything Else is in Custom. If I have a ListView I use its Custom too that way I can process Keys and Scrolling, etc.
I guess I just like doing everything in one message loop (Probably cause I started designing using Forms and most other things use one loop). Sometimes I split things off if there gets to be too many variables, but it is nice having it all in one function so I can use Statics instead of Globals.
isnt it strange how many of us, try and always solve problems with the tools we have, instead of looking if there is a function/code to do it already.
thanks guys works better than an elephants digestive system