Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

GUI Constants


  • Please log in to reply
36 replies to this topic
just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
!!! Discontinued !!!

After Super-Globals were implemented with AHK 1.1.05, I'll start a new thread for global "constants". The scripts in this thread will remain unchanged (except fixes) for those who like to stay with AHK Basic.

As mentioned before AutoIt3 comes with some #include scripts containing definitions for a lot of windows constants. I always thought it would be nice to have such includes for AHK too. So I started to do it. Here are the first two scripts, other will follow one at a time:
[*:ubtgnqdn]Const_Controls.ahk - Generic constants for common controls
[*:ubtgnqdn]Const_Button.ahk - Button constants (Button, Checkbox, Radio, GroupBox)
[*:ubtgnqdn]Const_ComboBox.ahk - ComboBox constants (ComboBox, DropDownList)
[*:ubtgnqdn]Const_DateTime.ahk - DateTime constants
[*:ubtgnqdn]Const_Edit.ahk - Edit constants
[*:ubtgnqdn]Const_Hotkey.ahk - Hotkey constants
[*:ubtgnqdn]Const_ListBox.ahk - ListBox constants
[*:ubtgnqdn]Const_ListView.ahk - ListView constants
[*:ubtgnqdn]Const_MonthCal.ahk - MonthCal constants
[*:ubtgnqdn]Const_ProgressBar.ahk - ProgressBar constants (Progress)
[*:ubtgnqdn]Const_Static.ahk - Static constants (Test, Pic)
[*:ubtgnqdn]Const_StatusBar.ahk - StatusBar constants
[*:ubtgnqdn]Const_Tab.ahk - Tab constants (Tab2)
[*:ubtgnqdn]Const_Tooltip.ahk - Tooltip constants
[*:ubtgnqdn]Const_Trackbar.ahk - Trackbar constants (Slider)
[*:ubtgnqdn]Const_TreeView.ahk - TreeView constants
[*:ubtgnqdn]Const_UpDown.ahk - UpDown Constants
[*:ubtgnqdn]Const_Windows.ahk - Constants for windows (only messages/notifications, styles, and exstyles)Edit: All GUI controls are done!

Edit: Changed title to "GUI constants", seems to be more reasonable.

For those who don't want to include but to look and copy&paste I wrote a script as Morpheus suggested:

GUI_Constants.ahk:
; ======================================================================================================================
; AHK 1.1+
; ======================================================================================================================
#NoEnv
SetBatchLines, -1
; ======================================================================================================================
EM_SCROLLCARET := 0x00B7
EM_SETSEL      := 0x00B1
ES_NOHIDESEL   := 256
; ======================================================================================================================
Gui, +Disabled +OwnDialogs
Gui, Margin, 20, 20
Gui, Font, , Courier New
Gui, Add, Text, Section, Scripts:
Gui, Add, Listbox, xm y+5 w200 r20 vLBScripts gSubLBScripts 
Gui, Add, Text, ys, Constants:
Gui, Add, Edit, y+5 w600 r20 vEDConstants hwndHEDConstants ReadOnly HScroll +%ES_NOHIDESEL%
Gui, Add, Edit, wp vEDSearch gSubEDSearch
Gui, Add, Text, xm yp w200 hp 0x200 Right, Search:
Gui, Add, StatusBar, , % "   Select folder"
Gui, Show, , GUI_Constants
; ======================================================================================================================
; Select Cons_xxx.ahk folder
FileSelectFolder, ConstFolder, *%A_ScriptDir%, 2, Select the folder containing the Const_ scripts, please:
If (ErrorLevel) {
   MsgBox, 16, GUI_Constants, You didn't select a folder,`nthe program will exit!
   ExitApp
}
Files := []
Loop, %ConstFolder%\Const_*.ahk
   Files.Insert(A_LoopFileLongPath)
If !Files.MaxIndex() {
   MsgBox, 16, GUI_Constants, The selected folder %ConstFolder%`ndoes not contain Const_ files! The program will exit!
   ExitApp
}
SB_SetText("  ... loading scripts ...")
GuiControl, , LBScripts, % LoadScripts(Files, Constants)
GuiControl, Choose, LBScripts, |1
Gui, -Disabled
Return
; ======================================================================================================================
GuiClose:
GuiEscape:
ExitApp
; ======================================================================================================================
SubLBScripts:
   GuiControlGet, LBScripts
   GuiControl, , EDConstants, % Constants[LBScripts]
   SB_SetText("   " . LBScripts . ".ahk")
   GuiControl, , EDSearch
Return
; ======================================================================================================================
SubEDSearch:
   GuiControlGet, LBScripts
   GuiControlGet, EDSearch
   If (P := RegExMatch(Constants[LBScripts], "`aim)^\Q" . EDSearch . "\E")) {
      P--
      SendMessage, EM_SETSEL, P, P + StrLen(EDSearch), , ahk_id %HEDConstants%
      SendMessage, EM_SCROLLCARET, 0, 0, , ahk_id %HEDConstants%
   } Else {
      SendMessage, EM_SETSEL, -1, 0, , ahk_id %HEDConstants%
   }
Return
; ======================================================================================================================
Loadscripts(ByRef Files, ByRef Constants) {
   Constants := {}
   Scripts := ""
   For Each, FilePath In Files {
      FileRead, FileContent, %FilePath%
      If (ErrorLevel)
         Continue
      SplitPath, FilePath, , , , NameNoExt
      Constants[NameNoExt] := FileContent
      Scripts .= "|" . NameNoExt 
   }
   Return Scripts
}
; ======================================================================================================================


just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
Const_Edit.ahk:
; ======================================================================================================================

; Function:         Constants for Edit controls

; AHK version:      -

; Language:         English

; Version:          1.0.00.00/2011-08-20/just me

; ======================================================================================================================

; Messages =============================================================================================================

EM_GETSEL               := 0x00B0

EM_SETSEL               := 0x00B1

