WM_COMMAND notification codes

Share your advanced PureBasic knowledge/code with the community.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

WM_COMMAND notification codes

Post by netmaestro »

Code updated For 5.20+

You may find yourself processing a WM_COMMAND message, and if you do you'll likely want to test for a specific notification code. The notification code is in the hi-order word of wParam and here is a list of what you might look for based on the type of control you're working with:

Code: Select all

;  Button Notification Codes you may look For:
;  #BN_CLICKED = 0
;  #BN_PAINT   = 1
;  #BN_HILITE  = 2
;  #BN_UNHILITE = 3
;  #BN_DISABLE = 4
;  #BN_DOUBLECLICKED = 5
;  #BN_SETFOCUS = 6
;  #BN_KILLFOCUS = 7
; 
;  Edit Control Notification Codes you may look For:
;  #EN_SETFOCUS = 256
;  #EN_KILLFOCUS = 512
;  #EN_CHANGE = 768
;  #EN_UPDATE = 1024
;  #EN_ERRSPACE = 1280
;  #EN_MAXTEXT = 1281
;  #EN_HSCROLL = 1537
;  #EN_VSCROLL = 1538
; 
;  Combo Box Notification Codes you may look For:
;  #CBN_ERRSPACE = -1
;  #CBN_SELCHANGE = 1
;  #CBN_DBLCLK = 2
;  #CBN_SETFOCUS = 3
;  #CBN_KILLFOCUS = 4
;  #CBN_EDITCHANGE = 5
;  #CBN_EDITUPDATE = 6
;  #CBN_DROPDOWN = 7
;  #CBN_CLOSEUP = 8
;  #CBN_SELENDOK = 9
;  #CBN_SELENDCANCEL = 10
The Platform SDK doesn't give a link to these notifications in the WM_COMMAND docs, you have to go to the docs for the individual controls, and the numeric values aren't supplied.

Remember to return 0 if you process this message, happy coding!
BERESHEIT
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Post by Konne »

Helpfull thx
Apart from that Mrs Lincoln, how was the show?
Post Reply