here is the C code from the dll.use Win32::GUI; use Win32::API; my $rushhandle = Win32::GUI::FindWindow("tfmrush", ""); $command="RushApp.Util.Standalone.Login('backup','','')"; my $copy_data_struct = pack( 'L2P', 2, length( $command ), $command ); #Win32::GUI::PostMessage($rushhandle,WM_COPYDATA,$wparm,$lpCopydatastr +uct); #my $SendMessage=new Win32::API("User32","SendMessage",[qw(N N N N)],' +N'); #my $lresult=$SendMessage->Call($rushhandle,WM_COPYDATA,$wparm,$lpCopy +datastruct); Win32::GUI::SendMessage($rushhandle, WM_COPYDATA, 0, $copy_data_struct +);
I've left the # from my code so you can see what I've tried. I've got a feeling the error is in the pack command. but reading thou the perldoc to be honest it all goes over my head. thanks for takeing the time to read and for any help offered. Ken. **UPDATE** Thank you igelkott for all the help. I got it working :) thanks for a friend on mirc for helping too :) ykwya.TargetWindow := FindWindow('TfmRush', nil); CopyDataStruct.dwData := 1000; CopyDataStruct.cbData := strlen(Data) + 1; CopyDataStruct.lpData := Data; wCallbackWindow.fIrcHandle := mWnd; SendMessage(TargetWindow, WM_COPYDATA, 0, LParam(@CopyDataStruct));
use Win32::GUI; use Win32::API; use constant WM_COPYDATA => 74; my $rushhandle = Win32::GUI::FindWindow("tfmrush", ""); my $command = "RushApp.FTP.Login('backup','',0);"; my $copy_data_struct = pack('L2P', 1000, length( $command ), $command) +; print Win32::GUI::SendMessage($rushhandle, WM_COPYDATA, 0, $copy_data_ +struct);
In reply to win32::sendmessage and pack help. by Fuas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |