'==============================================================================
' WinAPI Core Constants for PBXA64
' (C) 2026 Theo Gottwald / www.smart-package.com
'==============================================================================

' --- Boolean ---
%TRUE  = -1
%FALSE = 0

' --- Standard Handles ---
%NULL = 0
%INVALID_HANDLE_VALUE = -1

' --- Console Handles ---
%STD_INPUT_HANDLE  = -10&
%STD_OUTPUT_HANDLE = -11&
%STD_ERROR_HANDLE  = -12&

' --- File Access ---
%GENERIC_READ    = &H80000000
%GENERIC_WRITE   = &H40000000
%GENERIC_EXECUTE = &H20000000
%GENERIC_ALL     = &H10000000

' --- File Share ---
%FILE_SHARE_READ   = 1
%FILE_SHARE_WRITE  = 2
%FILE_SHARE_DELETE = 4

' --- File Creation ---
%CREATE_NEW        = 1
%CREATE_ALWAYS     = 2
%OPEN_EXISTING     = 3
%OPEN_ALWAYS       = 4
%TRUNCATE_EXISTING = 5

' --- File Attributes ---
%FILE_ATTRIBUTE_READONLY   = 1
%FILE_ATTRIBUTE_HIDDEN     = 2
%FILE_ATTRIBUTE_SYSTEM     = 4
%FILE_ATTRIBUTE_DIRECTORY  = 16
%FILE_ATTRIBUTE_ARCHIVE    = 32
%FILE_ATTRIBUTE_NORMAL     = 128
%FILE_ATTRIBUTE_TEMPORARY  = 256

' --- File Position ---
%FILE_BEGIN   = 0
%FILE_CURRENT = 1
%FILE_END     = 2

' --- Memory ---
%MEM_COMMIT  = &H1000
%MEM_RESERVE = &H2000
%MEM_RELEASE = &H8000
%PAGE_READWRITE       = 4
%PAGE_READONLY        = 2
%PAGE_EXECUTE_READWRITE = &H40

' --- Process ---
%PROCESS_ALL_ACCESS = &H1FFFFF
%PROCESS_QUERY_INFORMATION = &H0400
%PROCESS_VM_READ    = &H0010
%PROCESS_VM_WRITE   = &H0020
%PROCESS_VM_OPERATION = &H0008

' --- Thread ---
%THREAD_ALL_ACCESS = &H1FFFFF

' --- Wait ---
%WAIT_OBJECT_0  = 0
%WAIT_TIMEOUT   = 258
%WAIT_FAILED    = &HFFFFFFFF
%INFINITE       = &HFFFFFFFF

' --- MessageBox ---
%MB_OK               = 0
%MB_OKCANCEL         = 1
%MB_ABORTRETRYIGNORE = 2
%MB_YESNOCANCEL      = 3
%MB_YESNO            = 4
%MB_RETRYCANCEL      = 5
%MB_ICONERROR        = 16
%MB_ICONQUESTION     = 32
%MB_ICONWARNING      = 48
%MB_ICONINFORMATION  = 64

' --- MessageBox Return ---
%IDOK     = 1
%IDCANCEL = 2
%IDABORT  = 3
%IDRETRY  = 4
%IDIGNORE = 5
%IDYES    = 6
%IDNO     = 7

' --- Window Styles ---
%WS_OVERLAPPED   = &H00000000
%WS_POPUP        = &H80000000
%WS_CHILD        = &H40000000
%WS_MINIMIZE     = &H20000000
%WS_VISIBLE      = &H10000000
%WS_DISABLED     = &H08000000
%WS_CLIPSIBLINGS = &H04000000
%WS_CLIPCHILDREN = &H02000000
%WS_MAXIMIZE     = &H01000000
%WS_CAPTION      = &H00C00000
%WS_BORDER       = &H00800000
%WS_DLGFRAME     = &H00400000
%WS_VSCROLL      = &H00200000
%WS_HSCROLL      = &H00100000
%WS_SYSMENU      = &H00080000
%WS_THICKFRAME   = &H00040000
%WS_GROUP        = &H00020000
%WS_TABSTOP      = &H00010000
%WS_OVERLAPPEDWINDOW = &H00CF0000

' --- Window Extended Styles ---
%WS_EX_TOPMOST     = &H00000008
%WS_EX_LAYERED     = &H00080000
%WS_EX_TOOLWINDOW  = &H00000080
%WS_EX_APPWINDOW   = &H00040000

' --- Show Window ---
%SW_HIDE            = 0
%SW_SHOWNORMAL      = 1
%SW_SHOWMINIMIZED   = 2
%SW_SHOWMAXIMIZED   = 3
%SW_SHOWNOACTIVATE  = 4
%SW_SHOW            = 5
%SW_MINIMIZE        = 6
%SW_SHOWMINNOACTIVE = 7
%SW_SHOWNA          = 8
%SW_RESTORE         = 9

' --- Color ---
%COLOR_WINDOW       = 5
%COLOR_BTNFACE      = 15
%COLOR_HIGHLIGHT    = 13
%RGB_BLACK   = &H00000000
%RGB_WHITE   = &H00FFFFFF
%RGB_RED     = &H000000FF
%RGB_GREEN   = &H0000FF00
%RGB_BLUE    = &H00FF0000

' --- Registry ---
%HKEY_CLASSES_ROOT   = &H80000000
%HKEY_CURRENT_USER   = &H80000001
%HKEY_LOCAL_MACHINE  = &H80000002
%HKEY_USERS          = &H80000003
%KEY_READ  = &H20019
%KEY_WRITE = &H20006
%KEY_ALL_ACCESS = &HF003F
%REG_SZ        = 1
%REG_DWORD     = 4

' --- Error ---
%ERROR_SUCCESS        = 0
%ERROR_FILE_NOT_FOUND = 2
%ERROR_PATH_NOT_FOUND = 3
%ERROR_ACCESS_DENIED  = 5
%ERROR_INVALID_HANDLE = 6
%ERROR_NOT_ENOUGH_MEMORY = 8
%ERROR_NO_MORE_FILES  = 18
%ERROR_ALREADY_EXISTS = 183

' --- Drive Types ---
%DRIVE_UNKNOWN     = 0
%DRIVE_NO_ROOT_DIR = 1
%DRIVE_REMOVABLE   = 2
%DRIVE_FIXED       = 3
%DRIVE_REMOTE      = 4
%DRIVE_CDROM       = 5
%DRIVE_RAMDISK     = 6

' --- Window Messages ---
%WM_NULL            = &H0000
%WM_CREATE          = &H0001
%WM_DESTROY         = &H0002
%WM_MOVE            = &H0003
%WM_SIZE            = &H0005
%WM_ACTIVATE        = &H0006
%WM_SETFOCUS        = &H0007
%WM_KILLFOCUS       = &H0008
%WM_ENABLE          = &H000A
%WM_SETTEXT         = &H000C
%WM_GETTEXT         = &H000D
%WM_GETTEXTLENGTH   = &H000E
%WM_PAINT           = &H000F
%WM_CLOSE           = &H0010
%WM_QUIT            = &H0012
%WM_ERASEBKGND      = &H0014
%WM_SYSCOLORCHANGE  = &H0015
%WM_SHOWWINDOW      = &H0018
%WM_ACTIVATEAPP     = &H001C
%WM_GETMINMAXINFO   = &H0024
%WM_WINDOWPOSCHANGING = &H0046
%WM_WINDOWPOSCHANGED  = &H0047
%WM_CANCELMODE      = &H001F
%WM_TIMER           = &H0113
%WM_HSCROLL         = &H0114
%WM_VSCROLL         = &H0115
%WM_INITDIALOG      = &H0110
%WM_COMMAND         = &H0111
%WM_SYSCOMMAND      = &H0112
%WM_CTLCOLORMSGBOX  = &H0132
%WM_CTLCOLOREDIT    = &H0133
%WM_CTLCOLORLISTBOX = &H0134
%WM_CTLCOLORBTN     = &H0135
%WM_CTLCOLORDLG     = &H0136
%WM_CTLCOLORSCROLLBAR = &H0137
%WM_CTLCOLORSTATIC  = &H0138
%WM_MOUSEMOVE       = &H0200
%WM_LBUTTONDOWN     = &H0201
%WM_LBUTTONUP       = &H0202
%WM_LBUTTONDBLCLK   = &H0203
%WM_RBUTTONDOWN     = &H0204
%WM_RBUTTONUP       = &H0205
%WM_RBUTTONDBLCLK   = &H0206
%WM_MBUTTONDOWN     = &H0207
%WM_MBUTTONUP       = &H0208
%WM_MBUTTONDBLCLK   = &H0209
%WM_MOUSEWHEEL      = &H020A
%WM_KEYDOWN         = &H0100
%WM_KEYUP           = &H0101
%WM_CHAR            = &H0102
%WM_NOTIFY          = &H004E
%WM_USER            = &H0400
%SC_CLOSE           = &HF060
%SC_MINIMIZE        = &HF020
%SC_MAXIMIZE        = &HF030
%SC_RESTORE         = &HF120
%SC_MOVE            = &HF010
%SC_SIZE            = &HF000

