VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Autohighlight active control (SDI/1 Form)

Marcel A. Fritsch  (3 Submissions)   Windows API Call/Explanation   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

This is a very simple and useful solution to highlight input controls without writting a function for each control. I use the SetWindowsHookEx function to receive all Windows messages in a callback function (in this example WindowProc). The WindowProc function calls the SETKILLFocus function if there is an WM_SETFOCUS or WM_KILLFOCUS message and delivers the
the Handle of the control to the SETKILLFocus function.In this Example the highlighting is done only for textboxes and comboboxes but you can easily change the SETKILLFocus function to process other types of controls.
I think the explanation in the source code should answer all other questions. Please vote, if you think its a good solution.

Side Effects
When running this progam in the IDE do not use the STOP-Button to exit the program, because the unhook function will not be executed and the IDE crashes!!!

Rate Autohighlight active control (SDI/1 Form) (4(4 Vote))

Download Autohighlight active control (SDI/1 Form)

Autohighlight active control (SDI/1 Form) Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters