Commit 8efc661
refactor: address Copilot review feedback
1. Use MAKELPARAM instead of static_cast for WM_INITMENUPOPUP lParam
to explicitly match the Windows message contract (LOWORD=position,
HIWORD=system menu flag).
2. Add init_popup_lparam parameter to construct_with_hmenu to avoid
sending WM_INITMENUPOPUP twice with conflicting lParam values.
Previously, the submenu lambda sent WM_INITMENUPOPUP with the
correct position index, but then construct_with_hmenu would
immediately resend it with 0xFFFFFFFF, overriding the correct
value. Now the position is passed through the parameter and sent
only once inside construct_with_hmenu.1 parent 43f8da3 commit 8efc661
File tree
2 files changed
+7
-10
lines changed2 files changed
+7
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | | - | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | 184 | | |
187 | | - | |
| 185 | + | |
| 186 | + | |
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 23 | | |
27 | | - | |
| 24 | + | |
| 25 | + | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| |||
0 commit comments