I have a Small vcl application in delphi that runs with administrator privileges, this application only receives messages and emits mouse events. The second application works with normal user privileges (below the first), this application cannot send messages to the first application. I am sure that the reason is the privilege level, higher and lower, because if I run both lower and higher, they communicate with success. How can I make IPC, where can I send a message to a higher-level application from a lower-level application? Or is it impossible?
This is the way I use to send messages:
A higher application uses this code to process winapi.messages:
procedure TfrMouseDriver.WMCopyData(var Message: TWMCopyData); var S: WideString; cmd, sX, sY: String; s2,F: String; WParam: WideString; i, z, X, Y: integer; begin X := 1; Y := 1; if true then begin s:= PWideChar(Message.CopyDataStruct.lpData); s2:= PChar(Message.CopyDataStruct.lpData); ...
And the lower-level application sends messages this way:
procedure TfrPenDriver.btnIPCClick(Sender: TObject); var CopyData: CopyDataStruct; hMouse : HWND; Msg : WideString; begin Msg := 'CM_MOVE:000500:000230'; hMouse := FindWindow(PCHAR('TfrMouseDriver'),nil); if hMouse > 0 then begin CopyData.dwData := 0; CopyData.lpData := PWideChar(Msg); CopyData.cbData := (1 + Length(Msg))*SizeOf(WideChar); Winapi.Windows.SendMessage(hMouse, WM_COPYDATA, 0, LPARAM(@CopyData)); end; end;
Im looking I am a way to make IPC between these applications with different user levels, where the lowest level needs to be sent to a higher level application.
source share