forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


MSN Messenger's personal messages

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Sep 03, 2006 4:10 pm    Post subject: MSN Messenger's personal messages Reply with quote

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? Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Mon Sep 04, 2006 1:36 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Mon Sep 04, 2006 6:08 pm    Post subject: Reply with quote

In the original source code, \\0 is used, so my guess was that the first \ would escape the second one, which will left over "\0".

Edit: I tried it with @chr(0) but no results either... Sad

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up All times are GMT
Page 1 of 1

 
Jump to:  
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




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group