Hello Tout le monde.
I continnue in English Timo.
Before seeing the function code I added some structures definitions that could be useful.
Don't be afraid with that:
xorpd xmm0,xmm0
shufpd xmm0,xmm0,0
movdqu [rsp + 32],xmm0
movdqu [rsp + 48],xmm0
movq [rsp + 72],xmm0
movq [rsp + 88],xmm0
rather using a 64 bits register I use 128 bits register. I spend less time in writing. One line make the job of 2.
I wish you a good reading
Philippe RIO
.Const
WNDCLASSEX STRUCT
cbSize DWORD ?
style DWORD ?
lpfnWndProc QWORD ?
cbClsExtra DWORD ?
cbWndExtra DWORD ?
hInstance QWORD ?
hIcon QWORD ?
hCursor QWORD ?
hbrBackground QWORD ?
lpszMenuName QWORD ?
lpszClassName QWORD ?
hIconSm QWORD ?
WNDCLASSEX ENDS
LPWNDCLASSEX TYPEDEF PTR WNDCLASSEX
POINT STRUCT
x DWORD ?
y DWORD ?
POINT ENDS
LPPOINT TYPEDEF PTR POINT
RECT STRUCT
left DWORD ?
top DWORD ?
right DWORD ?
bottom DWORD ?
RECT ENDS
LPRECT TYPEDEF PTR RECT
MSG STRUCT
hwnd HWND ?
message DWORD ?
padding1 DWORD ? ; padding
wParam WPARAM ?
lParam LPARAM ?
time DWORD ?
pt POINT <>
padding2 DWORD ? ; padding
MSG ENDS
LPMSG TYPEDEF PTR MSG
INITCOMMONCONTROLSEX STRUCT
dwSize DWORD ?
dwICC DWORD ?
INITCOMMONCONTROLSEX ENDS
LPINITCOMMONCONTROLSEX TYPEDEF PTR INITCOMMONCONTROLSEX
SIZE STRUCT
cxWidth DWORD ?
cyHeight DWORD ?
SIZE ENDS
LPSIZE TYPEDEF PTR SIZE
FILETIME STRUCT
dwLowDateTime DWORD ?
dwHighDateTime DWORD ?
FILETIME ENDS
LPFILETIME TYPEDEF PTR FILETIME
WIN32_FIND_DATA STRUCT
dwFileAttributes DWORD ?
ftCreationTime FILETIME <>
ftLastAccessTime FILETIME <>
ftLastWriteTime FILETIME <>
nFileSizeHigh DWORD ?
nFileSizeLow DWORD ?
dwReserved0 DWORD ?
dwReserved1 DWORD ?
cFileName BYTE (MAX_PATH) dup(?)
cAlternateFileName BYTE (14) dup(?)
WIN32_FIND_DATA ENDS
LPWIN32_FIND_DATA TYPEDEF PTR WIN32_FIND_DATA
PAINTSTRUCT STRUCT
hdc HDC ?
fErase DWORD ?
rcPaint RECT <>
fRestore DWORD ?
fIncUpdate DWORD ?
rgbReserved BYTE 32 dup(?)
PAINTSTRUCT ENDS
LVITEM STRUCT
_mask DWORD ?
iItem DWORD ?
iSubItem DWORD ?
iState DWORD ?
stateMask DWORD ?
Padding_01 DWORD ?
pszText LPSTR ?
cchTextMax DWORD ?
iImage DWORD ?
lParam LPARAM ?
iIndent DWORD ?
iGroupId DWORD ?
cColumns DWORD ?
Padding_02 DWORD ?
puColumns QWORD ?
piColFmt QWORD ?
iGroup DWORD ?
LVITEM ENDS
LPLVITEM TYPEDEF PTR LVITEM
NMHDR STRUCT
hwndFrom HWND ?
idFrom UINT_PTR ?
code QWORD ?
NMHDR ENDS
LPNMHDR TYPEDEF PTR NMHDR
LVCOLUMN STRUCT
_mask DWORD ?
fmt DWORD ?
_cx DWORD ?
UnUsed DWORD ?
pszText LPSTR ?
cchTextMax DWORD ?
iSubItem DWORD ?
iImage DWORD ?
iOrder DWORD ?
cxMin DWORD ?
cxDefault DWORD ?
cxIdeal DWORD ?
LVCOLUMN ENDS
LPLVCOLUMN TYPEDEF PTR LVCOLUMN
TCITEMHEADERA STRUCT
_mask UINT ?
lpReserved1 UINT ?
lpReserved2 UINT ?
pszText LPSTR ?
cchTextMax UINT ?
iImage UINT ?
TCITEMHEADERA ENDS
LPTCITEMHEADERA TYPEDEF PTR TCITEMHEADERA
TCITEM STRUCT
_mask UINT ?
dwState DWORD ?
dwStateMask DWORD ?
padding_1 DWORD ?
pszText LPSTR ?
cchTextMax UINT ?
iImage UINT ?
lParam LPARAM ?
TCITEM ENDS
LPTCITEM TYPEDEF PTR TCITEM
NMLISTVIEW STRUCT
hdr NMHDR <>
iItem DWORD ?
iSubItem DWORD ?
uNewState DWORD ?
uOldState DWORD ?
uChanged DWORD ?
ptAction POINT <>
lParam LPARAM ?
NMLISTVIEW ENDS
LPNMLISTVIEW TYPEDEF PTR NMLISTVIEW
NMITEMACTIVATE STRUCT
hdr NMHDR <>
iItem DWORD ?
iSubItem DWORD ?
uNewState DWORD ?
uOldState DWORD ?
uChanged DWORD ?
ptAction POINT <>
lParam LPARAM ?
uKeyFlags DWORD ?
NMITEMACTIVATE ENDS
LPNMITEMACTIVATE TYPEDEF PTR NMITEMACTIVATE
BITMAP STRUC
bmType LONG ?
bmWidth LONG ?
bmHeight LONG ?
bmWidthBytes LONG ?
bmPlanes WORD ?
bmBitsPixel WORD ?
DWORD ?
bmBits LPVOID ?
BITMAP ENDS
LPBITMAP TYPEDEF PTR BITMAP
CREATESTRUCT STRUC
lpCreateParams LPVOID ?
hInstance HINSTANCE ?
hMenu HMENU ?
hwndParent HWND ?
ly SDWORD ?
lx SDWORD ?
y SDWORD ?
x SDWORD ?
style LONG ?
DWORD ?
lpszName LPCTSTR ?
lpszClass LPCTSTR ?
dwExStyle DWORD ?
DWORD ?
CREATESTRUCT ENDS
LPCREATESTRUCT TYPEDEF PTR CREATESTRUCT
BROWSEINFO STRUCT
hwndOwner HWND ?
pidlRoot QWORD ?
pszDisplayName LPTSTR ?
lpszTitle LPCTSTR ?
ulFlags DWORD ?
Padding_1 DWORD ?
lpfn QWORD ?
lParam LPARAM ?
iImage DWORD ?
Padding_2 DWORD ?
BROWSEINFO ENDS
LPBROWSEINFO TYPEDEF PTR BROWSEINFO
; ----------------------------------------------------------------------------------
; ----------------------------------------------------------------------------------
; ----------------------------------------------------------------------------------
.Code
; __________________________________________________________________________________
; _______________________ TabControl _______________________________________________
; __________________________________________________________________________________
ALIGN 16
PUBLIC TabControl
TabControl PROC PARMAREA=20*QWORD
LOCAL _Tci:TCITEM
mov rdx,[hInstance + rip]
mov rax,[hWndMain + rip]
xor ecx,ecx
xorpd xmm0,xmm0
shufpd xmm0,xmm0,0
movdqu [rsp + 32],xmm0
movdqu [rsp + 48],xmm0
movq [rsp + 72],xmm0
movq [rsp + 88],xmm0
mov [rsp + 80],rdx ; hInstance
mov [rsp + 64],rax ; hWndParent
mov QWORD PTR [rsp + 72],KID_TAB ; hMenu
mov r9d,WS_CHILD or WS_CLIPSIBLINGS or WS_VISIBLE or TCS_FLATBUTTONS or TCS_SINGLELINE or TCS_TABS
lea r8,szNullString + rip
lea rdx,WC_TABCONTROL + rip
call CreateWindowExA
mov [hTabs + rip],rax
mov rcx,rax
lea r9,_Tci
lea rax,szTab_1 + rip
mov [r9].TCITEM.pszText,rax
mov [r9].TCITEM.lParam,0
mov [r9].TCITEM._mask,TCIF_TEXT or TCIF_PARAM
mov edx,TCM_INSERTITEM
mov rcx,[hTabs + rip]
mov r8d,1
call SendMessageA
lea r9,_Tci
lea rax,szTab_2 + rip
mov [r9].TCITEM.pszText,rax
mov [r9].TCITEM.lParam,1
mov edx,TCM_INSERTITEM
mov rcx,[hTabs + rip]
mov r8d,2
call SendMessageA
lea r9,_Tci
lea rax,szTab_3 + rip
mov [r9].TCITEM.pszText,rax
mov [r9].TCITEM.lParam,2
mov edx,TCM_INSERTITEM
mov rcx,[hTabs + rip]
mov r8d,3
call SendMessageA
lea r9,_Tci
lea rax,szTab_4 + rip
mov [r9].TCITEM.pszText,rax
mov [r9].TCITEM.lParam,3
mov edx,TCM_INSERTITEM
mov rcx,[hTabs + rip]
mov r8d,4
call SendMessageA
ret
TabControl ENDP