DWORD dwFlags, // flags specifying various function options
DWORD dwExtraInfo // additional data associated with keystroke
);哪个参数是我要输出的字符串....我不太看得懂
要一个字符一个字符模拟。就好比你一个字符一个字符输入一样。也可以用SendKeys类。
可能lz 的思路需要在解析成不同的步骤 1 当前激活的窗体,是系统那个应用程序, [DllImport("user32.dll")] public static extern int GetForegroundWindow(); // 获取激活窗体句柄2 应用程序是否是特定的应用程序 StringBuilder title = new StringBuilder (50); [DllImport("user32.dll")] public static extern int GetWindowText(int hWnd, StringBuilder text, int count); // 获取应用程序的标题到 title3 如果是notepad.exe if (title.ToString().Contains("记事本")) { // 该拷贝的拷贝,发送键盘 ctrl + v 的发送...随意处理 }
能具体告诉我要用哪个API函数吗···谢谢
能具体告诉我要用哪个API函数吗···谢谢
不是告诉你了么。
能具体告诉我要用哪个API函数吗···谢谢
不是告诉你了么。.....但是我看见这个函数好像是
VOID keybd_event(
BYTE bVk, // virtual-key code
BYTE bScan, // hardware scan code
DWORD dwFlags, // flags specifying various function options
DWORD dwExtraInfo // additional data associated with keystroke
);哪个参数是我要输出的字符串....我不太看得懂
1 当前激活的窗体,是系统那个应用程序,
[DllImport("user32.dll")]
public static extern int GetForegroundWindow(); // 获取激活窗体句柄2 应用程序是否是特定的应用程序
StringBuilder title = new StringBuilder (50);
[DllImport("user32.dll")]
public static extern int GetWindowText(int hWnd, StringBuilder text, int count); // 获取应用程序的标题到 title3 如果是notepad.exe
if (title.ToString().Contains("记事本"))
{
// 该拷贝的拷贝,发送键盘 ctrl + v 的发送...随意处理
}
昨天下午写了一个接近这个需求的demo...如果要参考,自己下载
http://download.csdn.net/detail/yanghl1998/5534155