convert this code from C to Delphi

Posted on 2005-04-02
Medium Priority
Last Modified: 2012-08-13
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.
Question by:lopardo2003
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

rbohac earned 500 total points
ID: 13697507
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;

  msnpush : msnmsgstruct;
  msnui   : HWND;

  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));


Expert Comment

ID: 13697517
Judging by the VB code that is above it, you may just need to pass:  self.handle
LVL 14

Expert Comment

ID: 16374320
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.

EE Cleanup Volunteer

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month11 days, 15 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question