Empty menu
Posted: Sun Nov 06, 2005 7:28 am
Hello,
It is possible create window with empty menu ?
Regards
Pawel
It is possible create window with empty menu ?
Regards
Pawel
www.FiveTechSoft.com
http://forums.fivetechsoft.com/
Code: Select all
ACTIVATE DIALOG oDlg ... ON INIT SetWindowLong( oDlg:hWnd, GWL_EXSTYLE, nOr( GetWindowLong( oDlg:hWnd, GWL_EXSTYLE ), SHIDIF_DONEBUTTON, SHIDIF_SIZEDLGFULLSCREEN, SHCMBF_HIDESIPBUTTON, CMBF_EMPTYBAR ) )
Code: Select all
#define GWL_STYLE (-16)
#define GWL_EXSTYLE (-20)
#define SHIDIM_FLAGS 1 // 0x0001
#define SHIDIF_DONEBUTTON 1 // 0x0001
#define SHIDIF_SIZEDLG 2 // 0x0002
#define SHIDIF_SIZEDLGFULLSCREEN 4 // 0x0004
#define SHIDIF_SIPDOWN 8 // 0x0008
Function TestDialog ()
Local cGet := Space (50)
Define Dialog oDlg Resource 'BasicDialog'
ReDefine Get cGet Id 1 Of oDlg
ReDefine Button Id 2 Of oDlg Action oDlg : End ()
Activate Dialog oDlg On Init ;
SetWindowLong (oDlg : hWnd, GWL_STYLE, ;
nOr (GetWindowLong (oDlg : hWnd, GWL_STYLE), ;
SHIDIF_DONEBUTTON, SHIDIF_SIZEDLGFULLSCREEN))
Return .T.
// rc.file
BASICDIALOG DIALOG DISCARDABLE 0, 0, 160, 168
STYLE WS_POPUP|WS_VISIBLE
FONT 8, "Tahoma"
BEGIN
CONTROL "", 1, "Edit", ES_MULTILINE|WS_BORDER|WS_TABSTOP, 32, 4, 124, 20
CONTROL "OK", 2, "Button", WS_TABSTOP, 116, 148, 40, 12
END
Code: Select all
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT SetOKButton( oDlg:hWnd )
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>
HB_FUNC( SETOKBUTTON )
{
SHINITDLGINFO shidi;
shidi.dwMask = SHIDIM_FLAGS;
shidi.hDlg = ( HWND ) hb_parnl( 1 );
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN;
SHInitDialog( &shidi );
}
#pragma ENDDUMP
Code: Select all
case WM_COMMAND:
// Dialog manager produces IDOK when the done button is tapped
if ((IDOK == LOWORD(wParam)) || (IDCANCEL == LOWORD(wParam)))
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
Code: Select all
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>
HB_FUNC (SETOKBUTTON)
{
HWND hDlg = (HWND) hb_parnl (1);
SHINITDLGINFO shidi;
shidi.dwMask = SHIDIM_FLAGS;
shidi.hDlg = hDlg;
shidi.dwFlags = SHIDIF_DONEBUTTON|SHIDIF_SIZEDLGFULLSCREEN;
SHInitDialog (&shidi);
SHMENUBARINFO mbi;
memset(&mbi, 0, sizeof (SHMENUBARINFO));
mbi.cbSize = sizeof (SHMENUBARINFO);
mbi.hwndParent = hDlg;
// mbi.hInstRes = g_hInst; // ???
mbi.dwFlags = SHCMBF_EMPTYBAR;
SHCreateMenuBar (&mbi);
}
#pragma ENDDUMP
Antonio,Antonio Linares wrote:Pawel,
Its a little more complex than that, but we already got it working
There is a new FWPPC build ready to be downloaded. Please review samples\okbutton.prg working sample to see how to use it.
Code: Select all
ACTIVATE WINDOW oWnd ON INIT SetOkButton(oWnd:hWnd)