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. Our First Control

External End-User Functions

PreviousOur First ControlNextInternal Functions

Last updated 5 years ago

Was this helpful?

Functions that will defined for use externally by the end-user of our control will be:

SimpleButtonRegister    PROTO
SimpleButtonCreate      PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
SimpleButtonGetProperty PROTO :DWORD, :DWORD
SimpleButtonSetProperty PROTO :DWORD, :DWORD, :DWORD
SimpleButtonGetState    PROTO :DWORD
SimpleButtonSetState    PROTO :DWORD, :DWORD

The SimpleButton.asm will contain these functions and other functions designed to be used internally by the control itself. I prefix the functions that will be used internally with an underscore and an abbreviation, but you can use whatever naming convention you desire.

Custom Messages For The End-User

Our custom message which are used in conjunction with api call, can be used instead of the SimpleButtonSetProperty / SimpleButtonGetProperty and SimpleButtonGetState / SimpleButtonSetState functions, are defined as:

SB_GETPROPERTY           EQU WM_USER + 1800
SB_SETPROPERTY           EQU WM_USER + 1799
SB_GETSTATE              EQU WM_USER + 1798
SB_SETSTATE              EQU WM_USER + 1797

We will cover the usage of some of these functions and mesages later on.

SendMessage