Yes, as far as I know.
EMG
Yes, as far as I know.
EMG
If Me.WindowState = vbMaximized Then
  Me.WindowState = vbNormal
  Me.Height = "5000"
  Me.Width = "5000"
End IfShowWindow( oWnd:hWnd, SW_NORMAL Â )#define GWL_STYLE -16
SetWindowLong(oWnd:hWnd, GWL_STYLE, nOr( GetWindowLong(oWnd:hWnd, GWL_STYLE), WS_MAXIMIZEBOX ))IsIconic( oWnd:hWnd )
IsZoomed( oWnd:hWnd )
If IsZoomed( oWnd:hWnd )
  MsgInfo("Yes, the window is in Maximized state")
  ShowWindow( oWnd:hWnd, SW_NORMAL  )  // Now bring back to normal state
EndifACTIVATE WINDOW oWnd ;
ON RESIZE Test(oWnd)
*---------------------------------------------*
FUNCTION Test(oWnd)
*---------------------------------------------*
If IsZoomed( oWnd:hWnd )
// oWnd:Normal()
oWnd:Restore()
EndifAnser,
If you want that the window does not exceed some specific size then you can use the window DATA aMinMaxInfo.
Please review FWH\samples\TestSize.prg
Dear Mr.Antonio,
DATA aMinMaxInfo is was a very useful information. My requirement was to restrict the window size to a predefined size. Anyway I found the solution for my requirement. I was able to disable the maximize button on a MDICHILD window using the Windows Style.
Regards
Anser
anserkk wrote:Dear Mr.Antonio,
DATA aMinMaxInfo is was a very useful information. My requirement was to restrict the window size to a predefined size. Anyway I found the solution for my requirement. I was able to disable the maximize button on a MDICHILD window using the Windows Style.
Regards
Anser
It is true that we can disable maximize or minimize buttons by simply using clauses NOMAXIMIZE, NOMINIMIZE, etc. while creating the window. But still the user can resize the window by dragging the right bottom corner of the window.
aMinMaxInfo gives us the full control on resizing. ( We can also control with ON RESIZE clause, but that is not elegant )
STYLE nOr( WS_CAPTION, WS_VISIBLE, WS_SYSMENU, WS_MINIMIZEBOX )anserkk wrote:According to me the disadvantage of using aMinMaxInfo is that it requires me to calculate the height and width in pixels. In future, every time I need to alter the window size, I will have to recalculate the height and width again. Whereas using the STYLE, I need not bother about it. I don't use resource editors.
oDlg:aMinMaxInfo  := {oDlg:nWidth,oDlg:nHeight,oDlg:nWidth,oDlg:nHeight,oDlg:nWidth,oDlg:nHeight,oDlg:nWidth,oDlg:nHeight}DEFINE WINDOW oWnd MDICHILD OF WndMain() NOMAXIMIZE
oWnd:aMinMaxInfo := {oWnd:nWidth,oWnd:nHeight,oWnd:nWidth,oWnd:nHeight,oWnd:nWidth,oWnd:nHeight,oWnd:nWidth,oWnd:nHeight}
ACTIVATE WINDOW oWndSTYLE nOr( WS_CAPTION, WS_VISIBLE, WS_SYSMENU, WS_MINIMIZEBOX )try it please
FUNCTION Main()
PUBLIC oApp
RddSetDefault( "DBFCDX" )
SetHandleCount( 100 )
SET DATE FORMAT "dd-mm-yyyy"
SET DELETED ON
SET CENTURY ON
SET EPOCH TO year( date() ) - 20
SET MULTIPLE OFF
SetBalloon( .T. )
IF ISEXERUNNING( CFILENAME( HB_ARGV( 0 ) ) )
MsgAlert(NOME_PROGRAMMA_TITLE+" è già in esecuzione !","Attenzione")
SHOWWINDOW( FINDWINDOW( 0, NOME_PROGRAMMA_TITLE ), 9 )
SETFOREGROUNDWINDOW( FINDWINDOW( 0, NOME_PROGRAMMA_TITLE ) )
RETURN NIL
ENDIF
WITH OBJECT oApp := TApplication():New()
:Activate()
END
RETURN nil