English
Source / code snippets

Deaktivieren entire Menu

 

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 
 
09/14/06  
 



me fell there strain yet User32s SetParent  of &hMenu  one - or so one Quarks ebend...
 
09/14/06  
 




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  
 




CompileMarkSeparation
Autor: 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

CompileMarkSeparation
Author: 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
 
09/15/06  
 




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
 
09/15/06  
 




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

 
09/15/06  
 



Nachtrag: look time these Konstanten can You benefit instead of $0401 How supra:
CompileMarkSeparation
MF_APPEND = { $100 | 256 }
MF_BITMAP = { $4 | 4 }
MF_BYCOMMAND = { $0 | 0 }
MF_BYPOSITION = { $400 | 1024 }
MF_CHANGE = { $80 | 128 }
MF_CHECKED = { $8 | 8 }
MF_DEFAULT = { $1000 | 4096 }
MF_DELETE = { $200 | 512 }
MF_DISABLED = { $2 | 2 }
MF_ENABLED = { $0 | 0 }
MF_END = { $80 | 128 }
MF_GRAYED = { $1 | 1 }
MF_HELP = { $4000 | 16384 }
MF_HILITE = { $80 | 128 }
MF_INSERT = { $0 | 0 }
MF_MENUBARBREAK = { $20 | 32 }
MF_MENUBREAK = { $40 | 64 }
MF_MOUSESELECT = { $8000 | 32768 }
MF_OWNERDRAW = { $100 | 256 }
MF_POPUP = { $10 | 16 }
MF_REMOVE = { $1000 | 4096 }
MF_RIGHTJUSTIFY = { $4000 | 16384 }
MF_SEPARATOR = { $800 | 2048 }
MF_STRING = { $0 | 0 }
MF_SYSMENU = { $2000 | 8192 }
MF_UNCHECKED = { $0 | 0 }
MF_UNHILITE = { $0 | 0 }
MF_USECHECKBITMAPS = { $200 | 512 <
olor=#0000FF>}
 
09/15/06  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.268 Views

Untitledvor 0 min.
Gast.081508/28/24
AndreasS12/17/18
E.T.03/03/18
Heltal07/25/14

Themeninformationen

this Topic has 3 subscriber:

iF (6x)
Jac de Lad (3x)
Jörg Sellmeyer (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie