Michael Hagl
unread,Dec 1, 2021, 2:09:15 AM12/1/21You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi Scott,
try this:
#PRAGMA BEGINDUMP
#include "hbapi.h"
#include "Windows.h"
HB_FUNC( SETCONSOLETITLE )
{
hb_retl( SetConsoleTitle( hb_parc(1) ) );
}
HB_FUNC( FINDWINDOW )
{
hb_retnl( (LONG)FindWindow( NULL, hb_parc(1) ) ) ;
}
HB_FUNC( DELETECLOSEBUTTON )
{
DeleteMenu(GetSystemMenu( (HWND)hb_parnl( 1 ), FALSE),
SC_CLOSE,
MF_BYCOMMAND ) ;
DrawMenuBar( (HWND)hb_parnl( 1 ) );
}
HB_FUNC( ENABLECLOSEBUTTON )
{
DeleteMenu(GetSystemMenu( (HWND)hb_parnl( 1 ), TRUE),
SC_CLOSE,
MF_BYCOMMAND ) ;
DrawMenuBar( (HWND)hb_parnl( 1 ) );
}
HB_FUNC( SETFOREGROUNDWINDOW )
{
hb_retnl( SetForegroundWindow((HWND)hb_parnl( 1 )));
}
HB_FUNC( SENDMAXMESSAGE )
{
HWND hWnd;
BOOL nRtn = 1;
//---get handle to the window
hWnd = GetForegroundWindow();
//---tell the window to maximize iteself. won't be
// true "full-screen" but it's the best we can do
// and does not require any user action.
SendMessage( hWnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0 );
hb_retni( nRtn );
}
#PRAGMA ENDDUMP