Crazy D
December 14th, 1999, 06:22 AM
Hi,
I'm trying to catch the WM_ACTIVATE event. I've done it before and it always worked.. but now use it a little different, and it doesn't work always..
This is the scenario: activex dll subclasses a form to catch both resize and activate event. In the subclass, the resizeevent works fine, it doesn't allow the window to be smaller of bigger then the specified values.
For the WM_ACTIVATE, I figured it would be easy to let the class raise an event when activated so I can do the stuff I want in the form.
I'm using SetProp to save the stuff I need, including a pointer to the class using ObjPtr(Me) and in the subclass, I use copymemory to change the pointer back into a class-variable, and call the friend sub I created.. Actually I ripped this from one of the excellent examples on this site...
Now the problem: it works perfect if I click on another window which makes my window dissapear, but if I click on the taskbar, my window is inactive (correct) but when I click on the window itself, it doesn't get an activate event (it works if I click on the button on the taskbar). I've tested it with other code I used for this (but there I subclassed the window in the exe itself) and then it works all perfect...
Am I overlooking something, in a way that maybe because of the RaiseEvent I do in the class, something get screwed up? Or am I still too sick (which I actually am..) to think clever and should I just go back to bed and forget the whole thing *LOL*
Tnx in advance :-)
Crazy D :-)
"One ring rules them all"
I'm trying to catch the WM_ACTIVATE event. I've done it before and it always worked.. but now use it a little different, and it doesn't work always..
This is the scenario: activex dll subclasses a form to catch both resize and activate event. In the subclass, the resizeevent works fine, it doesn't allow the window to be smaller of bigger then the specified values.
For the WM_ACTIVATE, I figured it would be easy to let the class raise an event when activated so I can do the stuff I want in the form.
I'm using SetProp to save the stuff I need, including a pointer to the class using ObjPtr(Me) and in the subclass, I use copymemory to change the pointer back into a class-variable, and call the friend sub I created.. Actually I ripped this from one of the excellent examples on this site...
Now the problem: it works perfect if I click on another window which makes my window dissapear, but if I click on the taskbar, my window is inactive (correct) but when I click on the window itself, it doesn't get an activate event (it works if I click on the button on the taskbar). I've tested it with other code I used for this (but there I subclassed the window in the exe itself) and then it works all perfect...
Am I overlooking something, in a way that maybe because of the RaiseEvent I do in the class, something get screwed up? Or am I still too sick (which I actually am..) to think clever and should I just go back to bed and forget the whole thing *LOL*
Tnx in advance :-)
Crazy D :-)
"One ring rules them all"