EM_GETRECT              := 0x00B2

EM_SETRECT              := 0x00B3

EM_SETRECTNP            := 0x00B4

EM_SCROLL               := 0x00B5

EM_LINESCROLL           := 0x00B6

EM_SCROLLCARET          := 0x00B7

EM_GETMODIFY            := 0x00B8

EM_SETMODIFY            := 0x00B9

EM_GETLINECOUNT         := 0x00BA

EM_LINEINDEX            := 0x00BB

EM_SETHANDLE            := 0x00BC

EM_GETHANDLE            := 0x00BD

EM_GETTHUMB             := 0x00BE

EM_LINELENGTH           := 0x00C1

EM_REPLACESEL           := 0x00C2

EM_GETLINE              := 0x00C4

EM_LIMITTEXT            := 0x00C5

EM_CANUNDO              := 0x00C6

EM_UNDO                 := 0x00C7

EM_FMTLINES             := 0x00C8

EM_LINEFROMCHAR         := 0x00C9

EM_SETTABSTOPS          := 0x00CB

EM_SETPASSWORDCHAR      := 0x00CC

EM_EMPTYUNDOBUFFER      := 0x00CD

EM_GETFIRSTVISIBLELINE  := 0x00CE

EM_SETREADONLY          := 0x00CF

EM_SETWORDBREAKPROC     := 0x00D0

EM_GETWORDBREAKPROC     := 0x00D1

EM_GETPASSWORDCHAR      := 0x00D2

EM_SETMARGINS           := 0x00D3

EM_GETMARGINS           := 0x00D4

EM_SETLIMITTEXT         := EM_LIMITTEXT

EM_GETLIMITTEXT         := 0x00D5

EM_POSFROMCHAR          := 0x00D6

EM_CHARFROMPOS          := 0x00D7

EM_SETIMESTATUS         := 0x00D8

EM_GETIMESTATUS         := 0x00D9

ECM_FIRST               := 0x1500            ; The following messages need Unicode strings

EM_SETCUEBANNER         := (ECM_FIRST + 1)

EM_GETCUEBANNER         := (ECM_FIRST + 2)

EM_SHOWBALLOONTIP       := (ECM_FIRST + 3)

EM_HIDEBALLOONTIP       := (ECM_FIRST + 4)

EM_SETHILITE            := (ECM_FIRST + 5)   ; >= Vista, not documented

EM_GETHILITE            := (ECM_FIRST + 6)   ; >= Vista, not documented

; Notifications ========================================================================================================

EN_SETFOCUS             := 0x100

EN_KILLFOCUS            := 0x200

EN_CHANGE               := 0x300

EN_UPDATE               := 0x400

EN_ERRSPACE             := 0x500

EN_MAXTEXT              := 0x501

EN_HSCROLL              := 0X601

EN_VSCROLL              := 0x602

EN_ALIGN_LTR_EC         := 0x700

EN_ALIGN_RTL_EC         := 0x701

; Styles ===============================================================================================================

ES_LEFT                 := 0

ES_CENTER               := 1

ES_RIGHT                := 2

ES_MULTILINE            := 4

ES_UPPERCASE            := 8

ES_LOWERCASE            := 16

ES_PASSWORD             := 32

ES_AUTOVSCROLL          := 64

ES_AUTOHSCROLL          := 128

ES_NOHIDESEL            := 256

ES_OEMCONVERT           := 1024

ES_READONLY             := 2048

ES_WANTRETURN           := 4096

ES_NUMBER               := 8192

; Parameters for EM_SETMARGINS =========================================================================================

EC_LEFTMARGIN           := 0x1

EC_RIGHTMARGIN          := 0x2

EC_USEFONTINFO          := 0xFFFF

; Parameters for EM_SETIMESTATUS =======================================================================================

EMSIS_COMPOSITIONSTRING := 0x1

EIMES_GETCOMPSTRATONCE  := 0x1 

EIMES_CANCELCOMPSTRINFOCUS := 0x2 

EIMES_COMPLETECOMPSTRKILLFOCUS := 0x4 

; Icons for EM_SHOWBALLOONTIP ==========================================================================================

; TTI_NONE                := 0

; TTI_INFO                := 1

; TTI_WARNING             := 2

; TTI_ERROR               := 3

; TTI_INFO_LARGE          := 4  ; >= Vista

; TTI_WARNING_LARGE       := 5  ; >= Vista

; TTI_ERROR_LARGE         := 6  ; >= Vista

; ======================================================================================================================


just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
Const_Static.ahk:
; ======================================================================================================================

; Function:         Constants for Static controls (GUI: Text, Pic)

; AHK version:      -

; Language:         English

; Version:          1.0.00.00/2011-08-20/just me

; ======================================================================================================================

; Messages =============================================================================================================

STM_SETICON         := 0x0170

STM_GETICON         := 0x0171

STM_SETIMAGE        := 0x0172

STM_GETIMAGE        := 0x0173

; Notifications ========================================================================================================

STN_CLICKED         := 0

STN_DBLCLK          := 1

STN_ENABLE          := 2

STN_DISABLE         := 3

; Styles ===============================================================================================================

SS_LEFT             := 0x0000

SS_CENTER           := 0x0001

SS_RIGHT            := 0x0002

SS_ICON             := 0x0003

SS_BLACKRECT        := 0x0004

SS_GRAYRECT         := 0x0005

SS_WHITERECT        := 0x0006

SS_BLACKFRAME       := 0x0007

SS_GRAYFRAME        := 0x0008

SS_WHITEFRAME       := 0x0009

SS_USERITEM         := 0x000A

SS_SIMPLE           := 0x000B

SS_LEFTNOWORDWRAP   := 0x000C

SS_OWNERDRAW        := 0x000D

SS_BITMAP           := 0x000E

SS_ENHMETAFILE      := 0x000F

SS_ETCHEDHORZ       := 0x0010

