Saludos y buen día
Necesito limitarle al usuario no reducir el tamaño de una ventana MDI.
Agradecido por su Aporte.
#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
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 41 guests