如何以编程方式双击桌面图标? [英] How to double click desktop icon programatically?

查看:112
本文介绍了如何以编程方式双击桌面图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一些将双击桌面快捷方式的代码.或另一种方法是,如何使用Createprocess() API运行桌面shurtcut.

I want to write some code which will double-click a desktop shortcut. Or the alternate way is, how can I run a desktop shurtcut using Createprocess() API.

哪个EXE负责启动开始"->运行"窗口?

Which EXE is responsible to launch Start->Run window?

预先感谢.

推荐答案

birajendu写道:
birajendu wrote:

我想编写一些代码,将双击桌面快捷方式.或替代方法是如何使用Createprocess()api运行桌面shurtcut.

I want to write some code which will double click a desktop shortcut. or the alternate way is how can i run a desktop shurtcut using Createprocess() api.



如果您知道桌面快捷方式的路径,则应该能够使用ShellExecute来打开它.如果需要进程句柄(我认为可能要为此使用CreateProcess的唯一原因),则ShellExecuteEx将允许您执行此操作.



If you know the path to the desktop shortcut, then you should be able to use ShellExecute to open it. If you need a process handle (the only reason I can think that you might want to use CreateProcess for this), then ShellExecuteEx will let you do that.

birajendu写道:
birajendu wrote:

哪个exe文件负责午餐开始"->运行"窗口?

Which exe is responsible to lunch Start->Run window?



Windows资源管理器.



Windows Explorer.


不要通过模拟用户的行为(例如双击快捷方式)来启动进程.您永远都不知道快捷方式所指向的是什么!

Don''t start processes by simulating behaviors of the user, such as double clicking shortcuts. You never know what the shortcut points to!

此外,精神错乱一直存在.或早或晚,您将通过在开始菜单上模拟鼠标单击来打开控制面板小程序.

Also, insanity lives down that road. Sooner or later you''ll be opening the control panel applet by simulating mouse clicks on the start menu...


此问题没有得到解决. Windows资源管理器(explorer.exe)确实是负责任的,但是如何能像用户双击应用程序的图标一样有问题地调用它呢?
This question is not answered. Windows Explorer (explorer.exe) is indeed responsible, but how can one call it problematically as if the user double clicked an application''s icon?


这篇关于如何以编程方式双击桌面图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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