Windows右键单击并在C ++中运行我的程序 [英] windows right click and work my programm in C++

查看:61
本文介绍了Windows右键单击并在C ++中运行我的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个问题.我的第一个问题是,如何右键单击弹出菜单将某些内容放入"默认窗口?我的意思是,如果我在.exe上单击鼠标右键,则会出现默认的内容(例如,剪切,复制,发送至,以...运行),但是我该如何在其中添加一行,例如"MyApp ",这将启动我的应用程序?我想用C ++来做所有这一切.我的第二个问题是,如何从弹出菜单中获取启动MyApp的文件名和文件地址(或完整路径)?

我不是C ++专业人士,需要您的指导...请解释您的方式.

I have two questions. My first one is, that how can i "put" something into the default windows right click pop-up menu? I mean, if i click with the right mouse button on an .exe, then the default things appers(like cut, copy, send to, run as...), but how can i put there one extra line, like "MyApp", which will start my application? I want to do all this in c++. My second question is, how can i get the filename and file adress (or the full path) on which i have started MyApp from the pop-up menu?

I''m not professional in C++ and need your guidance ... please explain your way.

Thank in advance!

推荐答案

您需要的是 Context Menu Shell Extension .
在CodeProject中有关于Shell Extension的优秀文章.

我建议您查看 [第1部分中[第2部分 [ ^ ],您会发现有用的信息. :)
What you need is called Context Menu Shell Extension.
There are excellent articles on Shell Extension in CodeProject.

I recommend you to check out this[^] article series. In Part 1[^] and Part 2[^] you will find very useful information. :)


1.您需要的是 shell扩展,这是将项目添加到Windows资源管理器上下文菜单中的方式.在Codeproject上搜索,您将找到描述此内容的文章.

2.要获取exe的文件路径,请调用Win32函数GetModuleFileName(). MSDN有详细信息.
1. What you want is a shell extension, which is how you add items to the Windows Explorer context menu. Search here on Codeproject and you will find articles describing this.

2. To get the file path of your exe, call the Win32 function GetModuleFileName(). MSDN has details.


这篇关于Windows右键单击并在C ++中运行我的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