mIRC Homepage
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

Some Function {
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

Your code looks fine. Have you tried the same code on another window, to verify that the problem is specific to subclassing this control?
ya it works on other windows, there is something specific about the rich edit box of the editor
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?
Posted By: Osah Re: Script Editor doesnt like to be subclassed - 24/05/07 12:57 PM
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
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.
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...
© mIRC Discussion Forums