mIRC Home    About    Download    Register    News    Help

Print Thread
Script Editor doesnt like to be subclassed #177303 23/05/07 08:58 AM
Joined: Jul 2003
Posts: 77
B
bamaboy1217 Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Jul 2003
Posts: 77
Can anyone figure this out? The mIRC script editor's edit box doesn't seem to like to be subclassed... It seems to crash mIRC after a few seconds with an access violation; however, i recently upgraded to vista and wanted to make sure it wasn't that. So can someone let me know if they have the same problems?

Here is my code Its just straight up subclassed then call the next proc

Quote:
Some Function {
SetProp(hwEdit,"OldProc",(HANDLE)SetWindowLong(hwEdit,GWL_WNDPROC,(LONG)eSub));
}
LRESULT __stdcall eSub(HWND hwEdit, UINT msg, WPARAM wp, LPARAM lp)
{
WNDPROC p = (WNDPROC)GetProp(hwEdit,"OldProc");
return CallWindowProc(p,hwEdit,msg,wp,lp);
}

I really need access to the messages sent to the window so I haveta figure out something...

Dont forget if you test this its the rich edit box being subclassed not the editor window

Thanks
Alex


hmmm signed by me
Re: Script Editor doesnt like to be subclassed [Re: bamaboy1217] #177328 23/05/07 03:35 PM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Your code looks fine. Have you tried the same code on another window, to verify that the problem is specific to subclassing this control?


NaquadaBomb
www.mirc-dll.com
Re: Script Editor doesnt like to be subclassed [Re: bamaboy1217] #177332 23/05/07 04:19 PM
Joined: Jul 2003
Posts: 77
B
bamaboy1217 Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Jul 2003
Posts: 77
ya it works on other windows, there is something specific about the rich edit box of the editor


hmmm signed by me
Re: Script Editor doesnt like to be subclassed [Re: bamaboy1217] #177374 24/05/07 07:37 AM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
I can't reproduce this problem. I am able to subclass the RichEdit20A control without any problems. The code you have provided is not the problem. How are you establishing the subclassing, with a CBT hook?


NaquadaBomb
www.mirc-dll.com
Re: Script Editor doesnt like to be subclassed [Re: NaquadaServ] #177393 24/05/07 12:57 PM
Joined: Nov 2006
Posts: 26
O
Osah Offline
Ameglian cow
Offline
Ameglian cow
O
Joined: Nov 2006
Posts: 26
Naquad do you have any source code how to subclass a basic window, or control in mIRC -- also if its a CBT Hook would it need to be injected into the mIRCs process? According to MSDN it does... -> thx


codemastr_
Re: Script Editor doesnt like to be subclassed [Re: Osah] #177397 24/05/07 02:01 PM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
DLL's run in the same process as mIRC does, so no need to inject anything... Bamaboy's code works great for subclassing.

Edit: I didn't have time to finish this message, so...

I have placed the source I used to subclass the Richtext Edit control on my web site...

Edit: When I rebuilt the project I didn't add the exports file, the updated solution can be downloaded here.

Last edited by NaquadaServ; 24/05/07 05:21 PM.

NaquadaBomb
www.mirc-dll.com
Re: Script Editor doesnt like to be subclassed [Re: Osah] #177457 25/05/07 05:08 AM
Joined: Jul 2003
Posts: 77
B
bamaboy1217 Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Jul 2003
Posts: 77
ya i never did try it on xp so maybe it was just vista... I got it working using a wndproc hook it seemed to work better anyway and I guess (assuming my vista is the problem theory is correct) that it is more friendly in a vista, xp, and 2000 environment.

So anyway who knows weird bug...


hmmm signed by me