Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 16-09-2010
Avatar de ColdFusion
ColdFusion ColdFusion is offline
Miembro
 
Registrado: oct 2008
Ubicación: Honduras
Posts: 32
Poder: 0
ColdFusion Va por buen camino
Exclamation Api Messenger o algo parecido

hola a todos veran..
me encontre por ahi la manera de mostrar lo que esuchas en el MSN, tengo el codigo..

pero me puse a pensar si se puede mostrar lo que esucho habra alguna manera en la que pueda cambiar el mensaje personal con el mismo codigo..

este es el codigo:
Código:
unit msnNowPlaying;

interface

uses
 windows;

const
  WM_NCPAINT                             =          $0085;
  WM_SYSCOMMAND                          =          $0112;
  WM_USER                                =          $0400;
  WM_CLOSE                               =          $0010;
  WM_DROPFILES                           =          $0233;
  WM_ACTIVATE                            =          $0006;
  WM_COPYDATA                            =          $004A;
  WM_THREADSEARCHDIR_END                 =          WM_USER+2;
  WM_USERSHOW                            =          WM_USER+3;
  WM_THREAD_PRIVCHAT_END                 =          wm_user+15;
  WM_PRIVCHAT_SHOWTRANVIEW               =          wm_user+19;
  WM_USER_QUIT                           =          WM_USER+43;
  WM_PREVIEW_START                       =          WM_USER+143;
  WM_PRIVATECHAT_EVENT                   =          WM_USER+144;
  WM_THREADSHARE_END                     =          WM_USER+147;
  WM_THREADCHATSERVER_END                =          WM_USER+148;
  WM_THREADCHATCLIENT_END                =          WM_USER+149;
  WM_ERASEBKGND                          =          $0014;

  SC_MYMAXIMIZE = WM_USER+200;
  SC_MYMINIMIZE = WM_USER+201;
  SC_MYCLOSE    = WM_USER+202;
  SC_MYRESTORE  = WM_USER+203;
  
 procedure UpdateMsn(strTitle,strArtist,strAlbum:string; enabled:boolean = true); overload;
 procedure UpdateMsn(strIn:string; radioName:string); overload;
 procedure UpdateMsn(mp3:string); overload;
 function StripMsnIllegalChars(strIn:string):string;

 var
 stringBuffer:array [0..127] of WideChar;

implementation

uses
 sysutils;


procedure UpdateMsn(mp3:string);
begin
    UpdateMsn(mp3,'','');

end;

procedure UpdateMsn(strIn:string; radioName:string);
var
ind:integer;
artist,title:string;
begin


strIn:=StripMsnIllegalChars(strIn);
radioName:=StripMsnIllegalChars(radioName);

 ind:=pos(' - ',strIn);

 if ind>0 then begin
  artist:=Trim(copy(strIn,1,ind-1));
  title:=Trim(copy(strIn,ind+3,length(strIn)));

  if length(title)=0 then begin
   title:=copy(radioName,1,30);
  end;
  
  UpdateMsn(title,artist,'');
 end else begin
   if strIn='' then UpdateMsn(radioName,'','')
    else UpdateMsn(strIn,'','');
 end;
 
end;

function StripMsnIllegalChars(strIn:string):string;
begin
result:=strIn;

while (pos('\0',result)>0) do
 result:=copy(result,1,pos('\0',result)-1) +
         copy(result,pos('\0',result)+2,length(result));

while (pos('http://',lowercase(result))>0) do
 result:=copy(result,1,pos('http://',lowercase(result))-1)+
         copy(result,pos('http://',lowercase(result))+7,length(result));

end;

procedure UpdateMsn(strTitle,strArtist,strAlbum:string; enabled:boolean = true);
var
 handleMSN:THandle;
 structCopy:TCopyDataStruct;

begin

 // Flush the array.
 FillChar(stringBuffer,SizeOf(stringBuffer),#0);

 strTitle:=Trim(copy(strTitle,1,90));
  strArtist:=Trim(copy(strArtist,1,90));
   stralbum:=Trim(copy(strAlbum,1,90));
 // The first Music can be changed to Games, Office, or Empty.
  if ((length(strTitle)>0) and (length(strArtist)>0) and (length(strAlbum)>0)) then
   StringToWideChar('\0Empty\0'+inttostr(integer(enabled))+'\0'+'{1} - {2} - {0}'+'\0'+strTitle+'\0'+strArtist+'\0'+strAlbum+'\0'+'WMContentID'+#0,@stringBuffer[0],128)
  else
 if ((length(strTitle)>0) and (length(strArtist)>0)) then begin
  StringToWideChar('\0Games\0'+inttostr(integer(enabled))+'\0'+'{1} - {0}'+'\0'+strTitle+'\0'+strArtist+'\0'+'WMContentID'+#0,@stringBuffer[0],128);
 end else begin
     if length(strTitle)>0 then begin
      StringToWideChar('\0Games\0'+inttostr(integer(enabled))+'\0'+'{0} {1}'+'\0'+strTitle+'\0\0WMContentID'+#0,@stringBuffer[0],128);
     end else
     if length(strArtist)>0 then begin
      StringToWideChar('\0Games\0'+inttostr(integer(enabled))+'\0'+'{1} {0}'+'\0\0'+strArtist+'\0WMContentID'+#0,@stringBuffer[0],128);
     end else begin
      if enabled then exit;
      StringToWideChar('\0Games\0'+inttostr(integer(enabled))+'\0'+'{1} {0}'+'\0\0\0WMContentID'+#0,@stringBuffer[0],128);
     end;
  end;

 // Set up the structure to hold the WM_COPYDATA and set the values.
 FillChar(structCopy,SizeOf(TCopyDataStruct),#0);
 with structCopy do
 begin
   cbData:=SizeOf(stringBuffer);
   dwData:=$547;
   lpData:=@stringBuffer[0];
 end;

 // Iterate through (for poloygamy) the MSN windows sending WM_COPYDATA to each
 handleMSN:=FindWindowEx(0,0,'MsnMsgrUIManager',nil);
 while handleMSN <> 0 do
 begin
   SendMessage(handleMSN,WM_COPYDATA,0,Integer(@structCopy));

   handleMSN:=FindWindowEx(0,handleMSN,'MsnMsgrUIManager',nil);
 end;
end;

end.
gracias!!
__________________
Visita mi blog personal http://edwinmunguia.co.nr/ !
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Threads o algo parecido en Lazarus? Richer Lazarus, FreePascal, Kylix, etc. 6 19-05-2010 09:06:58
combo box o algo parecido truequeman Conexión con bases de datos 1 19-01-2007 20:23:04
Replicación o algo parecido... kovaski Firebird e Interbase 6 22-11-2006 16:40:02
Algo parecido al try...except __cadetill PHP 18 10-05-2004 00:03:55
Algo parecido a un TabSheet.... craven Varios 1 05-09-2003 18:10:25


La franja horaria es GMT +2. Ahora son las 12:59:05.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi