Commit ce1f5c8
authored
Fix the issue of menu click failure caused by excessive menu updates (#77)
1. make the menu identifier never greater than 0xFFFF due to the
WM_COMMAND message only provides an unsigned 16-bit integer menu identifier.
ref:
https://learn.microsoft.com/en-us/windows/win32/menurc/wm-command
2. old menu items are never reused, should delete by DeleteMenu()
instead of RemoveMenu(), DeleteMenu() destroys the handle to
the menu or submenu and frees the memory.
ref:
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-deletemenu
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-removemenu1 parent 2704a97 commit ce1f5c8
2 files changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
144 | | - | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
0 commit comments