What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » VB help - Identifing Which Contact Is In The Window

VB help - Identifing Which Contact Is In The Window
Author: Message:
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
O.P. VB help - Identifing Which Contact Is In The Window
well the idea is, set the open window's contact email + friendly name to clipboard

at the moment ive only made it to work with im windows with view by email
here is what i currently have:
code:
Public Sub getcontactinfo(id As String)
Dim imHwnd As Long
Dim lLength  As Long
Dim strCaption As String
Dim MsgrContact  As IMessengerContact
Dim Memail As String
imHwnd = FindWindow("IMWindowClass", vbNullString)
lLength = GetWindowTextLength(imHwnd)
strCaption = String$(lLength, vbNullChar)
GetWindowText imHwnd, strCaption, lLength + 1
If strCaption Like "*" + "@" + "*" Then
'using view contact by email
Memail = Split(strCaption, " - Conver")(0)
Set MsgrContact = MessengerAPI.Messenger.GetContact(Memail, MessengerAPI.Messenger.MyServiceId)
If id = "fn" Then
'set friendly name
VB.Clipboard.SetText MsgrContact.FriendlyName
ElseIf id = "em" Then
'set email
VB.Clipboard.SetText MsgrContact.SigninName
End If
Else
'window isnt email so
'set friendlyname
Mfn = Split(strCaption, " - Conver")(0)
If id = "fn" Then
'set friendly name
VB.Clipboard.SetText Mfn
ElseIf id = "em" Then
' Need to do
End If
End If
End Sub


this isnt working :(
just beeps, and nothing is added...

if anyone has any ideas, please help :)

This post was edited on 04-17-2005 at 12:05 PM by Stigmata.
04-17-2005 12:05 PM
Profile PM Web Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
31 / Male / Flag
Joined: Mar 2003
Status: Online
RE: VB help - Identifing Which Contact Is In The Window
Make sure to use Clipboard.Clear before using Clipboard.SetText !

By the way, I would use something else than the Messenger API...

By "else" i mean a global windows hook that would notify me when a window is created.
Then I would get the class name, and if it is "IMWindowClass" get the caption title, and split to the last " - ".

But with that way, you won't be able to get the email/friendly name without using the messenger api... :(

But, I think I have some code that changes to email view...
But, you need to have the contact list window open...

Good luck...

By the way, WDZ really needs to add the code coloring feature :P
YouTube closed-captions ripper (also allows you to download videos!)
04-17-2005 07:22 PM
Profile E-Mail PM Web Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
RE: VB help - Identifing Which Contact Is In The Window
if you're using the Messenger API, it seems a bit stupid to then just read the window caption to get the email and friendly name.

You can just use the API to get the emails and friendly names of all the people in a convo, i can do the code for you if you want?
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
04-17-2005 07:26 PM
Profile E-Mail PM Web Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
O.P. RE: VB help - Identifing Which Contact Is In The Window
would be perfect :)

i just need a way of knowing who is in the contact window :)
04-18-2005 06:38 AM
Profile PM Web Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
RE: VB help - Identifing Which Contact Is In The Window
I'm at college atm, but when i get home i'll do the code
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
04-18-2005 08:15 AM
Profile E-Mail PM Web Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
O.P. RE: VB help - Identifing Which Contact Is In The Window
thnks :)
04-18-2005 05:21 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On