SS_ETCHEDVERT       := 0x0011

SS_ETCHEDFRAME      := 0x0012

SS_TYPEMASK         := 0x001F

SS_REALSIZECONTROL  := 0x0040

SS_NOPREFIX         := 0x0080

SS_NOTIFY           := 0x0100

SS_CENTERIMAGE      := 0x0200

SS_RIGHTJUST        := 0x0400

SS_REALSIZEIMAGE    := 0x0800

SS_SUNKEN           := 0x1000

SS_EDITCONTROL      := 0x2000

SS_ENDELLIPSIS      := 0x4000

SS_PATHELLIPSIS     := 0x8000

SS_WORDELLIPSIS     := 0xC000

SS_ELLIPSISMASK     := 0xC000

; ======================================================================================================================


just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
Const_Button.ahk:
; ======================================================================================================================

; Function:         Constants for Button controls (GUI: Button, Checkbox, Radio, GroupBox)

; AHK version:      -

; Language:         English

; Version:          1.0.00.00/2011-08-20/just me

; ======================================================================================================================

; Messages =============================================================================================================

BM_GETCHECK          := 0x00F0

BM_SETCHECK          := 0x00F1

BM_GETSTATE          := 0x00F2

BM_SETSTATE          := 0x00F3

BM_SETSTYLE          := 0x00F4

BM_CLICK             := 0x00F5

BM_GETIMAGE          := 0x00F6

BM_SETIMAGE          := 0x00F7

BM_SETDONTCLICK      := 0x00F8     ; >= Vista

BCM_FIRST            := 0x1600

BCM_GETIDEALSIZE     := (BCM_FIRST + 0x0001)

BCM_SETIMAGELIST     := (BCM_FIRST + 0x0002)

BCM_GETIMAGELIST     := (BCM_FIRST + 0x0003)

BCM_SETTEXTMARGIN    := (BCM_FIRST + 0x0004)

BCM_GETTEXTMARGIN    := (BCM_FIRST + 0x0005)

BCM_SETDROPDOWNSTATE := (BCM_FIRST + 0x0006) ; >= Vista

BCM_SETSPLITINFO     := (BCM_FIRST + 0x0007) ; >= Vista

BCM_GETSPLITINFO     := (BCM_FIRST + 0x0008) ; >= Vista

BCM_SETNOTE          := (BCM_FIRST + 0x0009) ; >= Vista

BCM_GETNOTE          := (BCM_FIRST + 0x000A) ; >= Vista

BCM_GETNOTELENGTH    := (BCM_FIRST + 0x000B) ; >= Vista

BCM_SETSHIELD        := (BCM_FIRST + 0x000C) ; >= Vista

; Notifications ========================================================================================================

BN_CLICKED           := 0

BN_PAINT             := 1

BN_HILITE            := 2

BN_UNHILITE          := 3

BN_DISABLE           := 4

BN_DOUBLECLICKED     := 5

BN_PUSHED            := BN_HILITE

BN_UNPUSHED          := BN_UNHILITE

BN_DBLCLK            := BN_DOUBLECLICKED

BN_SETFOCUS          := 6

BN_KILLFOCUS         := 7

BCN_FIRST            := -1250

BCN_HOTITEMCHANGE    := (BCN_FIRST + 0x0001)

BCN_DROPDOWN         := (BCN_FIRST + 0x0002) ; >= Vista

; Styles ===============================================================================================================

BS_PUSHBUTTON        := 0x0000

BS_DEFPUSHBUTTON     := 0x0001

BS_CHECKBOX          := 0x0002

BS_AUTOCHECKBOX      := 0x0003

BS_RADIOBUTTON       := 0x0004

BS_3STATE            := 0x0005

BS_AUTO3STATE        := 0x0006

BS_GROUPBOX          := 0x0007

BS_USERBUTTON        := 0x0008

BS_AUTORADIOBUTTON   := 0x0009

BS_PUSHBOX           := 0x000A

BS_OWNERDRAW         := 0x000B

BS_TYPEMASK          := 0x000F

BS_LEFTTEXT          := 0x0020

BS_TEXT              := 0x0000

BS_ICON              := 0x0040

BS_BITMAP            := 0x0080

BS_LEFT              := 0x0100

BS_RIGHT             := 0x0200

BS_CENTER            := 0x0300

BS_TOP               := 0x0400

BS_BOTTOM            := 0x0800

BS_VCENTER           := 0x0C00

BS_PUSHLIKE          := 0x1000

BS_MULTILINE         := 0x2000

BS_NOTIFY            := 0x4000

BS_FLAT              := 0x8000

BS_RIGHTBUTTON       := BS_LEFTTEXT

BS_SPLITBUTTON       := 0x000C   ; >= Vista

BS_DEFSPLITBUTTON    := 0x000D   ; >= Vista

BS_COMMANDLINK       := 0x000E   ; >= Vista

BS_DEFCOMMANDLINK    := 0x000F   ; >= Vista

; Buton states =========================================================================================================

BST_UNCHECKED        := 0x0000

BST_CHECKED          := 0x0001

BST_INDETERMINATE    := 0x0002

BST_PUSHED           := 0x0004

BST_FOCUS            := 0x0008

BST_HOT              := 0x0200

BST_DROPDOWNPUSHED   := 0x0400   ; >= Vista

; Vista SPLIT BUTTON INFO mask flags

BCSIF_GLYPH          := 0x0001 =========================================================================================

BCSIF_IMAGE          := 0x0002

BCSIF_STYLE          := 0x0004

BCSIF_SIZE           := 0x0008

; Vista SPLIT BUTTON STYLE flags =======================================================================================

BCSS_NOSPLIT         := 0x0001

BCSS_STRETCH         := 0x0002

BCSS_ALIGNLEFT       := 0x0004

BCSS_IMAGE           := 0x0008

; Button ImageList Constants ===========================================================================================

BUTTON_IMAGELIST_ALIGN_RIGHT    := 1