' --- Button Styles ---
%BS_PUSHBUTTON       = &H0000
%BS_DEFPUSHBUTTON    = &H0001
%BS_CHECKBOX         = &H0002
%BS_AUTOCHECKBOX     = &H0003
%BS_RADIOBUTTON      = &H0004
%BS_3STATE           = &H0005
%BS_AUTO3STATE       = &H0006
%BS_GROUPBOX         = &H0007
%BS_AUTORADIOBUTTON  = &H0009
%BS_OWNERDRAW        = &H000B
%BS_LEFT             = &H0100
%BS_RIGHT            = &H0200
%BS_CENTER           = &H0300
%BS_TOP              = &H0400
%BS_VCENTER          = &H0C00
%BS_BOTTOM           = &H0800
%BS_MULTILINE        = &H2000
%BS_FLAT             = &H8000

' --- Edit Styles ---
%ES_LEFT        = &H0000
%ES_CENTER      = &H0001
%ES_RIGHT       = &H0002
%ES_MULTILINE   = &H0004
%ES_UPPERCASE   = &H0008
%ES_LOWERCASE   = &H0010
%ES_PASSWORD    = &H0020
%ES_AUTOVSCROLL = &H0040
%ES_AUTOHSCROLL = &H0080
%ES_NOHIDESEL   = &H0100
%ES_READONLY    = &H0800
%ES_WANTRETURN  = &H1000
%ES_NUMBER      = &H2000

' --- List-View Styles ---
%LVS_ICON          = &H0000
%LVS_REPORT        = &H0001
%LVS_SMALLICON     = &H0002
%LVS_LIST          = &H0003
%LVS_TYPEMASK      = &H0003
%LVS_ALIGNTOP      = &H0000
%LVS_ALIGNLEFT     = &H0800
%LVS_AUTOARRANGE   = &H0100
%LVS_EDITLABELS    = &H0200
%LVS_NOSORTHEADER  = &H8000
%LVS_NOLABELWRAP   = &H0080
%LVS_SHOWSELALWAYS = &H0008
%LVS_SINGLESEL     = &H0004
%LVS_SORTASCENDING = &H0010
%LVS_SORTDESCENDING = &H0020

' --- Tree-View Styles ---
%TVS_HASLINES       = &H0002
%TVS_HASBUTTONS     = &H0001
%TVS_LINESATROOT    = &H0004
%TVS_EDITLABELS     = &H0008
%TVS_DISABLEDRAGDROP = &H0010
%TVS_SHOWSELALWAYS  = &H0020
%TVS_RTLREADING     = &H0040
%TVS_NOTOOLTIPS     = &H0080
%TVS_CHECKBOXES     = &H0100
%TVS_TRACKSELECT    = &H0200
%TVS_FULLROWSELECT  = &H1000
%TVS_INFOTIP        = &H0800
%TVS_NONEVENHEIGHT  = &H4000
%TVS_NOSCROLL       = &H2000

' --- Toolbar Styles ---
%TBSTYLE_TOOLTIPS     = &H0100
%TBSTYLE_WRAPABLE     = &H0200
%TBSTYLE_ALTDRAG      = &H0400
%TBSTYLE_FLAT         = &H0800
%TBSTYLE_LIST         = &H1000
%TBSTYLE_TRANSPARENT  = &H8000

' --- Common Control Styles ---
%CCS_TOP          = &H0001
%CCS_NOMOVEY      = &H0002
%CCS_BOTTOM       = &H0003
%CCS_NORESIZE     = &H0004
%CCS_NOPARENTALIGN = &H0008
%CCS_NODIVIDER    = &H0040
%CCS_ADJUSTABLE   = &H0020
%CCS_LEFT         = &H0081
%CCS_RIGHT        = &H0082

' --- Status Bar Styles ---
%SBARS_SIZEGRIP  = &H0100

' --- Progress Bar Styles ---
%PBS_SMOOTH    = &H0001
%PBS_VERTICAL  = &H0004
%PBS_MARQUEE   = &H0008

' --- Scroll Bar Styles ---
%SBS_VERT   = &H0001
%SBS_HORZ   = &H0000
%SBS_SIZEBOX = &H0008
%SBS_SIZEBOXBOTTOMRIGHTALIGN = &H0004
%SBS_SIZEBOXTOPLEFTALIGN     = &H0002

' --- Dialog Styles ---
%DS_MODALFRAME     = &H0080
%DS_SETFOREGROUND  = &H0200
%DS_CENTER         = &H0800
%DS_CENTERMOUSE    = &H1000
%DS_3DLOOK         = &H0004
%DS_CONTROL        = &H0400
%DS_SETFONT        = &H0040
%DS_SHELLFONT      = &H0400
%DS_LOCALEDIT      = &H0020
%DS_NOFAILCREATE   = &H0010
%DS_FIXEDSYS       = &H0008

' --- Extended Window Styles ---
%WS_EX_DLGMODALFRAME    = &H00000001
%WS_EX_NOPARENTNOTIFY   = &H00000004
%WS_EX_TOPMOST          = &H00000008
%WS_EX_ACCEPTFILES      = &H00000010
%WS_EX_TRANSPARENT      = &H00000020
%WS_EX_MDICHILD         = &H00000040
%WS_EX_TOOLWINDOW       = &H00000080
%WS_EX_WINDOWEDGE       = &H00000100
%WS_EX_CLIENTEDGE       = &H00000200
%WS_EX_OVERLAPPEDWINDOW = &H00000300
%WS_EX_CONTEXTHELP      = &H00000400
%WS_EX_STATICEDGE       = &H00020000
%WS_EX_APPWINDOW        = &H00040000
%WS_EX_LAYERED          = &H00080000
%WS_EX_CONTROLPARENT    = &H00010000
%WS_EX_RIGHT            = &H00001000
%WS_EX_LEFT             = &H00000000
%WS_EX_RTLREADING       = &H00002000
%WS_EX_LTRREADING       = &H00000000
%WS_EX_LEFTSCROLLBAR    = &H00004000
%WS_EX_RIGHTSCROLLBAR   = &H00000000

' --- Clipboard Formats ---
%CF_TEXT         = 1
%CF_BITMAP       = 2
%CF_METAFILEPICT = 3
%CF_SYLK         = 4
%CF_DIF          = 5
%CF_TIFF         = 6
%CF_OEMTEXT      = 7
%CF_DIB          = 8
%CF_PALETTE      = 9
%CF_PENDATA      = 10
%CF_RIFF         = 11
%CF_WAVE         = 12
%CF_UNICODETEXT  = 13
%CF_ENHMETAFILE  = 14
%CF_HDROP        = 15
%CF_LOCALE       = 16

' --- SetWindowLong/GetWindowLong Indices ---
%GWL_USERDATA   = -21
%GWL_EXSTYLE    = -20
%GWL_STYLE      = -16
%GWL_WNDPROC    = -4
%GWL_HINSTANCE  = -6
%GWL_ID         = -12
%GWLP_USERDATA  = -21
%GWLP_EXSTYLE   = -20
%GWLP_WNDPROC   = -4
%GWLP_HINSTANCE = -6
%GWLP_ID        = -12

' --- SetWindowPos Flags ---
%SWP_NOSIZE        = &H0001
%SWP_NOMOVE        = &H0002
%SWP_NOZORDER      = &H0004
%SWP_NOREDRAW      = &H0008
%SWP_NOACTIVATE    = &H0010
%SWP_FRAMECHANGED  = &H0020
%SWP_SHOWWINDOW    = &H0040
%SWP_HIDEWINDOW    = &H0080
%SWP_NOCOPYBITS    = &H0100
%SWP_NOOWNERZORDER = &H0200
%SWP_NOSENDCHANGING = &H0400
%SWP_DRAWFRAME      = &H0020

' --- RedrawWindow Flags ---
%RDW_INVALIDATE      = &H0001
%RDW_INTERNALPAINT   = &H0002
%RDW_ERASE           = &H0004
%RDW_VALIDATE        = &H0008
%RDW_NOINTERNALPAINT = &H0010
%RDW_NOERASE         = &H0020
%RDW_NOCHILDREN      = &H0040
%RDW_ALLCHILDREN     = &H0080
%RDW_UPDATENOW       = &H0100
%RDW_ERASENOW        = &H0200
%RDW_FRAME           = &H0400
%RDW_NOFRAME         = &H0800

