What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Sending a message to the focused window only

Sending a message to the focused window only
Author: Message:
kaourika
Junior Member
**


Posts: 16
Reputation: 1
34 / Female / –
Joined: Jul 2006
O.P. Sending a message to the focused window only
Argh, I've wasted hours trying to figure this out alone. I always hate to give in, but I think it's time to ask for help.

In my script, when the user clicks a certain button in an XML window, a message needs to be sent to the active, focused chatwnd.

But, with everything I try coding, it's sending to all open windows instead of just the focused one. =/ Thus far the only methods I've found that will send to a specific wnd involve defining the email of one contact, which isn't flexible enough for my needs.

So, I feel like I'm surely missing something obvious. Any pointers would be very appreciated. Thanks <3
04-11-2008 12:47 AM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Sending a message to the focused window only
Are you looking to open an xml click a button and have it sent it to the chat window that was just opened?

If you are opening the window from the Chat Window (via Menu or Command) you can store the Chat Window object to be later used or you can use the EnumWindows function and try and get the ZOrder of the window and which ever is first will likely be the top chatwindow. It is kinda hard to do what you are asking.
04-11-2008 01:42 AM
Profile E-Mail PM Find Quote Report
kaourika
Junior Member
**


Posts: 16
Reputation: 1
34 / Female / –
Joined: Jul 2006
O.P. RE: Sending a message to the focused window only
Thanks for the response, matty. :D

Dang, that's what I was afraid of.

Well, this is essentially how it works:
1. a main menu is opened either from the script menu or a command.
2. BUT... On the main menu, there are several buttons to reach other windows -- for example, the inventory.
3. When one of these buttons is clicked, it destroys the main window and creates the inventory window. I had to do it like this because I couldn't get the child wnds to work for me, and each different window is really complex; I didn't really want to deal with everything cluttered into one massive XML file. =/ And this is the the xml window I'll need to be sending text from. (among with other similar "sub" windows, like the store, the kitchen, and so on.)

So basically, even though the main xml window is reached via the script menu or command, subsequent windows, such as the inventory, are not. D: I suppose it won't be possible, then, to send messages from these?

Also, when you say "will likely be the top window", does likely just mean 'sometimes,' or 'almost always unless there's some freakish bug' ? =P
04-11-2008 07:36 AM
Profile E-Mail PM Web Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: Sending a message to the focused window only
Is it possible to determine when a window is focused? If so, what you could do is store a reference to that window as it gets focused. Then just use that reference when calling your menu fuctions
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
04-11-2008 07:40 AM
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