BASIC/Visual Basic >> Ahoy ahoy, back again with a question
Posted by kpyro on 11:29:00 09-17-2002
Man there has been like no action here. Ok here it goes. I want to monitor my incoming instant messages. So when say Bob messages me, I want to get the message and put it into my program. I was thinking I could just like use API to monitor the open windows, but how would I manipulate the data contained within???

ThankS In AdvancE

Hesue
Posted by buzgub on 16:19:00 09-17-2002
If you use something like gaim, then it's scripting support is something you can use to catch these things.

If you switch to Trillian Pro, it appears to have plugin support you could probably use.

If you want to catch stuff in the official client(s), I think you are a sadist.
Posted by sacah on 16:37:00 09-17-2002
If you want to make a program for the general public, you will have to make it for offical clients mostly, to make real money, but if its just for yourself, or a few ppl, i would use a client with script support like buzgab said.

If its for offical client, it all depends on which one, and how they display the message, I have use Trillian only for the last year or so, so i dont know what the other clients do now days.
)-:

Sorry if this was not much help.
Posted by kpyro on 21:34:00 09-17-2002
This is for my own personal enjoyment (or pain). I know that it shouldn't be too hard. MSN instant messenger is the program I want to monitor. Whenever someone messages me, one pops up with a "Their Name - Conversation". I could just monitor all windows that have the word conversation in it... couldn't I? I think I have seen the api laying around somewhere..... the problem I see is manipulating the data in the window.... hrm. Their is this one program called DFreeze. It enumerates and manipulates windows etc. etc.
Posted by buzgub on 21:52:00 09-18-2002
As I said on IRC when I hit enter about 1 second after you vanished -

I suspect you will have to: Enumerate the windows that are children of the MSN window (or of the desktop window - you'll need to research), check the title of each window to see if it matches what you want, then use various apis with which I am unfamiliar to poke about in that window's data.

That should at least get you started. THe denizens of the #winprog channel on EFnet may be able to help you with working out which api calls to use to do the poking about; they're a helpful group, but you might need to try 3 to 4 times to find someone who knows what you want. Be sure to put a space of -->4 hours or so between each request; you don't want to annoy the regulars.

Don't forget to search google/google groups first.
Posted by dxprog on 01:36:00 09-19-2002
It's more than possible in VB. Basically you get the handle of your window, then get the handle of the control (or whatever it is) and use that to get the data from it. [addsig]
Posted by kpyro on 08:53:00 09-19-2002
Hmm... lemme rephrase what I have said before, see if you guys might be able to help out in getting those apis.

*] MSN Sits in my taskbar
*] When someone instant messages me this happens:
1) My computer gets the message
2) Up pops a new window that says "(Their Name) - Conversation"
3) In that window is a text box that has the instant messages.

dx: I know it is more than possible.

Anyone know where I can get some sample code of enumerating textboxes in a window???

ThNkS In aDvanCe
Posted by dxprog on 20:17:00 09-19-2002
Once again, it's probably sitting around on my computer. I'll see if I can dig it up. [addsig]
Posted by kpyro on 10:21:00 09-20-2002
Find find find.
Posted by kpyro on 14:16:00 11-16-2002
Tsk tsk, dx, you are getting old and soggy. I remember the days when your responses were quick and knowledgable.. come back with the code quick!
Posted by dxprog on 20:02:00 11-16-2002
Well, seeing as I have never written window enumeration code, and I have my own projects going at the moment, I cannot get back to you right now. I can only get back quickly when I am sure I know what I'm talking about, and can do it off the top of my head.

_________________
When I got VB, i could have flown without thrusters and shot down TIE Interceptors just by spitting at them.

[ This Message was edited by: dxprog on 2002-11-16 20:03 ]
Posted by kpyro on 03:27:00 11-17-2002
It's all good, I was just scandisking with you. Anyways, what projects are you working with?
Posted by dxprog on 06:25:00 11-17-2002
A couple of web pages, and I'm recoding Windows Notepad to my liking (not really needed, but fun). And I'm going to be helping with Tux Racing soon. I also have around half a dozen other things in the air. You can find the enumeration code at www.mvps.org/vbnet. Go to the Code Library and to enumeration from there. You should be able to figure it out from there. [addsig]
Posted by kpyro on 11:11:00 11-17-2002
I can't even remember why I wanted the code.. I suppose I could look at the posts up there, but that msvp site is pretty good. Thanks.
Posted by dxprog on 23:39:00 11-17-2002
No problem. [addsig]
Posted by Maltanar on 00:22:00 11-20-2002
Sorry - bit late here . Since the window pops up when someone messages you, you don't need window enumaration - you only need to find a window. As you guessed, there's a a WinAPI function for that . It's called FindWindow. I would go into more detail but I believe discovering the neat parts yourself will be more fun .

Also, keep a WinAPI guide handy if you plan to do hardcore Windows programming. I use API-Guide (http://www.allapi.net) in conjunction with Win32 SDK documentation (available from MSDN).
Posted by dxprog on 07:19:00 11-20-2002
I haven't dealt with a lot of window enumeration, actually none, but I though FindWindow required the class name and hwnd, or is it just the caption? [addsig]
Posted by Maltanar on 23:18:00 11-21-2002
FindWindow normally takes 2 parameters, lpszClassName and lpszWindowName. You can pass vbNullString to lpszClassName to ignore that parameter, and in that case, you need only the caption .
Posted by dxprog on 00:43:00 11-22-2002
Okay, Thanks. I may need that some day. [addsig]