' --- Simple Color Constants ---
%BLACK   = &H00000000
%WHITE   = &H00FFFFFF
%RED     = &H000000FF
%GREEN   = &H0000FF00
%BLUE    = &H00FF0000
%YELLOW  = &H0000FFFF
%CYAN    = &H00FFFF00
%MAGENTA = &H00FF00FF
%DARKGRAY      = &H00555555
%LIGHTGRAY     = &H00AAAAAA
%DARKRED       = &H00000080
%DARKGREEN     = &H00008000
%DARKBLUE      = &H00800000
%ORANGE        = &H000080FF
%PURPLE        = &H00800080

' --- Common Control Messages (list-view) ---
%LVM_FIRST            = &H1000
%LVM_SETIMAGELIST     = &H1003
%LVM_GETITEMCOUNT     = &H1004
%LVM_INSERTITEM       = &H1007
%LVM_DELETEITEM       = &H1008
%LVM_DELETEALLITEMS   = &H1009
%LVM_GETITEM          = &H1005
%LVM_SETITEM          = &H1006
%LVM_INSERTCOLUMN     = &H101D
%LVM_DELETECOLUMN     = &H101C
%LVM_GETCOLUMN        = &H101F
%LVM_SETCOLUMN        = &H1020
%LVM_GETCOLUMNWIDTH   = &H1015
%LVM_SETCOLUMNWIDTH   = &H1016
%LVM_GETITEMSTATE     = &H102C
%LVM_SETITEMSTATE     = &H102D
%LVM_GETNEXTITEM      = &H100C
%LVM_ENSUREVISIBLE    = &H1013
%LVM_FINDITEM         = &H100D
%LVM_GETITEMTEXT      = &H102D
%LVM_SETITEMTEXT      = &H102E

' --- Common Control Messages (tree-view) ---
%TV_FIRST               = &H1100
%TVM_INSERTITEM         = &H1100
%TVM_DELETEITEM         = &H1101
%TVM_EXPAND             = &H1102
%TVM_GETITEM            = &H110C
%TVM_SETITEM            = &H110D
%TVM_GETNEXTITEM        = &H110A
%TVM_SELECTITEM         = &H110B
%TVM_GETCOUNT           = &H1105
%TVM_ENSUREVISIBLE      = &H1114
%TVM_SETIMAGELIST       = &H1109
%TVM_GETIMAGELIST       = &H1108

' --- Common Control Messages (toolbar) ---
%TB_FIRST           = &H0700
%TB_ADDBUTTONSA     = &H0714
%TB_ADDBUTTONSW     = &H0744
%TB_INSERTBUTTONA   = &H0715
%TB_DELETEBUTTON    = &H0716
%TB_BUTTONCOUNT     = &H0718
%TB_GETITEMRECT     = &H071D
%TB_SETBUTTONSIZE   = &H071F
%TB_SETBITMAPSIZE   = &H0720
%TB_AUTOSIZE        = &H0721

' --- Common Control Messages (statusbar) ---
%SB_SETTEXTA        = &H0401
%SB_GETTEXTA        = &H0402
%SB_GETTEXTLENGTHA  = &H0403
%SB_SETPARTS        = &H0404
%SB_GETPARTS        = &H0406
%SB_SIMPLE          = &H0409
%SB_GETRECT         = &H040A

' --- Common Control Messages (progressbar) ---
%PBM_SETRANGE       = &H0401
%PBM_SETPOS         = &H0402
%PBM_DELTAPOS       = &H0403
%PBM_SETSTEP        = &H0404
%PBM_STEPIT         = &H0405
%PBM_SETRANGE32     = &H0406
%PBM_GETRANGE       = &H0407
%PBM_GETPOS         = &H0408
%PBM_SETBARCOLOR    = &H0409
%PBM_SETBKCOLOR     = &H2001

' --- Common Control Messages (scrollbar) ---
%SBM_SETPOS         = &H00E0
%SBM_GETPOS         = &H00E1
%SBM_SETRANGE       = &H00E2
%SBM_GETRANGE       = &H00E3
%SBM_ENABLE_ARROWS  = &H00E4
%SBM_SETRANGEREDRAW = &H00E6
