Creating Controls in Assembler
  • Preface
    • Author
    • Guidelines
  • Introduction
    • Controls & Modern UI Design
    • The HotMenu Quest
  • Our First Control
    • External End-User Functions
    • Internal Functions
  • Registering Our Control
  • Creating Our Control
  • Inside Our Control
    • On Creation: WM_CREATE
    • On Destroying: WM_NCDESTROY
    • Handling Other Messages For Our Control
  • Initializing Our Control
  • Painting Our Control
  • Using Our Control
  • Control Properties
    • The Memory Used To Store Properties
    • Property Structures & Constants
    • Using Macros To Get/Set Properties
    • Using The Win32 API To Get/Set Properties
    • Internal Wrapper Functions
  • Additional Resources
    • RadASM Auto-complete
    • The ModernUI Framework
Powered by GitBook
On this page

Was this helpful?

Inside Our Control

PreviousCreating Our ControlNextOn Creation: WM_CREATE

Last updated 5 years ago

Was this helpful?

_SB_WndProc is a standard main window messaging procedure, that handles specific WM_ messages for our SimpleButton control. We have complete control over what messages are handled but we also have responsibility to handle specific messages, as we are implementing the core code ourselves and have to handle painting, mouse & keyboard interaction, and other features.

We wont cover all the messages implemented in the _SB_WndProc, see the code for the full SimpleButton project on if you wish to see more detail. We will cover a few important messages that the control handles.

Note: windows messages that we don't specify or include wont be handled. This is different from subclassing controls, where you can safely call the for windows to handle messages that you have no interest in, and override only the ones you are interested in. In our control we do not have that luxury of letting windows handle the default messaging, instead it is expected that our control will do all the work.

For example if you wish to handle keyboard interaction for your control you will need to provide for that, and possibly handle some of the following messages: WM_CHAR, WM_DEADCHAR, WM_SYSCHAR, WM_SYSDEADCHAR, WM_UNICHAR, WM_HOTKEY, WM_SYSCOMMAND, WM_KILLFOCUS, WM_SETFOCUS, WM_ACTIVATE, WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP. See the Microsoft documentation for more details.

Similary if you wish to handle mouse interaction for your control you will need to possibly handle some of the following message: WM_LBUTTONDBLCLK, WM_LBUTTONDOWN, WM_LBUTTONUP, WM_MBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_RBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_XBUTTONDBLCLK, WM_XBUTTONDOWN, WM_XBUTTONUP, WM_MOUSEHOVER, WM_MOUSELEAVE, WM_MOUSEMOVE, WM_NCMOUSEMOVE, WM_NCLBUTTONDOWN, WM_NCHITTEST, WM_MOUSEWHEEL, WM_MOUSEACTIVATE, WM_CONTEXTMENU. See the Microsoft documentation for more details.

The Microsoft documentation also has a list of that may prove useful to refer to.

github
DefWindowProc
About Keyboard Input
About Mouse Input
System Defined Messages