| |
|
|
Jac de Lad | Hello Community,
Gibts a Possibility, the entire, with CreateMenu erstellte Menu at a single blow To deaktivieren? and how can I zwischenrein time quick one other Menu define, that showing should (and subsequently again the first)?
Jac |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 09/14/06 ▲ |
|
|
|
|
| If It's all right then standing it here: [...]
think too on: &hMenu |
|
|
| |
|
|
|
| me fell there strain yet User32s SetParent of &hMenu one - or so one Quarks ebend... |
|
|
| |
|
|
|
Jörg Sellmeyer | Hello Jac, Perhaps helps you the: [...]
or the: [...]
the old Forum is ne real repository! it rewards itself there to search before one asks |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 09/14/06 ▲ |
|
|
|
|
| CompileMarkSeparationAutor: Norbert Spörl (---.dip.t-dialin.net)
Datum: 06.03.03 15:29
DEF EnableMenuItem(3) !"USER32","EnableMenuItem"
DEF GetMenu(1) !"USER32","GetMenu"
cls
declare abbrechen%, cmenu_off%
cmenu_off% = 0
locate 1,1
print "Aktivieren/Deaktivieren des Copyright-Menüs duch Mausklick im Client-Area !"
while (abbrechen% = 0)
waitinput
If (%menuitem = 254)
continue
endif
if (cmenu_off% = 0)
messagebox "... Copyright-Menü ausschalten", "... mit nächstem <OK>", 32
EnableMenuitem(GetMenu(%hwnd), 0, $402)
cmenu_off% = 1
else
messagebox "... Copyright-Menü aktivieren", "... mit Mausklick <OK>", 32
EnableMenuitem(GetMenu(%hwnd), 0, $400)
cmenu_off% = 0
endif
if (%key = 27)
-> Esc-Taste = Abbrechen
abbrechen% = 1
endif
endwhile
end
CompileMarkSeparationAuthor: Sebastian king (---.dip0.t-ipconnect.de)
date: 08.05.03 00:25
graymenu.prf - Hauptmenu complete (de)enable
Author: Sebastian king
email: feedback@sekoenig.de
Homepage: http://www.sekoenig.de
copyright © 2003 Sebastian king
DEF EnableMenuItem(3) !"USER32","EnableMenuItem"
DEF GetMenu(1) !"USER32","GetMenu"
DEF GetMenuItemCount(1) !"USER32","GetMenuItemCount"
DEF DrawMenuBar(1) !"USER32","DrawMenuBar"
declare MY_GRAYED&,MF_BYPOSITION&,MF_ENABLED&
let MY_GRAYED& = $0001
let MF_BYPOSITION& = $0400
let MF_ENABLED& = $0000
proc DisableMainMenu
declare hMenu&,count&,i&
let hMenu& = GetMenu(%hwnd)
let count& = GetMenuItemCount(hMenu&)
let i& = 0
while @lt(i&,count&)
EnableMenuItem(hMenu&,i&,@or(MY_GRAYED&,MF_BYPOSITION&))
let i& = @add(i&,1)
wend
DrawMenuBar(%hwnd)
endproc
proc EnableMainMenu
declare hMenu&,count&,i&
let hMenu& = GetMenu(%hwnd)
let count& = GetMenuItemCount(hMenu&)
let i& = 0
while @lt(i&,count&)
EnableMenuItem(hMenu&,i&,@or(MF_ENABLED&,MF_BYPOSITION&))
let i& = @add(i&,1)
wend
DrawMenuBar(%hwnd)
endproc
---Test:
Cls
PopUp "&Datei"
AppendMenu 100,"..."
PopUp "B&earbeiten"
AppendMenu 200,"..."
PopUp "&Hilfe"
AppendMenu 300,"..."
print "[D] = Deaktivieren / [A] = Aktivieren"
while 1
waitinput
if @KeyIn("Dd")
DisableMainMenu
elseif @KeyIn("Aa")
EnableMainMenu
endif
wend
end
|
|
|
| |
|
|
|
Jac de Lad | I looks with whom whole Quelltexten not through. i will, How said, the whole Menu deaktivieren, means too The Popups, so one too nothing more You can can and it works itself what from, the my I. |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 09/15/06 ▲ |
|
|
|
|
| Try time enable(window|menu) getmenu(%hwnd),0 |
|
|
| |
|
|
|
Jac de Lad | Klappt not (PS: I create the Menu with the DlgMenu.pcu on the %HWnd) |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 09/15/06 ▲ |
|
|
|
|
| look time works: CompileMarkSeparation {$cleq}
$U dlgmenu.pcu = menu.
Def Enablemenuitem(3) !"USER32","EnableMenuItem"
Def Getmenuitemcount(1) !"USER32","GetMenuItemCount"
Def Drawmenubar(1) !"USER32","DrawMenuBar"
declare menu&,dlg&,dlg2&,dlg3&
Cls
windowstyle 4+8
dlg&=CreateWindow(%hwnd,"Dialog mit Menü",0,0,200,200)
dlg2&=CreateWindow(%hwnd,"Dialog2 mit Menü",200,0,200,200)
dlg3&=CreateWindow(%hwnd,"Dialog3 mit Menü",400,0,200,200)
buildmenu %hwnd
buildmenu dlg&
buildmenu dlg2&
buildmenu dlg3&
Whilenot (%key==2)
waitinput
if (abs(%menuitem)==104)
break
endif
Wend
end
proc buildmenu
parameters dlg&
menu&:=menu.new(dlg&)
menu.setNiceBackground
menu.popup "&Datei"
menu.appendmenu 100,"Neu"
menu.appendmenu 101,"Öffnen"
menu.separator
menu.subpopup "Export"
menu.appendmenu 102,"Bitmap"
menu.appendmenu 103,"Vector"
menu.separator
menu.subpopup "Mega-XPort"
menu.appendmenu 105,"Ja"
menu.separator
menu.subpopup "Nein"
menu.appendmenu 105,"Ja"
menu.endsub
menu.appendmenu 101,"Öffnen"
menu.endsub
menu.appendmenu 101,"Öffnen"
menu.endsub
menu.appendmenu 101,"Öffnen"
menu.separator
menu.appendmenu 104,"&Beenden"
menu.popup "&Bearbeiten"
menu.appendmenu 200,"Rückgängig"
menu.separator
menu.appendmenu 201,"Widerherstellen"
menu.popup "&?"
menu.appendmenu 200,"About"
menu.separator
menu.appendmenu 201,"Hilfe"
menu.checkmenu menu&,101,1
menu.enablemenu 102,0
menu.setitemicon menu&,100,"tile.bmp"
declare count&,i&
Let Count& = Getmenuitemcount(menu&)
Let I& = 0
While @Lt(I&,Count&)
Enablemenuitem(menu&,I&,$0401)
Let I& = @Add(I&,1)
Wend
Drawmenubar(%Hwnd)a class=s4 href='./../../function-references/XProfan/endproc/'>endproc
|
|
|
| |
|
|
|
| |
|
| |
|
|