Hello,
It is possible create window with empty menu ?
Regards
Pawel
Hello,
It is possible create window with empty menu ?
Regards
Pawel
Pawel,
Do you mean a menu with no menuitems ?
If so, whats its purpouse ?
Antonio,
This window is dialog. I found in eVc BasicDialog sample. Dialog is paint on full screen and have empty menu. This dialog looks very well. Right corner show Ok buttton vs standard X button.
Dialog on init use SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN and SHCMBF_HIDESIPBUTTON | SHCMBF_EMPTYBAR define but I don't know how send this message to init dialog procedure.
Pawel
ACTIVATE DIALOG oDlg ... ON INIT SetWindowLong( oDlg:hWnd, GWL_EXSTYLE, nOr( GetWindowLong( oDlg:hWnd, GWL_EXSTYLE ), SHIDIF_DONEBUTTON, SHIDIF_SIZEDLGFULLSCREEN, SHCMBF_HIDESIPBUTTON, CMBF_EMPTYBAR ) )#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
ENDPawel,
Try to use those defines in the RC file:
STYLE WS_POPUP | WS_VISIBLE | SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN
...
Tested it here. It does not work.
We may search on google for a C sample that uses SHIDIF_DONEBUTTON
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 ENDDUMPAntonio,
thanks so much
Pawel
Pawel,
Still we need to know what command generates the click of the OK at the right top corner.
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;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.
#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 ENDDUMPPawel,
Very good ![]()
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.
ACTIVATE WINDOW oWnd ON INIT SetOkButton(oWnd:hWnd)