From 1e7a0d8caba5a1f1a1c7ad2c21ef87e54033568e Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 26 Dec 2023 15:06:17 -0800 Subject: [PATCH] SwiftWin32: enable tab control in ComCtl32 Enable the tab control behaviours for Common Controls to allow us to build out some of the tab view handling. --- .../App and Environment/ApplicationMain.swift | 1 + .../SwiftWin32/Support/WinSDK+Extensions.swift | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Sources/SwiftWin32/App and Environment/ApplicationMain.swift b/Sources/SwiftWin32/App and Environment/ApplicationMain.swift index 4b15aeaa..ca05b892 100644 --- a/Sources/SwiftWin32/App and Environment/ApplicationMain.swift +++ b/Sources/SwiftWin32/App and Environment/ApplicationMain.swift @@ -98,6 +98,7 @@ public func ApplicationMain(_ argc: Int32, | DWORD(ICC_NATIVEFNTCTL_CLASS) | DWORD(ICC_PROGRESS_CLASS) | DWORD(ICC_STANDARD_CLASSES) + | DWORD(ICC_TAB_CLASSES) var ICCE: INITCOMMONCONTROLSEX = INITCOMMONCONTROLSEX(dwSize: DWORD(MemoryLayout.size), dwICC: dwICC) diff --git a/Sources/SwiftWin32/Support/WinSDK+Extensions.swift b/Sources/SwiftWin32/Support/WinSDK+Extensions.swift index 76bf3e8f..f5cc0ac4 100644 --- a/Sources/SwiftWin32/Support/WinSDK+Extensions.swift +++ b/Sources/SwiftWin32/Support/WinSDK+Extensions.swift @@ -147,6 +147,21 @@ internal var QS_ALLINPUT: DWORD { DWORD(QS_INPUT) | DWORD(QS_POSTMESSAGE) | DWORD(QS_TIMER) | DWORD(QS_PAINT) | DWORD(QS_HOTKEY) | DWORD(QS_SENDMESSAGE) } +@_transparent +internal var TCS_BOTTOM: DWORD { + DWORD(WinSDK.TCS_BOTTOM) +} + +@_transparent +internal var TCS_FIXEDWIDTH: DWORD { + DWORD(WinSDK.TCS_FIXEDWIDTH) +} + +@_transparent +internal var TCS_FLATBUTTONS: DWORD { + DWORD(WinSDK.TCS_FLATBUTTONS) +} + @_transparent internal var WS_BORDER: DWORD { DWORD(WinSDK.WS_BORDER)