mIRC Home    About    Download    Register    News    Help

Print Thread
Memory-mapped file and SendMessage #5607 08/01/03 08:17 PM
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

Re: Memory-mapped file and SendMessage #5608 08/01/03 09:36 PM
Joined: Dec 2002
Posts: 774
T
theRat Offline
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
Re: Memory-mapped file and SendMessage #5609 08/01/03 09:45 PM
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

Re: Memory-mapped file and SendMessage #5610 09/01/03 01:52 AM
Joined: Dec 2002
Posts: 66
GrimZ Offline
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.
Re: Memory-mapped file and SendMessage #5611 09/01/03 04:54 AM
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.

Re: Memory-mapped file and SendMessage #5612 09/01/03 06:57 AM
Joined: Dec 2002
Posts: 89
N
Necroman Offline
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
Re: Memory-mapped file and SendMessage #5613 09/01/03 07:05 AM
Joined: Dec 2002
Posts: 66
GrimZ Offline
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.
Re: Memory-mapped file and SendMessage #5614 10/01/03 03:22 AM
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