Als je alles minimaliseert (Windows toets + M) en daarna doorTABt totdat je je focus krijgt in je systray (bijvoorbeeld volumeregeling-icoontje), kun je via SHIFT+F10 toegang krijgen tot het Popupmenu van de desbetreffende applicatie.
Je kunt dan met de pijltjestoetsen navigeren door het menu.
Dat lukt bij mijn applicatie dus niet.
Ik kan alleen via de rechtermuistoets toegang krijgen tot mijn Popupmenu.
Ik wil dus ook met toetsen door het menu kunnen navigeren, alleen heb ik geen idee hoe ik dat erin moet programmeren.
Iemand een idee?
Dit is de code die ik tot nu toe heb:
Je kunt dan met de pijltjestoetsen navigeren door het menu.
Dat lukt bij mijn applicatie dus niet.
Ik kan alleen via de rechtermuistoets toegang krijgen tot mijn Popupmenu.
Ik wil dus ook met toetsen door het menu kunnen navigeren, alleen heb ik geen idee hoe ik dat erin moet programmeren.
Iemand een idee?
Dit is de code die ik tot nu toe heb:
Visual Basic 6:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
| '--------------------------------------------------- ' FORM1 '--------------------------------------------------- Option Explicit Private Sub Command1_Click() ' onnodige code verwijderd... End Sub Private Sub Command2_Click() ' onnodige code verwijderd... End Sub Private Sub Form_Load() ' IconData.hwnd mag ook handle van ander form zijn (bijv. speciaal icon-form) With IconData .cbSize = Len(IconData) ' The length of the NOTIFYICONDATA type .hIcon = Me.Icon ' A reference to the form's icon .hwnd = Me.hwnd ' hWnd of the form .szTip = "Mijn Tool" & Chr(0) .uCallbackMessage = WM_MOUSEMOVE .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE ' .uID = vbNull End With End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim Msg As Long Msg = X ' Form ScaleMode property = 3 - pixels in order to get the correct message If Msg = WM_LBUTTONDBLCLK Then ' The user has double-clicked your icon Call mnuShow_Click ' Show the window ElseIf Msg = WM_RBUTTONDOWN Then ' Right-click PopupMenu mnuPopup, , , , mnuShow ' Popup the menu End If End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If UnloadMode = vbFormControlMenu Then ' Via ALT+F4 en kruisje controlbox Cancel = 1 Me.WindowState = vbMinimized Call Shell_NotifyIcon(NIM_ADD, IconData) Me.Hide End If End Sub Private Sub Form_Resize() If Me.WindowState = 1 Then ' minimized Call Shell_NotifyIcon(NIM_ADD, IconData) Me.Hide End If End Sub Private Sub Form_Unload(Cancel As Integer) Shell_NotifyIcon NIM_DELETE, IconData End Sub Private Sub mnuExit_Click() ' mnuPopup -> mnuExit Unload Me ' End ' Just to be sure the program has ended End Sub Private Sub mnuShow_Click() ' mnuPopup -> mnuShow Me.WindowState = vbNormal Shell_NotifyIcon NIM_DELETE, IconData Me.Show End Sub '--------------------------------------------------- 'Module1.bas '--------------------------------------------------- Option Explicit Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" ( _ ByVal dwMessage As Long, _ lpData As NOTIFYICONDATA _ ) As Long Public Const NIM_ADD = &H0 Public Const NIM_DELETE = &H2 Public Const NIM_MODIFY = &H1 Public Const NIF_ICON = &H2 Public Const NIF_MESSAGE = &H1 Public Const NIF_TIP = &H4 Public Const WM_LBUTTONDBLCLK = &H203 Public Const WM_LBUTTONDOWN = &H201 Public Const WM_LBUTTONUP = &H202 Public Const WM_MOUSEMOVE = &H200 Public Const WM_RBUTTONDBLCLK = &H206 Public Const WM_RBUTTONDOWN = &H204 Public Const WM_RBUTTONUP = &H205 Type NOTIFYICONDATA cbSize As Long hwnd As Long uID As Long uFlags As Long uCallbackMessage As Long hIcon As Long szTip As String * 64 End Type Public IconData As NOTIFYICONDATA |