开发者

64-bit windows context menu inside 32-bit application (how to traverse owner-drawn menu?)

I want to embed windows 64-bit context menu inside 32-bit application (something like X64 submenu in TotalCommander). To do this I need to simulate 64-bit menu contents at 32-bit side. My idea is to traverse 64-bit menu inside 64-bit helper process, and regenerate such content at 32-bit side (I also tried show such menu directly from 64-bit helper, but windows is surprised to have two context menus, each from different process, and doesn't paint second menu correctly). Tell me if you have other ideas.

I have one problem: some owner-drawn menus show more items than GetMenuItemCount() returns (usually GetMenuItemCount() returns 1 in such case).

Interesting is, that I can use GetMenuItemInfo() for owner-drawn me开发者_运维知识库nu item using item ID (wich is returned from TrackPopupMenuEx()), so such menu can generate proper info for every particular item. But unfortunatelly I cannot use IDs to iterate menu items (item IDs are unordered).

Any ideas?


Not sure how TotalCommand does it. But I found this:

  • Start TOTALCMD.EXE (32-bit process)
  • See that it is running in TaskManager (Keep it running on right/left side, and monitor processes/process-count.
  • Now Launch the menu, the processes are still same.
  • Hover over X64 menu, and you see it takes time. This time when you see in TaskManager, another process named TCMDX64.EXE just started, and this is a 64-bit process.
  • My understanding says that this spawned process gets the menu and sends back to the TotalCommander 32-bit application.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