wm-copydata

Is it safe to use LPCTSTR in a structure with the WM_COPYDATA message?

谁说我不能喝 提交于 2021-02-19 08:37:05
问题 I have this structure: typedef struct tagCOPY_PACKET { TCHAR szFile[_MAX_PATH]; GUID guidSignature; } S_COPY_PACKET; I prepare to send data with WM_COPYDATA like this: CString strFile = GetFileToOpenFromFileExplorerPath(); S_COPY_PACKET sCopyDataPacket; _tcscpy_s(sCopyDataPacket.szFile, _MAX_PATH, strFile); sCopyDataPacket.guidSignature = CopyData_Signature; COPYDATASTRUCT cds; cds.dwData = COPYDATA_TYPE_MSA; cds.cbData = sizeof(sCopyDataPacket); cds.lpData = &sCopyDataPacket; DWORD_PTR

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.

Delphi - Message pump in thread not receiving WM_COPYDATA messages

感情迁移 提交于 2019-12-13 02:06:42
问题 I'm trying (in D7) to set up a thread with a message pump, which eventually I want to transplant into a DLL. Here's the relevant/non-trivial parts of my code: const WM_Action1 = WM_User + 1; scThreadClassName = 'MyThreadClass'; type TThreadCreatorForm = class; TWndThread = class(TThread) private FTitle: String; FWnd: HWND; FWndClass: WNDCLASS; FCreator : TForm; procedure HandleAction1; protected procedure Execute; override; public constructor Create(ACreator: TForm; const Title: String); end;

Thread message loop for a thread with a hidden window?

青春壹個敷衍的年華 提交于 2019-12-09 12:35:49
问题 I have a Delphi 6 application that has a thread dedicated to communicating with a foreign application that uses SendMessage() and WM_COPYDATA messages to interface with external programs. Therefore, I create a hidden window with AllocateHWND() to service that need since a thread message queue won't work due to the SendMessage() function only accepting window handles, not thread IDs. What I'm not sure about is what to put in the thread Execute() method. I assume that if I use a GetMessage()

Python Win32Gui automation - Send WM_COPYDATA to get data from BSPlayer

匆匆过客 提交于 2019-12-08 07:40:51
问题 I am desperately trying to automate BSPlayer from my script. I was successful in sending simple command ids to the BSPlayer window(volume up/down, play/pause, etc.), however I am not able to get the file name back. Here is the BSPlayer API. I was able to emulate in python the first parts, however the WM_COPYDATA doesn't work. Here is my Python code: copyDataCmd = COPYDATASTRUCT() copyDataCmd.dwData = self.BSP_GetFileName copyDataCmd.lpData = "" copyDataCmd.cbData = 4 win32gui.SendMessage(self

Catch WM_COPYDATA from Delphi component

六眼飞鱼酱① 提交于 2019-12-06 08:22:43
问题 I'm trying to write a component, to send string messages between applications by WM_COPYDATA. I'd like trap the WM_COPYDATA, but this doesn't work: TMyMessage = class(TComponent) private { Private declarations } … protected { Protected declarations } … procedure WMCopyData(var Msg : TMessage); message WM_COPYDATA; … end; Searching Google a lot, found some reference using wndproc. I tried it, but it isn't working either. TMyMessage = class(TComponent) … protected { Protected declarations } …

C# to C++ process with WM_COPYDATA passing struct with strings

倖福魔咒の 提交于 2019-12-04 18:39:30
问题 From a c# program I want to use WM_COPYDATA with SendMessage to communicate with a legacy c++/cli MFC application. I want to pass a managed struct containing string objects. I can find the handle to the c++ application for use with SendMessage fine. The bit I don't know about is how the struct and it's strings can be marshalled and read at the other end. Especially as it contains non-blittables. Do people think this is feasible? I'll continue to work on it, but would apprecite someone who's

Catch WM_COPYDATA from Delphi component

混江龙づ霸主 提交于 2019-12-04 12:22:15
I'm trying to write a component, to send string messages between applications by WM_COPYDATA. I'd like trap the WM_COPYDATA, but this doesn't work: TMyMessage = class(TComponent) private { Private declarations } … protected { Protected declarations } … procedure WMCopyData(var Msg : TMessage); message WM_COPYDATA; … end; Searching Google a lot, found some reference using wndproc. I tried it, but it isn't working either. TMyMessage = class(TComponent) … protected { Protected declarations } … procedure WMCopyData(var Msg : TMessage); message WM_COPYDATA; procedure WndProc(var Msg: TMessage); …