• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 541
  • Last Modified:

convert this code from C to Delphi

Hi, I need to convert the code from this page http://forums.msnfanatic.net/index.php?showtopic=11226&view=findpost&p=81800 from C to Delphi. It's supposed to change the "personal message" you can find in MSN Messenger 7. I tried to convert it myself, but it didn't work.
Thanks.
0
lopardo2003
Asked:
lopardo2003
  • 2
1 Solution
 
rbohacCommented:
OK. Everything is converted except for the "plugin.hwndParent".. I do not see a declaration for that in the code provided

procedure TForm1.Button1Click(Sender: TObject);
const MAGIC_NUMBER =$547;

type msnmsgstruct = record
  msncommand : Integer;
  title  : array[1..100] of wchar;
  artist : array[1..100] of wchar;
  album  : array[1..100] of wchar;
  wmcontentid: array[1..40] of wchar;
end;

var
  msndata : TCOPYDATASTRUCT;
  msnpush : msnmsgstruct;
  msnui   : HWND;
begin

  ZeroMemory(@msnpush, sizeof(msnpush));
  msnpush.msncommand := 1;

  lstrcpyW(@msnpush.title[1], 'Title');
  lstrcpyW(@msnpush.artist[1], 'Artist');
  lstrcpyW(@msnpush.album[1], 'Album');
  lstrcpyW(@msnpush.wmcontentid[1], 'WMContentID');

  msnui := FindWindow('MsnMsgrUIManager', Nil);
  msndata.dwData := MAGIC_NUMBER;
  msndata.lpData := @msnpush;
  msndata.cbData := sizeof(msnpush);
  SendMessage(msnui, WM_COPYDATA, plugin.hwndParent, Integer(@msndata));

end;
0
 
rbohacCommented:
Judging by the VB code that is above it, you may just need to pass:  self.handle
0
 
cwwkieCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: rbohac {http:#13697507}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

cwwkie
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now