sendmessage

Getting a Button handle from another application

心已入冬 提交于 2021-01-27 04:12:10
问题 I have a program that needs to send the BM_CLICK message to another applications button. I can get the parent window handle but when I try to get the button handle if always returns 0 I got the button caption name and button type from Spy++ it seems right but I know I must have gotten something wrong. below is my code public const Int BM_CLICK = 0x00F5; [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern IntPtr SendMessage(IntPtr hwnd, uint Msg, IntPtr

C# to C++ CopyData API

…衆ロ難τιáo~ 提交于 2021-01-07 02:39:43
问题 I am developing an automation interface program and I looking to enhance capability with a machine software which uses a COPYDATA API aimed at C++. The goal is to control and report status of the machine through my own software. The method uses pointers and memory allocation which I have not had any experience with thus far. I have looked at a number of other sources, such as this with no luck at the moment. I have tried the following code to try and run a program on the machine software.

C# to C++ CopyData API

 ̄綄美尐妖づ 提交于 2021-01-07 02:38:45
问题 I am developing an automation interface program and I looking to enhance capability with a machine software which uses a COPYDATA API aimed at C++. The goal is to control and report status of the machine through my own software. The method uses pointers and memory allocation which I have not had any experience with thus far. I have looked at a number of other sources, such as this with no luck at the moment. I have tried the following code to try and run a program on the machine software.

C# to C++ CopyData API

笑着哭i 提交于 2021-01-07 02:38:07
问题 I am developing an automation interface program and I looking to enhance capability with a machine software which uses a COPYDATA API aimed at C++. The goal is to control and report status of the machine through my own software. The method uses pointers and memory allocation which I have not had any experience with thus far. I have looked at a number of other sources, such as this with no luck at the moment. I have tried the following code to try and run a program on the machine software.

How to use Win32API SendMessage to change Save Dialog File Location?

蓝咒 提交于 2020-08-25 07:25:27
问题 I am writing a program that automates saving data to a specific location, based on the common Save/Save As dialog. There are two attacking approaches. Both approaches require monitoring handles for messages under Spyxx (so essentially we are trying to replicate the SendMessage) The first approach to set the File Name with target path, using Win32 SendMessage API. The HWnd in this case is the Edit field next to the File name. [DllImport("user32.dll")] public static extern IntPtr SendMessage

How to send Ctrl/Shift/Alt + Key combinations to an application window? (via SendMessage)

无人久伴 提交于 2020-07-17 09:59:10
问题 I can successfully send any single key message to an application, but I don't know how to send combinations of keys (like Ctrl + F12 , Shift + F1 , Ctrl + R , etc..) Tried doing it this way: SendMessage(handle, WM_KEYDOWN, Keys.Control, 0); SendMessage(handle, WM_KEYDOWN, Keys.F12, 0); SendMessage(handle, WM_KEYUP, Keys.F12, 0); SendMessage(handle, WM_KEYUP, Keys.Control, 0); but this does not seems to work (application acts like only F12 is pressed, not Ctrl + F12 ). Any ideas how to make

How to send message from Website To Telegram APP

[亡魂溺海] 提交于 2020-06-25 04:18:05
问题 I have a share button in my website and I want to send a specific message to Telegram APP contacts (when I open website in Mobile) The Problem is I didnt find the complete code and it just open the APP in the mobile my code is : <a href="tg://" id="telegram_share" class="mobileShare" title="inviteFriends" alt="telegram_share"></a> as you see I didnt find proper command for sending message in href property for example I found something simillar for adding sticker like : <a class="tgme_action

Delphi: application running as admin does not receive messages from non-admin app

ε祈祈猫儿з 提交于 2020-03-05 04:05:45
问题 I want to send messages to another application, using SendMessage/PostMessage, but when the other app is running as admin it never receives the messages. How can I overcome this without running the "sending" app as admin? EDIT: code for Remi's answer, receiver app Const dummyValue = WM_USER + 71423; Application.HookMainWindow(AppClass.AppHookFunc); ChangeWindowMessageFilter(dummyValue, MSGFLT_ADD); Type TAppClass = class function AppHookFunc(var Message : TMessage): Boolean; end; Var AppClass

Delphi: application running as admin does not receive messages from non-admin app

做~自己de王妃 提交于 2020-03-05 04:05:00
问题 I want to send messages to another application, using SendMessage/PostMessage, but when the other app is running as admin it never receives the messages. How can I overcome this without running the "sending" app as admin? EDIT: code for Remi's answer, receiver app Const dummyValue = WM_USER + 71423; Application.HookMainWindow(AppClass.AppHookFunc); ChangeWindowMessageFilter(dummyValue, MSGFLT_ADD); Type TAppClass = class function AppHookFunc(var Message : TMessage): Boolean; end; Var AppClass

c# 进程间通信

只谈情不闲聊 提交于 2020-03-04 05:47:34
一、 进程间通讯的方式 进程间通讯的方式有很多,常用的有共享内存(内存映射文件、共享内存DLL、剪切板等)、命名管道和匿名管道、发送消息等几种方法来直接完成,另外还可以通过 socket 口、配置文件和注册表 等来间接实现进程 间数据 通讯任务。以上这几种方法各有优缺点,具体到在进程间进行大数据量数据的快速交换问题上,则可以排除使用配置文件和注册表的方法;另外,由于管道和 socket 套接字的使用需要有网卡的支持,因此也可以不予考虑。这样,可供选择的通讯方式只剩下共享内存和发送消息两种。 二、 发送消息实现 进程间通讯前准备 下面的例子用到一个windows api 32函数 [DllImport("User32.dll", EntryPoint = "SendMessage")] private static extern int SendMessage(IntPtr wnd,int msg,IntPtr wP,IntPtr lP); 要有此函数,需要添加using System.Runtime.InteropServices;命名空间 此方法各个参数表示的意义 wnd:接收消息的窗口的句柄。如果此参数为HWND_BROADCAST,则消息将被发送到系统中所有顶层窗口,包括无效或不可见的非自身拥有的窗口、被覆盖的窗口和弹出式窗口,但消息不被发送到子窗口。 msg