Empty menu
Empty menu
Hello,
It is possible create window with empty menu ?
Regards
Pawel
It is possible create window with empty menu ?
Regards
Pawel
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
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
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Pawel,
Try this:
Please let us know if it works ok.
Try this:
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 ) )
Antonio,
I try and try ... and nothing to change dialog. Maybe my code is wrong ?
When I use GWL_EXSTYLE GetWindowLong () return 0, GWL_STYLE return value <> 0 but dialog is still standard.
Pawel
I try and try ... and nothing to change dialog. Maybe my code is wrong ?
When I use GWL_EXSTYLE GetWindowLong () return 0, GWL_STYLE return value <> 0 but dialog is still standard.
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Pawel,
Its working
Its working
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio,
I found this in BasicDialog sample:
Pawel
I found this in BasicDialog sample:
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;
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio,
I modify SetOkButton with this (empty menu bar):
Dialog is now perfect.
Best regards
Pawel
I modify SetOkButton with this (empty menu bar):
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
Best regards
Pawel
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
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.
How can I get the OK button to close the current WINDOW when using nested windows.
The code in samples\okbutton.prg changes the "X" to an "OK" but nothing happens when I click the "OK"
I am using
Code: Select all
ACTIVATE WINDOW oWnd ON INIT SetOkButton(oWnd:hWnd)