Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WM_COPYDATA example (access application outside application)
#1
I am currently testing the file-manager XYplorer.

Xyplorer has the option to control it "outside" Xyplorer.

The manual gives the following info

Quote:You can run an XYplorer script from an external program using the WM_COPYDATA command with XYplorer's hWnd. This means if you are a programmer you can fully remote control XYplorer.
  • cds.dwData: 4194305 (0x00400001)

  • cds.lpData: The syntax is identical to the one of the command line switch /script=<script resource>, so you can either pass the path to a script file (commonly called *.xys), or pass the script directly (must be preceded by :Smile.

This is how you normally boot xyplorer and initiate script

Code:
Copy      Help
XYplorer.exe /script="f:\__windows_folders\_user\desk\test.xys"

I tried the following code (syntax)

Macro Macro2
Code:
Copy      Help
int hwnd=win("XYplorer")
if(!hwnd)    
,ret

COPYDATASTRUCT cds

cds.lpData="/script=''f:\__windows_folders\_user\desk\test.xys''"
cds.dwData=4194305

SendMessage(hwnd WM_COPYDATA cds.dwData cds.lpData)

I only wanted to know if the "SendMessage" has the correct syntax?

Or do I need to formulate it differently?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)