怎么模拟双击文件

wuyizhou359 2010-11-27 02:44:30
我试了一下,用CreateProcess的话,普通文件打得开,但win7下有一些文件时加了盾牌的,这样就打不开。
如果双击那些加盾牌的文件,系统会弹出一个对话框询问要不要打开,但CreateProcess不行,直接罢工。

我试了一下,用运行(Win+R)打开的话,效果跟双击一样,我想问一下这个是什么原理,或者怎么才能达
到双击的效果。
...全文
116 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwwDotFa 2010-12-02
  • 打赏
  • 举报
回复
ShellExecute
haogeai123 2010-12-01
  • 打赏
  • 举报
回复
学习了!mark一下
csx007700 2010-11-27
  • 打赏
  • 举报
回复

UINT SendInput(
UINT nInputs,
LPINPUT pInputs,
int cbSize
);
Parameters
nInputs
Specifies how many structures pInputs points to.
pInputs
Pointer to an array of INPUT structures. Each structure represents an event to be inserted into the keyboard or mouse input stream.
cbSize
Specifies the size of an INPUT structure. If cbSize is not the size of an INPUT structure, the function will fail.
Return Values
The number of events that the function inserted into the keyboard or mouse input stream indicates success. To get extended error information, call GetLastError.



INPUTSee Also
Keyboard Structures | keybd_event | MOUSEINPUT | KEYBDINPUT | mouse_event | SendInput

Requirements
OS Versions: Windows CE 2.0 and later.
Header: Winuser.h.
This structure is used by the SendInput function to synthesize keystrokes, stylus and mouse motions, and button clicks.

typedef struct tagINPUT {
DWORD type;
union {
MOUSEINPUT mi;
KEYBDINPUT ki;
HARDWAREINPUT hi;
};
} INPUT, *PINPUT, FAR* LPINPUT;
Members
type
Indicates the type of device information this structure carries. It is one of the following values. Value Description
INPUT_HARDWARE The hi union member is valid.
INPUT_KEYBOARD The ki union member is valid.
INPUT_MOUSE The mi union member is valid.

mi
MOUSEINPUT structure that contains information about simulated mouse input.
ki
KEYBDINPUT structure that contains information about simulated keyboard input.
hi
HARDWAREINPUT structure that contains information about a simulated input device message.


Msdn里面的,我以前使用过。使用SendInput可以模拟任意鼠标操作,快速SendInput两次就是双击啦。
zgsdzhaolanxiang1 2010-11-27
  • 打赏
  • 举报
回复
学习了。
wuyizhou359 2010-11-27
  • 打赏
  • 举报
回复
哈哈,ShellExecute应该可以。。
sd6814466 2010-11-27
  • 打赏
  • 举报
回复
模拟的话,发送一个双击事件?发到哪儿去就不知道了。。。

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