mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 6
P
pDude Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: Jan 2003
Posts: 6
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

Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
Don't post across forums.


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Jan 2003
Posts: 6
P
pDude Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: Jan 2003
Posts: 6
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

Joined: Dec 2002
Posts: 66
Babel fish
Offline
Babel fish
Joined: Dec 2002
Posts: 66
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 ...?)


- Linux System Administrator, Darktides Communications, LLC.
Joined: Jan 2003
Posts: 6
P
pDude Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: Jan 2003
Posts: 6
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.

Joined: Dec 2002
Posts: 89
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2002
Posts: 89
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


Sincerely,
Necroman, #mIRC @ Undernet
Joined: Dec 2002
Posts: 66
Babel fish
Offline
Babel fish
Joined: Dec 2002
Posts: 66
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.

- Linux System Administrator, Darktides Communications, LLC.
Joined: Jan 2003
Posts: 6
P
pDude Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
P
Joined: Jan 2003
Posts: 6
Thanks for your replies smile I'll try that and see what I come up with.

/ pDude


Link Copied to Clipboard