Hi,
>>I have tried your suggestion but error occur during compile
You have to include the "#define SC_CLOSE 0xF060" statement
the top of the test prg. That's all
>> I don't know how to apply your 'NOCLOSEDLG" function
Just see the following code. It is called on INIT Clause of the ACTIVATE DIALOG
This is working sample of Mr.Manuel Mercado example.
- Code: Select all Expand view
#include "FiveWin.ch"
#define SC_CLOSE 0xF060
Function Test()
Local oDlg, ;
lExit := .F.,;
oIcon
Define ICON oIcon FILE "C:\FWH\ICONS\FiveWin.Ico"
Define Dialog oDlg Title "Test" ICON oIcon
@ 30, 10 Button "Exit" Of oDlg Size 30, 15 Pixel Action ( lExit := .T., oDlg:End() )
ACTIVATE Dialog oDlg Centered On Init NoCloseDlg( oDlg:hWnd ) ;
Valid lExit
Return Nil
************
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
HB_FUNC ( NOCLOSEDLG ) // ( hWnd )
{
HMENU hMenu = GetSystemMenu( ( HWND ) hb_parnl( 1 ), FALSE ) ;
EnableMenuItem( hMenu, SC_CLOSE, MF_GRAYED ) ;
}
#pragma ENDDUMP