When I call window with menu program don't stop execution after activate clause. Below is sample.
Regards
Pawel
- Code: Select all Expand view RUN
// testmenu.prg
#Include 'FwCe.Ch'
Function TestMenu ()
Local oWnd := Nil
Local oMnu := Nil
Define Menu oMnu Resource 1001
ReDefine MenuItem Id 1011 Of oMnu Action oWnd : End ()
ReDefine MenuItem Id 1021 Of oMnu Action Window1 ()
ReDefine MenuItem Id 1022 Of oMnu Action Window2 ()
Define Window oWnd Title 'Test menu' Menu oMnu
Activate Window oWnd
Return .T.
Function Window1 ()
Local oWnd := Nil
Local oGrp := Nil
Local nGrp := 1
Define Window oWnd Title 'Window1'
@ 5, 5 Group oGrp To 219, 230 Prompt 'Wybierz czynność do wykonania' Pixel
@ 1, 2 Radio nGrp Items 'Archiwizacja danych', 'Weryfikacja tabel', ;
'Reindeksacja tabel', 'Usunięcie tabel', 'Ograniczenie danych', ;
'Pobranie nowej wersji', 'Lista parametrów' Of oGrp Size 150, 15
@ 246, 116 Button 'OK' Pixel Size 60, 20 Action oWnd : End ()
@ 246, 178 Button 'Anuluj' Pixel Size 60, 20 Action oWnd : End ()
Activate Window oWnd On Init EmptyMenu (oWnd : hWnd)
MsgInfo ('Action after activate window')
Return .T.
Function Window2 ()
Local oWnd := Nil
Local oGrp := Nil
Local nGrp := 1
Define Window oWnd Title 'Window2'
@ 5, 5 Group oGrp To 175, 230 Prompt 'Wybierz dane konfiguracyjne' Pixel
@ 1, 2 Radio nGrp Items 'użytkownik', 'o firmie', 'uprawnienia', 'lista magazynów', 'adresy serwerów' Of oGrp Size 160, 15
@ 246, 116 Button 'OK' Pixel Size 60, 20 Action Nil
@ 246, 178 Button 'Anuluj' Pixel Size 60, 20 Action oWnd : End ()
Activate Window oWnd On Init EmptyMenu (oWnd : hWnd)
MsgInfo ('Action after activate window')
Return .T.
#pragma BEGINDUMP
#include <hbapi.h>
#include <hbapirdd.h>
#include <windows.h>
#include <aygshell.h>
HB_FUNC (EMPTYMENU)
{
SHINITDLGINFO shidi;
HWND hWnd = (HWND) hb_parnl (1);
shidi.dwMask = SHIDIM_FLAGS;
shidi.hDlg = hWnd;
shidi.dwFlags = SHIDIF_EMPTYMENU;
SHInitDialog (&shidi);
}
#pragma ENDDUMP
// testmenu.rc
#include "c:\vce\include\arm\windows.h"
#include "c:\vce\include\arm\commctrl.h"
LANGUAGE LANG_POLISH,SUBLANG_DEFAULT
1001 RCDATA
BEGIN
1001, 2
(-2), 10001, 4, 24, 10001, 0, 0
(-2), 10002, 4, 24, 10002, 0, 1
END
1001 MENU
BEGIN
POPUP "File"
BEGIN
MENUITEM "Exit", 1011
END
POPUP "Test"
BEGIN
MENUITEM "Window2", 1022
MENUITEM "Window1", 1021
END
END
STRINGTABLE
BEGIN
10001, "File"
10002, "Test"
END