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?

  1. Control Properties

Internal Wrapper Functions

PreviousUsing The Win32 API To Get/Set PropertiesNextAdditional Resources

Last updated 5 years ago

Was this helpful?

The helper functions, used in our example SimpleButton control, are just wrapper functions using and to get and set the internal and external variables/properties: __GetIntProperty, __SetIntProperty, __GetExtProperty and __SetExtProperty.

The internal variables/properties are not exposed to the end-user by design (this can of course be changed if you need to or your control requires it for whatever reason).

I borrowed my earlier technique of using constants to name the properties/variables used, and to define the offsets into the memory blocks, as this allows us to define easily readable property (or variable) names to use with out helper functions. It is much easier to use and read code like:

Invoke __GetExtProperty, hControl, @SimpleButtonBackColor

than:

Invoke __GetExtProperty, hControl, 24

We can clearly see the property we are referring to, in this case it relates to a back color or background color of our control.

For the end-user who will use our SimpleButton control they can access the external properties via calls to SimpleButtonGetProperty and SimpleButtonSetProperty or by using the custom messages: SB_GETPROPERTY, SB_SETPROPERTY, SB_GETSTATE and SB_SETSTATE with the api call. These functions then call the appropriate internal helper functions (wrapper functions for and ).

GetWindowLong
SetWindowLong
SendMessage
GetWindowLong
SetWindowLong