problems with a message-intercepting userlib

Blitz3D Forums/Blitz3D Programming/problems with a message-intercepting userlib

DrakeX(Posted 2004) [#1]
OK first you should know what i'm trying to do..

windows sends every window messages about the keyboard status, of course. these can be used to do PERFECT keyboard input, including key autorepeat and everything, and taking advantage of this functionality means no more kludgy somewhat-functional user-made text input functions.

now. i did some researching and found that i can intercept messages using subclassing, where i replace the window's updating function and can do what i want with the messages, and then send them along to the old window updating function so that it's as if my function isn't even there.

i have this all working, and it works BEAUTIFULLY. i just set up the subclass (with a BeginEntry command), and i can get the entry buffer. i can then remove the subclass with an EndEntry command, and it all works wonderfully.

i only have two problems.

one, if the EndEntry command (the one that removes the subclass) is the last command in the program, it gives me an "unknown runtime error" upon exit. HOWEVER if i place any code after the EndEntry command, even just an End command, i don't get this error. it isn't really much of a problem now that i've found a solution, but i'm just wondering if there's anything i can do to fix it.

two, if the program quits abnormally (has a runtime error) or normally (with an End) while the subclass is still in effect, it gives a fairly nasty fatal error. is there ANY way for me to set something up so that the subclass is removed whenever the program ends so that this doesn't happen? i've tried scanning for WM_CLOSE messages in my custom function but it never recieves them.

thanks!


DrakeX(Posted 2004) [#2]
oh dear.