Hi,
Basically, let me set the scene, got a form with an embedded frame - now it has a textbox embedded into it - and I want to prevent the user being able to edit the contents without using textbox.disabled = true. Now, I understand *basically* how Win32 API works, and have implemented a Subclassing procedure (which I understand - mostly ) and which is invoked when the form is loaded, and terminated when the form is unloaded.
I have added constants to define WM_KEYDOWN etc, but I notice when I do a debug.print lParam & uMsg that the subclassing procedure is only called for form events, i.e. if I move the mouse about, or click on the form etc, a message is printed, but when I click in one of the embedded text boxes - nothing, when I type text, nothing. Now, I'm sure I'm missing something, would I be better using a hook as opposed to subclassing to capture the messages?
Secondly, when I've got the messages, how do I know which form object they are assoicated with ? There must be some unique ID I can capture to determine which object the message is destined for, and therefore elimitate any WM_KEYDOWN, WM_LEFTMOUSESOMETHING events before they are processed by the forms main processor.
Btw, I'm sure there is a dead easy VB way to solve this problem - but I wanna avoid that - the power of win32 api n all
Thanks
Yum.
Basically, let me set the scene, got a form with an embedded frame - now it has a textbox embedded into it - and I want to prevent the user being able to edit the contents without using textbox.disabled = true. Now, I understand *basically* how Win32 API works, and have implemented a Subclassing procedure (which I understand - mostly ) and which is invoked when the form is loaded, and terminated when the form is unloaded.
I have added constants to define WM_KEYDOWN etc, but I notice when I do a debug.print lParam & uMsg that the subclassing procedure is only called for form events, i.e. if I move the mouse about, or click on the form etc, a message is printed, but when I click in one of the embedded text boxes - nothing, when I type text, nothing. Now, I'm sure I'm missing something, would I be better using a hook as opposed to subclassing to capture the messages?
Secondly, when I've got the messages, how do I know which form object they are assoicated with ? There must be some unique ID I can capture to determine which object the message is destined for, and therefore elimitate any WM_KEYDOWN, WM_LEFTMOUSESOMETHING events before they are processed by the forms main processor.
Btw, I'm sure there is a dead easy VB way to solve this problem - but I wanna avoid that - the power of win32 api n all
Thanks
Yum.