View previous topic :: View next topic |
Author |
Message |
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sun Sep 03, 2006 4:10 pm Post subject: MSN Messenger's personal messages |
|
|
For a media player I created, I would like to show the current playing song within MSN Messenger, just like Windows Media Player does. I found this (C++?) source code and tried to convert it to VDS:
Code: | COPYDATASTRUCT msndata;
INT dwData
INT cbData
INT lpData
End Type
#define MSNMusicString L"\\0Music\\0%d\\0%s\\0%s\\0%s\\0%s\\0%s\\0"
#define MSNFormat L"{0} - {1}"
WCHAR buffer[500];
bool bshow = 1;
wsprintfW(buffer, MSNMusicString, bshow, MSNFormat, L"Title", L"Artist", L"Album", L"WMContentID");
HWND msnui = NULL;
msndata.dwData = 0x547;
msndata.cbData = (lstrlenW(buffer)*2)+2;
msndata.lpData = &buffer;
while (msnui = FindWindowEx(NULL, msnui, "MsnMsgrUIManager", NULL))
{
?SendMessage(msnui, WM_COPYDATA, (WPARAM)hwndParent, (LPARAM)&msndata); |
This is my converted code:
Code: | # Define constants
%%WM_COPYDATA = 74
# Create a dialog to get a hwndParent
DIALOG CREATE,Nieuw Dialoog,-1,0,240,160
%%hwndParent = @strdel(@winexists(@dlgtext()),1,1)
# Create the message
%s = @fill(500,\0Music\01\01\0Titlee\0Artisttt\0Albummm\0\0)
# And put it into a structure (1351 = 0x547)
%d = @binary(largeint,1351)@binary(largeint,@sum(@prod(@len(%s),2),2))@binary(largeint,@addr("%s"))
# Look for MSN Messenger's hwnd
%%MsnMsgrUIManager = @strdel(@winexists(#MsnMsgrUIManager),1,1)
# And finally, send the message to it
%z = @sendmsg(%%MsnMsgrUIManager,%%WM_COPYDATA,%%hwndParent,@addr("%d")) |
Although I thought I converted it properly, it doesn't work. Does somebody maybe see what I've done wrong? _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
Back to top |
|
|
SnarlingSheep Professional Member
Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Mon Sep 04, 2006 1:36 am Post subject: |
|
|
Just from a quick glance I can tell you that '\0' is null, so replace it with '$chr(0)'. _________________ -Sheep
My pockets hurt... |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|