winapi - Undocumented Windows message 0x0313 stabl

2019-08-07 04:06发布

I've found this undocumented windows message, hex code: 0x0313 that's sent when a user right-clicks on the app's taskbar button. Is this stable to use/capture?

4条回答
甜甜的少女心
2楼-- · 2019-08-07 04:51

It has been working for many years so although there is of course no guarantee that it will work in future version it is more likely it will.

查看更多
叛逆
3楼-- · 2019-08-07 04:53

It would be stable to use if you could guarantee that it will work on:

1) All Windows versions currently in use.

2) All Windows versions that will be released during the expected lifetime of your app.

So, no.

查看更多
手持菜刀,她持情操
4楼-- · 2019-08-07 04:57

Undocumented features and messages are subjected to change. You should not rely on that this message is sent in the same way in another version of windows or that the parameters are in the same format.

查看更多
小情绪 Triste *
5楼-- · 2019-08-07 05:00

No guarantees, but in practice it will probably not disappear.

I googled it just to make sure it's not e.g. a documented MFC message.

One result, from http://delphi.about.com/od/vclwriteenhance/a/ttaskbarmenu.htm:

When you right-click on a taskbar button, Windows sends an undocumented message ($0313) to the corresponding application window. The WPARAM is unused (zero) and the LPARAM contains the mouse position in screen coordinates, in the usual format. By default, WindowProc handles this message by popping up the system menu at the given coordinates.

Apparently you can use it to pop up your own custom menu, but before doing that I would use e.g. Spy++ to check whether possibly it generates documented messages that can be processed instead.

查看更多
登录 后发表回答