BUTTON_IMAGELIST_ALIGN_TOP      := 2

BUTTON_IMAGELIST_ALIGN_BOTTOM   := 3

BUTTON_IMAGELIST_ALIGN_CENTER   := 4   ; Doesn't draw text

; ======================================================================================================================


Drugwash
  • Members
  • 1078 posts
  • Last active: May 24 2016 04:20 PM
  • Joined: 07 Sep 2008
If I'm allowed a personal opinion: I'd rather not do that. Gathering a lot of variables, whether they're all in a single big file or split in several smaller files, would still waste memory when only a few of them (especially in different categories) are really needed throughout a given script.
Unless, of course, these libraries would be stored in the lib folder and AHK would only load the variables (constants) required by the current script, as opposed to using #include and having all of them willy-nilly piled up in our script.

Personally I'd rather add some improvements to SKAN's Win32 Constants script, to allow building a value from several constants subsequently selected from the list (which BTW needs some updates, some of which I've added in my local copy of the constant database) that would easily be pasted into our script through clipboard operation.
But first it would need its ComboBox replaced with another combination of controls that are not limited in size under Win9x (I've already raised this issue in the above topic and partially solved it locally by replacing Combo's ListBox with a ListView).
Then the database should be cleaned up and brought to a common format and as much as I dislike Hex, I think it would be most appropriate. It's quite annoying to get a combined value that reads i.e. (WM_USER+39) - 39 being a decimal value - and then be presented with WM_USER as 0x400 (hex). Or RT_ANICURSOR and RT_ANIICON presented as (21) and (22) respectively, when there's no need for any paranthesis. :(

Please let me know what you think.

(AHK 1.0.48.05 and Win98SE) forever | My scripts are here


just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
Const_ComboBox.ahk:
; ======================================================================================================================

; Function:         Constants for ComboBox controls (ComboBox, DropDownList)

; AHK version:      -

; Language:         English

; Version:          1.0.00.00/2011-08-22/just me

; ======================================================================================================================

; Messages =============================================================================================================

CB_GETEDITSEL              := 0x0140

CB_LIMITTEXT               := 0x0141

CB_SETEDITSEL              := 0x0142

CB_ADDSTRING               := 0x0143

CB_DELETESTRING            := 0x0144

CB_DIR                     := 0x0145

CB_GETCOUNT                := 0x0146

CB_GETCURSEL               := 0x0147

CB_GETLBTEXT               := 0x0148

CB_GETLBTEXTLEN            := 0x0149

CB_INSERTSTRING            := 0x014A

CB_RESETCONTENT            := 0x014B

CB_FINDSTRING              := 0x014C

CB_SELECTSTRING            := 0x014D

CB_SETCURSEL               := 0x014E

CB_SHOWDROPDOWN            := 0x014F

CB_GETITEMDATA             := 0x0150

CB_SETITEMDATA             := 0x0151

CB_GETDROPPEDCONTROLRECT   := 0x0152

CB_SETITEMHEIGHT           := 0x0153

CB_GETITEMHEIGHT           := 0x0154

CB_SETEXTENDEDUI           := 0x0155

CB_GETEXTENDEDUI           := 0x0156

CB_GETDROPPEDSTATE         := 0x0157

CB_FINDSTRINGEXACT         := 0x0158

CB_SETLOCALE               := 0x0159

CB_GETLOCALE               := 0x015A

CB_GETTOPINDEX             := 0x015B

CB_SETTOPINDEX             := 0x015C

CB_GETHORIZONTALEXTENT     := 0x015D

CB_SETHORIZONTALEXTENT     := 0x015E

CB_GETDROPPEDWIDTH         := 0x015F

CB_SETDROPPEDWIDTH         := 0x0160

CB_INITSTORAGE             := 0x0161

CB_MULTIPLEADDSTRING       := 0x0163

CB_GETCOMBOBOXINFO         := 0x0164

; Notifications ========================================================================================================

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

; Styles ===============================================================================================================

CBS_SIMPLE                 := 0x0001

CBS_DROPDOWN               := 0x0002

CBS_DROPDOWNLIST           := 0x0003

CBS_OWNERDRAWFIXED         := 0x0010

CBS_OWNERDRAWVARIABLE      := 0x0020

CBS_AUTOHSCROLL            := 0x0040

CBS_OEMCONVERT             := 0x0080

CBS_SORT                   := 0x0100

CBS_HASSTRINGS             := 0x0200

CBS_NOINTEGRALHEIGHT       := 0x0400

CBS_DISABLENOSCROLL        := 0x0800

CBS_UPPERCASE              := 0x2000

CBS_LOWERCASE              := 0x4000

; ======================================================================================================================


just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
@Drugwash:

People are different, fortunately. So I personally like to have the definitions as plain files which can be included, printed or loaded into your editor to look at or to do some copy&paste.

I copy the names and values from WinUser.h and CommCtrl.h and convert them manually for now, and I'd think SKAN has an equivalent source. That's why you find values like (BCM_FIRST + 0x0001), because BCM_FIRST is defined as the first BCM message. Maybe MS will change this value one day.

So I'll go on with this. :wink:

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
... nearly forgot this:

Const_ListBox.ahk:
; ======================================================================================================================
; Function:         Constants for ListBox controls
; AHK version:      -
; Language:         English
; Version:          1.0.00.00/2011-08-21/just me
; ======================================================================================================================
; Messages =============================================================================================================
LB_ADDSTRING            := 0x0180
LB_INSERTSTRING         := 0x0181
LB_DELETESTRING         := 0x0182
LB_SELITEMRANGEEX       := 0x0183
LB_RESETCONTENT         := 0x0184
LB_SETSEL               := 0x0185
LB_SETCURSEL            := 0x0186
LB_GETSEL               := 0x0187
LB_GETCURSEL            := 0x0188
LB_GETTEXT              := 0x0189
LB_GETTEXTLEN           := 0x018A
LB_GETCOUNT             := 0x018B
LB_SELECTSTRING         := 0x018C
LB_DIR                  := 0x018D
LB_GETTOPINDEX          := 0x018E
LB_FINDSTRING           := 0x018F
LB_GETSELCOUNT          := 0x0190
LB_GETSELITEMS          := 0x0191
LB_SETTABSTOPS          := 0x0192
LB_GETHORIZONTALEXTENT  := 0x0193
LB_SETHORIZONTALEXTENT  := 0x0194
LB_SETCOLUMNWIDTH       := 0x0195
LB_ADDFILE              := 0x0196
LB_SETTOPINDEX          := 0x0197
LB_GETITEMRECT          := 0x0198
LB_GETITEMDATA          := 0x0199
LB_SETITEMDATA          := 0x019A
LB_SELITEMRANGE         := 0x019B
LB_SETANCHORINDEX       := 0x019C
LB_GETANCHORINDEX       := 0x019D
LB_SETCARETINDEX        := 0x019E
LB_GETCARETINDEX        := 0x019F
LB_SETITEMHEIGHT        := 0x01A0
LB_GETITEMHEIGHT        := 0x01A1
LB_FINDSTRINGEXACT      := 0x01A2
LB_SETLOCALE            := 0x01A5
LB_GETLOCALE            := 0x01A6
LB_SETCOUNT             := 0x01A7
LB_INITSTORAGE          := 0x01A8
LB_ITEMFROMPOINT        := 0x01A9
LB_MULTIPLEADDSTRING    := 0x01B1
LB_GETLISTBOXINFO       := 0x01B2
; Notifications ========================================================================================================
LBN_ERRSPACE            := -2
LBN_SELCHANGE           := 1
LBN_DBLCLK              := 2
LBN_SELCANCEL           := 3
LBN_SETFOCUS            := 4
LBN_KILLFOCUS           := 5
; Styles ===============================================================================================================
LBS_NOTIFY              := 0x0001
LBS_SORT                := 0x0002
LBS_NOREDRAW            := 0x0004
LBS_MULTIPLESEL         := 0x0008
LBS_OWNERDRAWFIXED      := 0x0010
LBS_OWNERDRAWVARIABLE   := 0x0020
LBS_HASSTRINGS          := 0x0040
LBS_USETABSTOPS         := 0x0080
LBS_NOINTEGRALHEIGHT    := 0x0100
LBS_MULTICOLUMN         := 0x0200
LBS_WANTKEYBOARDINPUT   := 0x0400
LBS_EXTENDEDSEL         := 0x0800
LBS_DISABLENOSCROLL     := 0x1000
LBS_NODATA              := 0x2000
LBS_NOSEL               := 0x4000
LBS_COMBOBOX            := 0x8000
LBS_STANDARD            := (LBS_NOTIFY | LBS_SORT) | (0x200000 | 0x800000)  ; (WS_VSCROLL | WS_BORDER)
; Errors ===============================================================================================================
LB_OKAY                 := 0
LB_ERR                  := -1
LB_ERRSPACE             := -2
; ======================================================================================================================


Drugwash
  • Members
  • 1078 posts
  • Last active: May 24 2016 04:20 PM
  • Joined: 07 Sep 2008

I personally like to have the definitions as plain files which can be included, printed or loaded into your editor to look at or to do some copy&paste.

You can easily do that with Constants.W32.ini

I copy the names and values from WinUser.h and CommCtrl.h and convert them manually for now [...]

I don't see any conversion. Otherwise there wouldn't be LBN_KILLFOCUS := 5 (DECIMAL) and LBS_NOTIFY := 0x0001 (HEX) at two lines one from another. Or did you miss the common format piece of information in my previous post? Mixing Hex and Decimal is bad and this is what I tried to point out. Of course, all the values are taken from M$'s header files and apparently they have no intention to change this. But we don't have to follow this "masochistic" way.

So I'll go on with this.

Please, do. I see you already got a lot of fans... :roll:

(AHK 1.0.48.05 and Win98SE) forever | My scripts are here


Zod
  • Members
  • 214 posts
  • Last active: Jan 26 2012 08:02 PM
  • Joined: 06 Jul 2011
Being both a user of the evil parent and the heavenly son, This is one of the many included pieces of content automatically downloaded with the installer. Thanks for posting
Posted Image Stolen from SKAN

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
Const_UpDown.ahk:
; ======================================================================================================================

; Function:         Constants for UpDown controls

; AHK version:      -

; Language:         English

; Version:          1.0.00.00/2011-08-22/just me

; ======================================================================================================================

UPDOWN_CLASS            := "msctls_updown32"

WM_USER                 := 0x400

CCM_FIRST               := 0x2000

; Messages =============================================================================================================

UDM_SETRANGE            := (WM_USER + 101)

UDM_GETRANGE            := (WM_USER + 102)

UDM_SETPOS              := (WM_USER + 103)

UDM_GETPOS              := (WM_USER + 104)

UDM_SETBUDDY            := (WM_USER + 105)

UDM_GETBUDDY            := (WM_USER + 106)

UDM_SETACCEL            := (WM_USER + 107)

UDM_GETACCEL            := (WM_USER + 108)

UDM_SETBASE             := (WM_USER + 109)

UDM_GETBASE             := (WM_USER + 110)

UDM_SETRANGE32          := (WM_USER + 111)

UDM_GETRANGE32          := (WM_USER + 112)         ; wParam & lParam are LPINT

UDM_SETUNICODEFORMAT    := (CCM_FIRST + 5)         ; CCM_SETUNICODEFORMAT

UDM_GETUNICODEFORMAT    := (CCM_FIRST + 6)         ; CCM_GETUNICODEFORMAT

UDM_SETPOS32            := (WM_USER + 113)

UDM_GETPOS32            := (WM_USER + 114)

; Notifications ========================================================================================================

UDN_FIRST               := -721

UDN_DELTAPOS            := (UDN_FIRST - 1)

; Styles ===============================================================================================================

UDS_WRAP                := 0x0001

UDS_SETBUDDYINT         := 0x0002

UDS_ALIGNRIGHT          := 0x0004

UDS_ALIGNLEFT           := 0x0008

UDS_AUTOBUDDY           := 0x0010

UDS_ARROWKEYS           := 0x0020

UDS_HORZ                := 0x0040

UDS_NOTHOUSANDS         := 0x0080

UDS_HOTTRACK            := 0x0100

; ======================================================================================================================


just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

I don't see any conversion. Otherwise there wouldn't be LBN_KILLFOCUS := 5 (DECIMAL) and LBS_NOTIFY := 0x0001 (HEX) at two lines one from another. Or did you miss the common format piece of information in my previous post? Mixing Hex and Decimal is bad and this is what I tried to point out. Of course, all the values are taken from M$'s header files and apparently they have no intention to change this. But we don't have to follow this "masochistic" way.

I really don't understand your problem. All this scripts are intended to do is to give you a name for a value, the format of the value doesn't matter as long as it produces a proper result.

Please, do. I see you already got a lot of fans... :roll:

Well, there's Zod! THX, Zod. :wink:

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
Const_DateTime.ahk:
; ======================================================================================================================

; Function:         Constants for DateTime controls

; AHK version:      -

; Language:         English

; Version:          1.0.00.00/2011-08-23/just me

; ======================================================================================================================

DATETIME_CLASS             := "SysDateTimePick32"

DTM_FIRST                  := 0x1000

DTN_FIRST                  := -740              ; datetimepick

DTN_FIRST2                 := -753              ; datetimepick2

; Messages =============================================================================================================

DTM_GETSYSTEMTIME          := (DTM_FIRST + 1)

DTM_SETSYSTEMTIME          := (DTM_FIRST + 2)

DTM_GETRANGE               := (DTM_FIRST + 3)

DTM_SETRANGE               := (DTM_FIRST + 4)

DTM_SETFORMATA             := (DTM_FIRST + 5)

DTM_SETMCCOLOR             := (DTM_FIRST + 6)

DTM_GETMCCOLOR             := (DTM_FIRST + 7)

DTM_GETMONTHCAL            := (DTM_FIRST + 8)

DTM_SETMCFONT              := (DTM_FIRST + 9)

DTM_GETMCFONT              := (DTM_FIRST + 10)

DTM_SETMCSTYLE             := (DTM_FIRST + 11)   ; >= Vista

DTM_GETMCSTYLE             := (DTM_FIRST + 12)   ; >= Vista

DTM_CLOSEMONTHCAL          := (DTM_FIRST + 13)   ; >= Vista

DTM_GETDATETIMEPICKERINFO  := (DTM_FIRST + 14)   ; >= Vista

DTM_GETIDEALSIZE           := (DTM_FIRST + 15)   ; >= Vista

DTM_SETFORMATW             := (DTM_FIRST + 50)

; Notifications ========================================================================================================

DTN_FORMATQUERYW           := (DTN_FIRST - 2)   ; -742

DTN_FORMATW                := (DTN_FIRST - 3)   ; -743

DTN_WMKEYDOWNW             := (DTN_FIRST - 4)   ; -744

DTN_USERSTRINGW            := (DTN_FIRST - 5)   ; -745

DTN_CLOSEUP                := (DTN_FIRST2)      ; MonthCal is popping up, -753

DTN_DROPDOWN               := (DTN_FIRST2 - 1)  ; MonthCal has dropped down, -754

DTN_FORMATQUERYA           := (DTN_FIRST2 - 2)  ; query formatting info for app format field := (X), -755

DTN_FORMATA                := (DTN_FIRST2 - 3)  ; query display for app format field := (X), -756

DTN_WMKEYDOWNA             := (DTN_FIRST2 - 4)  ; modify keydown on app format field := (X), , -757

DTN_USERSTRINGA            := (DTN_FIRST2 - 5)  ; the user has entered a string, -758

DTN_DATETIMECHANGE         := (DTN_FIRST2 - 6)  ; the systemtime has changed, -759

; Styles ===============================================================================================================

DTS_SHORTDATEFORMAT        := 0x0000   ; use the short date format (app must forward WM_WININICHANGE messages)

DTS_UPDOWN                 := 0x0001   ; use UPDOWN instead of MONTHCAL

DTS_SHOWNONE               := 0x0002   ; allow a NONE selection

DTS_LONGDATEFORMAT         := 0x0004   ; use the long date format (app must forward WM_WININICHANGE messages)

DTS_TIMEFORMAT             := 0x0009   ; use the time format (app must forward WM_WININICHANGE messages)

DTS_SHORTDATECENTURYFORMAT := 0x000C   ; short date format with century (app must forward WM_WININICHANGE messages)

DTS_APPCANPARSE            := 0x0010   ; allow user entered strings (app MUST respond to DTN_USERSTRING)

DTS_RIGHTALIGN             := 0x0020   ; right-align popup instead of left-align it

; Errors and Other =====================================================================================================

GDT_ERROR      := -1

GDT_VALID      := 0

GDT_NONE       := 1

GDTR_MIN       := 0x0001

GDTR_MAX       := 0x0002

; ======================================================================================================================


just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
Const_MonthCal.ahk:
; ======================================================================================================================
; Function:         Constants for MonthCal controls
; AHK version:      -
; Language:         English
; Version:          1.0.00.00/2011-08-24/just me
; ======================================================================================================================
MONTHCAL_CLASS          := "SysMonthCal32"
CCM_FIRST               := 0x2000
MCM_FIRST               := 0x1000
MCN_FIRST               := -746
; Messages =============================================================================================================
MCM_GETCURSEL           := (MCM_FIRST + 1)
MCM_SETCURSEL           := (MCM_FIRST + 2)
MCM_GETMAXSELCOUNT      := (MCM_FIRST + 3)
MCM_SETMAXSELCOUNT      := (MCM_FIRST + 4)
MCM_GETSELRANGE         := (MCM_FIRST + 5)
MCM_SETSELRANGE         := (MCM_FIRST + 6)
MCM_GETMONTHRANGE       := (MCM_FIRST + 7)
MCM_SETDAYSTATE         := (MCM_FIRST + 8)
MCM_GETMINREQRECT       := (MCM_FIRST + 9)
MCM_SETCOLOR            := (MCM_FIRST + 10)
MCM_GETCOLOR            := (MCM_FIRST + 11)
MCM_SETTODAY            := (MCM_FIRST + 12)
MCM_GETTODAY            := (MCM_FIRST + 13)
MCM_HITTEST             := (MCM_FIRST + 14)
MCM_SETFIRSTDAYOFWEEK   := (MCM_FIRST + 15)
MCM_GETFIRSTDAYOFWEEK   := (MCM_FIRST + 16)
MCM_GETRANGE            := (MCM_FIRST + 17)
MCM_SETRANGE            := (MCM_FIRST + 18)
MCM_GETMONTHDELTA       := (MCM_FIRST + 19)
MCM_SETMONTHDELTA       := (MCM_FIRST + 20)
MCM_SETUNICODEFORMAT    := (CCM_FIRST + 5)   ; CCM_SETUNICODEFORMAT
MCM_GETUNICODEFORMAT    := (CCM_FIRST + 6)   ; CCM_GETUNICODEFORMAT
MCM_GETCURRENTVIEW      := (MCM_FIRST + 22)  ; >= Vista
MCM_GETCALENDARCOUNT    := (MCM_FIRST + 23)  ; >= Vista
MCM_GETCALENDARGRIDINFO := (MCM_FIRST + 24)  ; >= Vista
MCM_GETCALID            := (MCM_FIRST + 27)  ; >= Vista
MCM_SETCALID            := (MCM_FIRST + 28)  ; >= Vista
MCM_SIZERECTTOMIN       := (MCM_FIRST + 29)  ; >= Vista
MCM_SETCALENDARBORDER   := (MCM_FIRST + 30)  ; >= Vista
MCM_GETCALENDARBORDER   := (MCM_FIRST + 31)  ; >= Vista
MCM_SETCURRENTVIEW      := (MCM_FIRST + 32)  ; >= Vista
; Notifications ========================================================================================================
MCN_SELECT              := (MCN_FIRST)       ; -746
MCN_GETDAYSTATE         := (MCN_FIRST - 1)   ; -747
MCN_SELCHANGE           := (MCN_FIRST - 3)   ; -749
MCN_VIEWCHANGE          := (MCN_FIRST - 4)   ; -750
; Styles ===============================================================================================================
MCS_DAYSTATE            := 0x0001
MCS_MULTISELECT         := 0x0002
MCS_WEEKNUMBERS         := 0x0004
MCS_NOTODAYCIRCLE       := 0x0008
MCS_NOTODAY             := 0x0010
MCS_NOTRAILINGDATES     := 0x0040  ; >= Vista
MCS_SHORTDAYSOFWEEK     := 0x0080  ; >= Vista
MCS_NOSELCHANGEONNAV    := 0x0100  ; >= Vista
; Errors and Other =====================================================================================================
; MCM_GET/SETCOLOROR
MCSC_BACKGROUND         := 0   ; the background color := (between months)
MCSC_TEXT               := 1   ; the dates
MCSC_TITLEBK            := 2   ; background of the title
MCSC_TITLETEXT          := 3
MCSC_MONTHBK            := 4   ; background within the month cal
MCSC_TRAILINGTEXT       := 5   ; the text color of header & trailing days
; MCM_HITTET
MCHT_TITLE              := 0x00010000
MCHT_CALENDAR           := 0x00020000
MCHT_TODAYLINK          := 0x00030000
MCHT_CALENDARCONTROL    := 0x00100000  ; >= Vista
MCHT_NEXT               := 0x01000000  ; these indicate that hitting
MCHT_PREV               := 0x02000000  ; here will go to the next/prev month
MCHT_NOWHERE            := 0x00000000
MCHT_TITLEBK            := (MCHT_TITLE)
MCHT_TITLEMONTH         := (MCHT_TITLE | 0x0001)
MCHT_TITLEYEAR          := (MCHT_TITLE | 0x0002)
MCHT_TITLEBTNNEXT       := (MCHT_TITLE | MCHT_NEXT | 0x0003)
MCHT_TITLEBTNPREV       := (MCHT_TITLE | MCHT_PREV | 0x0003)
MCHT_CALENDARBK         := (MCHT_CALENDAR)
MCHT_CALENDARDATE       := (MCHT_CALENDAR | 0x0001)
MCHT_CALENDARDATENEXT   := (MCHT_CALENDARDATE | MCHT_NEXT)
MCHT_CALENDARDATEPREV   := (MCHT_CALENDARDATE | MCHT_PREV)
MCHT_CALENDARDAY        := (MCHT_CALENDAR | 0x0002)
MCHT_CALENDARWEEKNUM    := (MCHT_CALENDAR | 0x0003)
MCHT_CALENDARDATEMIN    := (MCHT_CALENDAR | 0x0004)
MCHT_CALENDARDATEMAX    := (MCHT_CALENDAR | 0x0005)
; MCM_GET/SETCURRENTVIEW >= Vista
MCMV_MONTH              := 0
MCMV_YEAR               := 1
MCMV_DECADE             := 2
MCMV_CENTURY            := 3
MCMV_MAX                := MCMV_CENTURY
; MCM_GET/SETCALENDARGRIDINFO >= Vista
MCGIP_CALENDARCONTROL   := 0
MCGIP_NEXT              := 1
MCGIP_PREV              := 2
MCGIP_FOOTER            := 3
MCGIP_CALENDAR          := 4
MCGIP_CALENDARHEADER    := 5
MCGIP_CALENDARBODY      := 6
MCGIP_CALENDARROW       := 7
MCGIP_CALENDARCELL      := 8
MCGIF_DATE              := 0x00000001
MCGIF_RECT              := 0x00000002
MCGIF_NAME              := 0x00000004
; ======================================================================================================================
Update on 2011-09-03: Fixed leftover // comments!

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
Const_Tab.ahk:
; ======================================================================================================================

; Function:         Constants for Tab controls (Tab2)

; AHK version:      -

; Language:         English

; Version:          1.0.00.00/2011-08-26/just me

; ======================================================================================================================

TAB_CLASS               := "SysTabControl32"

CCM_FIRST               := 0x2000

TCM_FIRST               := 0x1300            ; Tab control messages

TCN_FIRST               := -550              ; Tab control notifications

; Messages =============================================================================================================

TCM_GETIMAGELIST        := (TCM_FIRST + 2)

TCM_SETIMAGELIST        := (TCM_FIRST + 3)

TCM_GETITEMCOUNT        := (TCM_FIRST + 4)

TCM_GETITEMA            := (TCM_FIRST + 5)

TCM_SETITEMA            := (TCM_FIRST + 6)

TCM_INSERTITEMA         := (TCM_FIRST + 7)

TCM_DELETEITEM          := (TCM_FIRST + 8)

TCM_DELETEALLITEMS      := (TCM_FIRST + 9)

TCM_INSERTITEMW         := (TCM_FIRST + 62)

TCM_GETITEMRECT         := (TCM_FIRST + 10)

TCM_GETCURSEL           := (TCM_FIRST + 11)

TCM_SETCURSEL           := (TCM_FIRST + 12)

TCM_HITTEST             := (TCM_FIRST + 13)

TCM_SETITEMEXTRA        := (TCM_FIRST + 14)

TCM_ADJUSTRECT          := (TCM_FIRST + 40)

TCM_SETITEMSIZE         := (TCM_FIRST + 41)

TCM_REMOVEIMAGE         := (TCM_FIRST + 42)

TCM_SETPADDING          := (TCM_FIRST + 43)

TCM_GETROWCOUNT         := (TCM_FIRST + 44)

TCM_GETTOOLTIPS         := (TCM_FIRST + 45)

TCM_SETTOOLTIPS         := (TCM_FIRST + 46)

TCM_GETCURFOCUS         := (TCM_FIRST + 47)

TCM_SETCURFOCUS         := (TCM_FIRST + 48)

TCM_SETMINTABWIDTH      := (TCM_FIRST + 49)

TCM_DESELECTALL         := (TCM_FIRST + 50)

TCM_HIGHLIGHTITEM       := (TCM_FIRST + 51)

TCM_SETEXTENDEDSTYLE    := (TCM_FIRST + 52)  ; optional wParam == mask

TCM_GETEXTENDEDSTYLE    := (TCM_FIRST + 53)

TCM_GETITEMW            := (TCM_FIRST + 60)

TCM_SETITEMW            := (TCM_FIRST + 61)

TCM_INSERTITEMW         := (TCM_FIRST + 62)

TCM_SETUNICODEFORMAT    := (CCM_FIRST + 5)   ; CCM_SETUNICODEFORMAT

TCM_GETUNICODEFORMAT    := (CCM_FIRST + 6)   ; CCM_GETUNICODEFORMAT

; Notifications ========================================================================================================

TCN_KEYDOWN             := (TCN_FIRST - 0)

TCN_SELCHANGE           := (TCN_FIRST - 1)

TCN_SELCHANGING         := (TCN_FIRST - 2)

TCN_GETOBJECT           := (TCN_FIRST - 3)

TCN_FOCUSCHANGE         := (TCN_FIRST - 4)

; Styles ===============================================================================================================

TCS_SCROLLOPPOSITE      := 0x0001            ; assumes multiline tab

TCS_BOTTOM              := 0x0002

TCS_RIGHT               := 0x0002

TCS_MULTISELECT         := 0x0004            ; allow multi-select in button mode

TCS_FLATBUTTONS         := 0x0008

TCS_FORCEICONLEFT       := 0x0010

TCS_FORCELABELLEFT      := 0x0020

TCS_HOTTRACK            := 0x0040

TCS_VERTICAL            := 0x0080

TCS_TABS                := 0x0000

TCS_BUTTONS             := 0x0100

TCS_SINGLELINE          := 0x0000

TCS_MULTILINE           := 0x0200

TCS_RIGHTJUSTIFY        := 0x0000

TCS_FIXEDWIDTH          := 0x0400

TCS_RAGGEDRIGHT         := 0x0800

TCS_FOCUSONBUTTONDOWN   := 0x1000

TCS_OWNERDRAWFIXED      := 0x2000

TCS_TOOLTIPS            := 0x4000

TCS_FOCUSNEVER          := 0x8000

; ExStyles =============================================================================================================

TCS_EX_FLATSEPARATORS   := 0x00000001

TCS_EX_REGISTERDROP     := 0x00000002

; Errors and Other =====================================================================================================

; TCITEM mask

TCIF_TEXT               := 0x0001

TCIF_IMAGE              := 0x0002

TCIF_RTLREADING         := 0x0004

TCIF_PARAM              := 0x0008

TCIF_STATE              := 0x0010

; TCITEM dwState

TCIS_BUTTONPRESSED      := 0x0001

TCIS_HIGHLIGHTED        := 0x0002

; TCHITTESTINFO flags

TCHT_NOWHERE            := 0x0001

TCHT_ONITEMICON         := 0x0002

TCHT_ONITEMLABEL        := 0x0004

TCHT_ONITEM             := (TCHT_ONITEMICON | TCHT_ONITEMLABEL)

; ======================================================================================================================