+ Reply to Thread
Results 1 to 7 of 7

Thread: MSN Functions

  1. #1
    British_Intel
    Guest

    MSN Functions

    Thought id share this modual i made not long ago with you saves usin msn dll's, but u could mod these functions to use with msn API itself...enjoy


    Code:
    '******************************************************************************************************
    '** Name     : Msn_Functions_Modual                                                                  **
    '** Coded By : British_Intel AKA Andy                                                                **
    '** Date     : 06/01/06                                                                              **
    '** Website  : www.sys-overload.com                                                                  **
    '** Notes    : Please give credit where it is due, dont just rip.For more code check out my website. **
    '******************************************************************************************************
    
    '------------------------------------------------------------------------------------------------------
    ' Declarations Section
    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Public Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
    Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
    Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    Public Const WM_SETTEXT = &HC
    Public Const WM_CLOSE = &H10
    Public Const WM_LBUTTONDOWN = &H201
    Public Const WM_LBUTTONUP = &H202
    Public Const MSN_CHTSNDBUTTON = &H110
    Public Const MSN_SNDFLEBTN = &H9D53
    Public Const MSN_WBCM = &H9D8C
    Public Const MSN_CRASH = &H9D4D
    Public Const MSN_BLOCK = &H9D54
    Public Const WM_HIDE = 0
    Public Const WM_SHOW = 1
    '------------------------------------------------------------------------------------------------------
    
    
    '------------------------------------------------------------------------------------------------------
    ' Some functions only work for 1 pm window, but if you add the function to a timer they will work for all pms
    '------------------------------------------------------------------------------------------------------
    
    '******************************************************************************************************
    Public Function MSN_Enable_List() '|--|--- Enables the MSN buddy list ---|--|
        Dim MSNbuddymain As Long
        MSNbuddymain = FindWindow("MSBLWindowClass", vbNullString)
        Call EnableWindow(MSNbuddymain, 1)
    End Function
    
    Public Function MSN_Dissable_List() '|--|--- Dissables the MSN buddy list ---|--|
        Dim MSNbuddymain As Long
        MSNbuddymain = FindWindow("MSBLWindowClass", vbNullString)
        Call EnableWindow(MSNbuddymain, 0)
    End Function
    
    Public Function MSN_Enable_Pm() '|--|--- Enables the first MSN pm it finds ---|--|
        Dim MSNpms As Long
        MSNpms = FindWindow("IMWindowClass", vbNullString)
        Call EnableWindow(MSNpms, 1)
    End Function
    
    Public Function MSN_Dissable_Pm() '|--|--- Dissables the first MSN pm it finds ---|--|
        Dim MSNpms As Long
        MSNpms = FindWindow("IMWindowClass", vbNullString)
        Call EnableWindow(MSNpms, 0)
    End Function
    
    Public Function MSN_Caption(Caption As String) '|--|--- Change the buddy list bar caption ---|--|
        Dim MSNbuddymain As Long '                          Example : MSNcaption "Msn Messanger"
        MSNbuddymain = FindWindow("MSBLWindowClass", vbNullString)
        Call SendMessageByString(MSNbuddymain, WM_SETTEXT, 0&, Caption)
    End Function
    
    Public Function MSN_Nudge_Send() '|--|--- Send a Nudge to the first open pm window it finds ---|--|
        Dim IMwindow As Long
        IMwindow = FindWindow("IMWindowClass", vbNullString)
        SendMessageByString IMwindow, &H111, &H2B1, 0&
    End Function
    
    Public Function MSN_Hit_Send() '|--|--- Hit the send button on the first open pm window it finds ---|--|
        Dim IMwindow As Long
        IMwindow = FindWindow("IMWindowClass", vbNullString)
        SendMessageByString IMwindow, &H111, MSN_CHTSNDBUTTON, 0&
    End Function
    
    Public Function MSN_Hit_VoiceRecord(Record_Time As String) '|--|--- Hit the Voice Record button for a specifyed time on the first open pm window it finds ---|--|
        Dim IMwindow As Long
        If Record_Time > 15 Then
        MsgBox "Max Record Time is 15, Please Set it at 15 or lower."
        Else
        IMwindow = FindWindow("IMWindowClass", vbNullString)
        SendMessageByString IMwindow, &H111, &H2B9, 0&
        Pause Record_Time
        SendMessageByString IMwindow, &H111, &H2BA, 0&
        End If
    End Function
    
    Public Function Pause(interval)
        Dim Current
        Current = Timer
        Do While Timer - Current < Val(interval)
        DoEvents
        Loop
    End Function
    
    Public Function MSN_Close_PM() '|--|--- Close's the first pm window it finds ---|--|
        Dim IMwindow As Long
        IMwindow = FindWindow("IMWindowClass", vbNullString)
        Call SendMessageByString(IMwindow, WM_CLOSE, 0&, 0&)
    End Function
    
    Public Function MSN_Open_Send_File() '|--|--- Open Send File Dialog on IM window ---|--|
        Dim IMwindow As Long
        IMwindow = FindWindow("IMWindowClass", vbNullString)
        SendMessageByString IMwindow, &H111, MSN_SNDFLEBTN, 0&
    End Function
    
    Public Function MSN_WebCam()
        Dim IMwindow As Long
        IMwindow = FindWindow("IMWindowClass", vbNullString)
        SendMessageByString IMwindow, &H111, MSN_WBCM, 0&
    End Function
    
    Public Function MSN_CRASHER()
        Dim IMwindow As Long
        IMwindow = FindWindow("IMWindowClass", vbNullString)
        SendMessageByString IMwindow, &H111, MSN_CRASH, 0&
    End Function
    
    Public Function MSN_BLOCKER()
        Dim IMwindow As Long
        IMwindow = FindWindow("IMWindowClass", vbNullString)
        SendMessageByString IMwindow, &H111, MSN_BLOCK, 0&
    End Function
    
    Public Function MSN_Hide_IM()
        Dim IMwindow As Long
        Dim DirectUIHwnd As Long
        IMwindow = FindWindow("IMWindowClass", vbNullString)
        DirectUIHwnd = FindWindowEx(IMwindow, 0&, "DirectUIHwnd", vbNullString)
        Call ShowWindow(DirectUIHwnd, WM_HIDE)
    End Function
    
    Public Function MSN_Show_IM()
        Dim IMwindow As Long
        Dim DirectUIHwnd As Long
        IMwindow = FindWindow("IMWindowClass", vbNullString)
        DirectUIHwnd = FindWindowEx(IMwindow, 0&, "DirectUIHwnd", vbNullString)
        Call ShowWindow(DirectUIHwnd, WM_SHOW)
    End Function
    '------------------------------------------------------------------------------------------------------
    '******************************************************************************************************

  2. #2
    Member whit3_sh4rk's Avatar
    Join Date
    Aug 2005
    Posts
    39
    very nice dude!

    ty!

  3. #3
    Junior Member
    Join Date
    Jan 2006
    Posts
    24
    Thanks for this. I know this is an old post, but just a quick question... How did you get the MSN constants??? I'm working on a little program in msn and can't figure how to send a pm in a open pm window. I tried using WM_SETTEXT to set the text in the textbox, but that was unsuccessful... Any help is appreciated...

  4. #4
    British_Intel
    Guest
    erm i think msn uses rich textbox btw, and i got the consts from the files inside of msnmsgr.exe (reshacker) if i remmeber correctly it was in the xml resources...hope this helps

  5. #5
    Junior Member
    Join Date
    Jan 2006
    Posts
    24
    Sorry to bother you again, but how exactly are you getting the constants using reshacker.. I've downloaded it and opened msnmsgr.exe, and look under XML with no luck... Also, I'm pretty new to the SendMessage api, whats difference is it going to make if its a rich textbox? Thanks

  6. #6
    British_Intel
    Guest
    ive jsut looked inside of windows live and its differnt so im not even sure if this module still works, but if so then get a older version of msn and take a look inside

  7. #7
    Member wirrus's Avatar
    Join Date
    Aug 2006
    Location
    Turkey
    Posts
    45
    Thanx for this

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Connect on MSN?
    By unreachableboy in forum General Programming Help
    Replies: 3
    Last Post: 21-01-2006, 21:42
  2. MSN stuff
    By drkdreams in forum Delphi Help
    Replies: 0
    Last Post: 05-10-2005, 21:48
  3. how i can get msn password
    By unreachableboy in forum Delphi Help
    Replies: 4
    Last Post: 15-09-2005, 21:17
  4. msn hookin?
    By WEZ_2511 in forum Delphi Help
    Replies: 6
    Last Post: 06-09-2005, 12:32
  5. msn passwordfind
    By smokealot in forum Delphi Help
    Replies: 9
    Last Post: 23-08-2005, 15:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.