mIRC Home    About    Download    Register    News    Help

Print Thread
P
pDude
pDude
P
Hi!

I'm using a memory-mapped file and SendMessage to communicate with mIRC.

I have two questions:

1. In the help file it says that I can send the messages to either the main window, or any of the channel, query, etc windows. If I send the WM_MEVALUATE message to a channel window, is the contens of the mapped file evaluated in the context of the connection that the channel window belongs to?

2. As you know, the $chan identifier has a property called hwnd. If I write $chan(1).hwnd to the mapped file, and send mIRC's main window the WM_MEVALUATE message, as what type should I interpret the value returned? Is it a char*, and if so, how do I convert it to a HWND?

Thanks in advance smile
/ pDude

T
theRat
theRat
T
Don't post across forums.

P
pDude
pDude
P
Yes, I posted to the feature request and bug report forum as well, but if you read my posts, you'll find that they are about different topics.

/ pDude

G
GrimZ
GrimZ
G
I believe it would return a LPSTR but don't hold me to it.

To convert it, simply typecast it; (HWND)var.....

Just out of curiousity, why not just send the HWND to the DLL instead? If you're using multiserver simply the channel name alone isn't going to help (what if you're on #chan and #chan on 2+ servers ...?)

P
pDude
pDude
P
I figured so too. But typecasting from char * to HWND is not gonna do it. I need a function like atol, only which one should I use?

Who said anything about channel names? I'm going to iterate through the connections, and get the handles to the channel windows using the .hwnd property. I just need to know how to convert the .hwnd value to an actual HWND.

And more important, if I send messages to channel windows, asking to evaluate identifiers, are the identifiers evaluated in the context of the connection that the channel window belongs to?

Otherwise, I have no use of the .hwnd property.

N
Necroman
Necroman
N
The "hwnd" property returns a string, use (HWND)atol(...) to get the handle.

About evaluation context: why don't you try it youself and post a summary here? smile

G
GrimZ
GrimZ
G
Well, it is an LPSTR and I have done an example that will display how many chans/queries/servers are opened and which. My example shows:

c: 6 (#ScriptaZ #PHP-Freaks #CreationCorner #Nomadinc #Darktides #DarktidesNET), q: 1 (vcv), s: 1 (irc.darktides.net)

It's not exactly your goal, but it wouldn't be hard to do .hwnd and just do (HWND) infront of them. This was only an example on how to loop the names etc.

http://www.scriptaz.com/grimz/cpp/conn_loops/conn_loops.cpp (Code)
http://www.scriptaz.com/grimz/cpp/conn_loops/conn_loops.def (Def file)

Last edited by GrimZ; 09/01/03 07:06 AM.
P
pDude
pDude
P
Thanks for your replies smile I'll try that and see what I come up with.

/ pDude


Link Copied to Clipboard