C#API Sendmessage或PostMessage替换SendKeys - 需要帮助 [英] C# API Sendmessage or PostMessage to replace SendKeys - Help Needed

查看:466
本文介绍了C#API Sendmessage或PostMessage替换SendKeys - 需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。


我认为这是一个简单的问题,但我找不到任何对我有帮助的东西。


基本上我有一个应用程序,我想用来控制外部应用程序。我的程序将嵌入在另一个程序中或最小化到系统托盘。所以SendKeys已经出局了,因为它只有在受控应用程序具有焦点时才有效,而不是。


所以我的结论是windows API。我从来没有使用过Windows API,根据我的经验,过去几天我不确定我想要!


所以我这样使用user32.dll(这些不是一成不变的,通过查看其他示例来使用):

Hello everyone.

I have what I believe to be a simple question, yet I can not find anything that is helpful to me.

Basically I have an application, that I want to use to control external applications. My program will run either embedded within another program or minimized to the system tray. So SendKeys is out because it only works if the controlled application has focus, which it will not.

So my conclusion is the windows API. I have never used the windows API, and from my experience the past few days I am not sure I want to!

So I am using user32.dll like this (these are not written in stone and are used by looking at other examples):

展开 | 选择 | Wrap | 行号

推荐答案

任何人? Bueler,bueler?
Anyone? Bueler, bueler?


没有人知道如何通过windows API发送击键?
Doe nobody know how to send keystrokes through the windows API?



任何人? Bueler,bueler?
Anyone? Bueler, bueler?



而不是试图可爱通过制作电影参考,可能只有10%的人在这里看过,为什么不尝试发布到正确的论坛。 .NET论坛是回答C#问题而不是c / c ++论坛的地方。但幸运的是,我对这两个都很温和,可以将这个线程移开。下次更好地关注你正在做的事情。

Instead of trying to be "cute" by making a movie reference that probably only 10% of the people here have seen, why don''t you try posting to the correct forum. The .NET forum is where the C# questions are answered not the c/c++ forum. But lucky for you I moderate both and can move this thread over. Next time pay better attention to what you are doing.


这篇关于C#API Sendmessage或PostMessage替换SendKeys - 需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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