Click here to Skip to main content
Licence CPOL
First Posted 31 Aug 2005
Views 65,883
Downloads 1,084
Bookmarked 33 times

MSN Floating Personal Message

By | 31 Aug 2005 | Article
Showing floating text message on the MSN Messenger as a personal message
Sample Image - MSNFloatingText.jpg

Introduction

This application gives the ability of writing floating text messages to the Personal Message of the MSN Messenger.

The application has speed, direction, and icon options. The user can select the speed of float as a value of milliseconds. Moreover, the user can select the direction of the movement, Left to Right or Right to Left. There are three icon options: Office, Games, and Music. When the Music icon option is selected, the text became as a textlink.

The application must be open during the making of the floating text message. When the application is minimized, it is shown as a trayicon. It will not be seen on the taskbar.

MSN Object Declarations

[DllImport("user32", EntryPoint="SendMessageA")]
private static extern int SendMessage(int Hwnd, int wMsg, int wParam, int lParam);

[DllImport("user32", EntryPoint="FindWindowExA")]
private static extern int FindWindowEx(int hWnd1, int hWnd2, string lpsz1, string lpsz2);
private const short WM_COPYDATA = 74;

public struct COPYDATASTRUCT
{
  public int dwData;
  public int cbData;
  public int lpData;
}
public COPYDATASTRUCT data;

Function that Makes Interop to MSN Messenger

public int VarPtr(object e)
{
  GCHandle GC = GCHandle.Alloc(e, GCHandleType.Pinned);
  int gc = GC.AddrOfPinnedObject().ToInt32();
  GC.Free();
  return gc;
}

private void SendMSNMessage(bool enable, string category, string message)
{
  string buffer = "\\0" + category + "\\0" + (enable ? "1" : "0") + 
				"\\0{0}\\0" + message + "\\0\\0\\0\\0\0";
  int handle = 0;

    data.dwData = 0x0547;
    data.lpData = VarPtr(buffer);
    data.cbData = buffer.Length * 2;

    handle = FindWindowEx(0, handle, "MsnMsgrUIManager", null);
    if (handle > 0) 
        SendMessage(handle, WM_COPYDATA, 0, VarPtr(data));
}

History

  • 31st August, 2005: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

cagatay.yildir.im

Software Developer

Turkey Turkey

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 2 Pinmemberegothic10:43 31 Mar '10  
Generalbad word filter to protect my kids. with [***********] 's PinmemberZUPERKOOL7:55 7 Feb '10  
GeneralVarPtr PinmemberMikael Svenson21:08 26 Nov '09  
GeneralLive Messenger 2009 PinmemberAlain Raza8:48 4 Mar '09  
GeneralMore icons PinmemberJhonmiller@qatar.net.qa8:22 6 Sep '07  
QuestionHELP Pinmemberyoung geek5:23 26 Jul '07  
GeneralTranslation PinmemberLegionFX1:22 11 Jun '07  
GeneralRe: Translation PinmemberLegionFX1:29 11 Jun '07  
GeneralRe: Translation PinmemberLegionFX0:20 13 Jun '07  
GeneralGrr PinmemberMatijaSakoman10:10 21 Feb '07  
GeneralTo make it run in 64 bit system Pinmembertreeleung14:46 28 Jun '06  
GeneralRe: To make it run in 64 bit system PinmemberZonakusu.NET8:17 3 Mar '09  
Hmm this edit still doesn't work for MSN 8.1 on XP x64...

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120529.1 | Last Updated 31 Aug 2005
Article Copyright 2005 by cagatay.yildir.im
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid