| |
|
|
- Page 1 - |
|
Nico Madysa | I have one small Completed: TrayIcos and Kontextmenüs, which I anhand the subesquent Quelltextes aufzeigen wants: CompileMarkSeparation'Fenster und TrayIcon erzeugen
cls
var hIcon& = Create("hIcon","Profan")
TrayIcon("Add", %hWnd, 1, hIcon&, "TrayIcon 11")
var sw% = 0
'Hauptschleife
var e% = 0
whilenot e%
waitinput
if IsKey(27)
e% = 1
elseif (GetActiveWindow() = %hWnd) and (%MouseKey = 2)
'Rechtsklick ins Hauptfenster
'Abbruch des Menüs durch beliebigen Klick
Menu
elseif TrayIcon("Msg", 1) = $204
'Rechtsklick auf dem TrayIcon
'Abbruch des Menüs NUR durch Klick ins Hauptfenster
Menu
endif
wend
'Beenden
TrayIcon("Delete", %hWnd, 1)
DeleteObject hIcon&
end
proc Menu
CreateMenu
AppendMenu 100,"Fenster anzeigen/verbergen"
Separator
AppendMenu 999,"Beenden"
'Programm beenden
case TrackMenu() = 999 : e% = 1'Beenden
'Hauptfenster toggeln
case %MenuItem = 100 : sw% = ShowWindow(%hWnd,sw%)
endproc
If I the Context menu with a Rechtsklick aufrufe, but against any Logik NICHTS select wants, reicht it usually, anywhere To clicking, so the Context menu again disappears.
trouble however: If the Context menu by the TrayIcon created been is, reicht to that Verschwindenlassen no beliebiger Click, separate it must be Context menu or in the Program-Window erfolgen.
This will to that Ärgernis, if, as with Benutzung one TrayIcons possible is, one quite no sichtbares Window available has. then has the User quite no others electoral, as irgendeinen point auszuwählen.
gives it for irgendeinen Workaround or can it itself quite lasting to fix?
love Regards,
Nico |
|
|
| |
|
|
|
« this Posting watts as Solution marked. » |
|
Andreas Miethe
| Probiers time so CompileMarkSeparation'Fenster und TrayIcon erzeugen
Windowstyle 26 + 512
CLS
Var hIcon& = Create("hIcon","Profan")
TrayIcon("Add", %hWnd, 1, hIcon&, "TrayIcon 11")
Var sw% = 0
'Hauptschleife
Var e% = 0
WhileNot e%
WaitInput
If IsKey(27) or (%Key = 2)
Ende()
ElseIf (GetActiveWindow() = %hWnd) and (%MouseKey = 2)
Menu()
ElseIf TrayIcon("Msg", 1) = $204
SetActiveWindow(%hWnd)
Menu()
Endif
EndWhile
End
Proc Ende
TrayIcon("Delete", %hWnd, 1)
DeleteObject hIcon&
End
Endproc
Proc Menu
CreateMenu
AppendMenu 100,"Fenster anzeigen/verbergen"
Separator
AppendMenu 999,"Beenden"
TrackMenu()
If %MenuItem = 100
Messagebox("Fenster verbergen","Hinweis",64)
ElseIf %MenuItem = 999
Ende()
EndIf
../funcion-referencias/XProfan/endproc/'>ENDPROC
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 03/23/12 ▲ |
|
|
|
|
|
RGH | Hi, since the function Trackmenu() now time wait, To one exhaust chosen watts, there none einfachen Workaround. From one Click in that blue get the XProfan-Program nothing with.
an virtually Solution would, a exhaust "Abbruch" or "Menü schließen" einzufügen, so the entscheidungsschwache User then too invulnerable the Menu again leave can.
Greeting Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 03/23/12 ▲ |
|
|
|
|
Andreas Miethe
| Probiers time so CompileMarkSeparation'Fenster und TrayIcon erzeugen
Windowstyle 26 + 512
CLS
Var hIcon& = Create("hIcon","Profan")
TrayIcon("Add", %hWnd, 1, hIcon&, "TrayIcon 11")
Var sw% = 0
'Hauptschleife
Var e% = 0
WhileNot e%
WaitInput
If IsKey(27) or (%Key = 2)
Ende()
ElseIf (GetActiveWindow() = %hWnd) and (%MouseKey = 2)
Menu()
ElseIf TrayIcon("Msg", 1) = $204
SetActiveWindow(%hWnd)
Menu()
Endif
EndWhile
End
Proc Ende
TrayIcon("Delete", %hWnd, 1)
DeleteObject hIcon&
End
Endproc
Proc Menu
CreateMenu
AppendMenu 100,"Fenster anzeigen/verbergen"
Separator
AppendMenu 999,"Beenden"
TrackMenu()
If %MenuItem = 100
Messagebox("Fenster verbergen","Hinweis",64)
ElseIf %MenuItem = 999
Ende()
EndIf
../funcion-referencias/XProfan/endproc/'>ENDPROC
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 03/23/12 ▲ |
|
|
|
|
Nico Madysa | Andreas Miethe (23.03.12)
Probiers time so CompileMarkSeparation'Fenster und TrayIcon erzeugen
Windowstyle 26 + 512
CLS
Var hIcon& = Create("hIcon","Profan")
TrayIcon("Add", %hWnd, 1, hIcon&, "TrayIcon 11")
Var sw% = 0
'Hauptschleife
Var e% = 0
WhileNot e%
WaitInput
If IsKey(27) or (%Key = 2)
Ende()
ElseIf (GetActiveWindow() = %hWnd) and (%MouseKey = 2)
Menu()
ElseIf TrayIcon("Msg", 1) = $204
SetActiveWindow(%hWnd)
Menu()
Endif
EndWhile
End
Proc Ende
TrayIcon("Delete", %hWnd, 1)
DeleteObject hIcon&
End
Endproc
Proc Menu
CreateMenu
AppendMenu 100,"Fenster anzeigen/verbergen"
Separator
AppendMenu 999,"Beenden"
TrackMenu()
If %MenuItem = 100
Messagebox("Fenster verbergen","Hinweis",64)
ElseIf %MenuItem = 999
Ende()
EndIf
../funcion-referencias/XProfan/endproc/'>ENDPROC
an row reicht, very so what have I me desired! thanks, Andreas! |
|
|
| |
|
|