Sorry for the late reply.
Subclassing means that you are taking control of a window's message queue
(partially or entirely
) instead of letting the eVB runtime handle it for you. Win32 uses messages to notify your program that a certain event has taken place
(such as the user pressing a key, tapping the screen, etc
), these are initially handled by the runtime and then passed onto your program's event handlers
(KeyPress, MouseDown, and such
).
However, these do not handle anything that is not explicitly covered by the runtime. Since eVB offers no native way to add an OK button, the events generated by it are not being handled by the runtime functions either. The maximize and minimize buttons are different because they are handled directly by Windows.
By subclassing, you can put your own code before the native handler and take action on anything the runtime does not handle. This is done by first retrieving the memory address of the runtime-provided message handler, and then instructing Windows to instead send messages to the memory address of your own function.
Unfortunately, unlike VB6, eVB lacks the AddressOf operator required to accomplish this, because eVB does not compile down to native code. This is why a third-party component written in C++ is needed that provides a native function for Windows and exposes an event to eVB so you can handle messages. I only found one such component in the SCL called
VBCEMessage however it is a demo control, and I don't think there's still a way to buy it.
One last thing of note is that when you create a Pocket PC project, you do get an event to handle an OK button click. However I think this is specific to the Pocket PC runtime, but it might be worth testing to see if we can get this to work on H/PC too.
I recommend reading this article by Microsoft if you want to know more about how window messages work, the article is intended for desktop Windows, but the same concepts also apply to Windows CE:
About Messages and Message Queues.