开发者

Can I make a context menu entry only appear if an app is running?

Is is possible to have right-mouse-click entries only appear when my application is running? What I am thinking is that I want people to be able to right-click a file in windows explorer and be able to select an entry "Email this file to technical support", but I need my app to be running in order to do that, so I want the entry to disappear when my app isn't running.

I guess the second p开发者_JS百科art of my question is how to implement that function - i.e. how can I get a right-click menu entry click from Windows Explorer recognised and acted on my my app if the app is already running, or will I have to have a minion app that just passes a message to the main app?


A shell context-menu extension can decide whether to create any menu items easily enough. Change your handling of the IContextMenu.QueryContextMenu method accordingly. (Delphi comes with a sample project for context-menu extensions. Start from there if you don't already have one.)

Another option is to keep the menu item visible all the time. If your application isn't running, then have the menu extension start your program first. Why should the user have to worry about what order to do things?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