Page 1 of 1
Limitar el Resize de Ventana MDI
Posted: Tue Sep 29, 2020 12:25 pm
by jnavas
Saludos y buen día
Necesito limitarle al usuario no reducir el tamaño de una ventana MDI.
Agradecido por su Aporte.
Re: Limitar el Resize de Ventana MDI
Posted: Tue Sep 29, 2020 12:49 pm
by karinha
Re: Limitar el Resize de Ventana MDI
Posted: Tue Sep 29, 2020 6:35 pm
by jnavas
Saludos
La ventana se crea maximizada, si el usuario la reduce se distorsiona el control TGRAPH, por esto necesito controlar o liminar bResized
Re: Limitar el Resize de Ventana MDI
Posted: Tue Sep 29, 2020 6:44 pm
by karinha
Re: Limitar el Resize de Ventana MDI
Posted: Tue Sep 29, 2020 6:47 pm
by jnavas
Saludos,
Presentacion de la Grafica
Redefinir la ventana
Re: Limitar el Resize de Ventana MDI
Posted: Tue Sep 29, 2020 6:49 pm
by jnavas
Re: Limitar el Resize de Ventana MDI
Posted: Tue Sep 29, 2020 6:54 pm
by jnavas
Re: Limitar el Resize de Ventana MDI
Posted: Tue Sep 29, 2020 8:07 pm
by Cgallegoa
Juan, jugando con SysMenu en MDI y MDICHILD:
Code: Select all
#include "FiveWin.ch"
Function Mains()
LOCAL ownd, oMenu
MENU oMenu
MENUITEM "1. No Minimize" ACTION Window2( oWnd , 1)
MENUITEM "2. No Maximize" ACTION Window2( oWnd , 2)
MENUITEM "3. No Close" ACTION Window2( oWnd , 3)
MENUITEM "4. No All" ACTION Window2( oWnd , 4)
MENUITEM "&Exit" ACTION oWnd:End()
ENDMENU
DEFINE WINDOW oWnd TITLE "MDI (No Minimize)" MDI MENU oMenu
WndCenter(oWnd:hWnd)
ACTIVATE WINDOW oWnd ON INIT ( QUITA_BTMENU( oWnd:hWnd , 1 ) , SysRefresh() )
Return(NIL)
Function Window2( oWnd , nOpc )
LOCAL oWin, oMenu
MENU oMenu
MENUITEM "&Exit MDIChild" ACTION oWin:End()
ENDMENU
DEFINE WINDOW oWin TITLE "Opción: "+Str(nOpc) MDI MENU oMenu
ACTIVATE WINDOW oWin ON INIT ( QUITA_BTMENU( oWnd:oWndClient:hWnd , nOpc ) , SysRefresh() )
Return(NIL)
#pragma BEGINDUMP
#include <Windows.h>
#include <wininet.h>
#include <hbapi.h>
HB_FUNC(QUITA_BTMENU)
{
// HMENU MenuH = GetSystemMenu(( HWND ) hb_parnl( 1 ),FALSE);
HMENU MenuH = GetSystemMenu(GetForegroundWindow(),FALSE);
INT lMenu = hb_parnl( 2 );
if ( lMenu == 1 ){
DeleteMenu(MenuH, SC_MINIMIZE, MF_BYCOMMAND);
EnableMenuItem(MenuH, SC_MINIMIZE, MF_GRAYED);
}
else if ( lMenu == 2 ){
DeleteMenu(MenuH, SC_MAXIMIZE, MF_BYCOMMAND);
EnableMenuItem(MenuH,SC_MAXIMIZE,MF_GRAYED);
}
else if ( lMenu == 3 ){
DeleteMenu(MenuH, SC_CLOSE, MF_BYCOMMAND);
EnableMenuItem(MenuH,SC_CLOSE,MF_GRAYED);
}
else {
DeleteMenu(MenuH, SC_MINIMIZE, MF_BYCOMMAND);
EnableMenuItem(MenuH, SC_MINIMIZE, MF_GRAYED);
DeleteMenu(MenuH, SC_MAXIMIZE, MF_BYCOMMAND);
EnableMenuItem(MenuH,SC_MAXIMIZE,MF_GRAYED);
DeleteMenu(MenuH, SC_CLOSE, MF_BYCOMMAND);
EnableMenuItem(MenuH,SC_CLOSE,MF_GRAYED);
}
}
#pragma ENDDUMP
Re: Limitar el Resize de Ventana MDI
Posted: Tue Sep 29, 2020 11:54 pm
by cnavarro