Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/Common/src/Interop/ComCtl32/Interop.NMTOOLBARW.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

internal static partial class Interop
{
internal static partial class ComCtl32
{
public unsafe struct NMTOOLBARW
{
public User32.NMHDR hdr;
public int iItem;
public TBBUTTON tbButton;
public int cchText;
public char* pszText;
public RECT rcButton;
}
}
}
17 changes: 17 additions & 0 deletions src/Common/src/Interop/ComCtl32/Interop.TB.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

internal static partial class Interop
{
internal static partial class ComCtl32
{
public enum TB : int
{
FIRST = 0x1000,
GETBUTTONINFOW = FIRST + 63,
SETBUTTONINFOW = FIRST + 64,
INSERTBUTTONW = FIRST + 67,
}
}
}
23 changes: 23 additions & 0 deletions src/Common/src/Interop/ComCtl32/Interop.TBBUTTON.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

internal static partial class Interop
{
internal static partial class ComCtl32
{
public struct TBBUTTON
{
public int iBitmap;
public int idCommand;
public TBSTATE fsState;
public byte fsStyle;
public byte bReserved0;
public byte bReserved1;
public IntPtr dwData;
public IntPtr iString;
}
}
}
25 changes: 25 additions & 0 deletions src/Common/src/Interop/ComCtl32/Interop.TBBUTTONINFOW.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

internal static partial class Interop
{
internal static partial class ComCtl32
{
public struct TBBUTTONINFOW
{
public uint cbSize;
public TBIF dwMask;
public int idCommand;
public int iImage;
public TBSTATE fsState;
public byte fsStyle;
public ushort cx;
public IntPtr lParam;
public IntPtr pszText;
public int cchTest;
}
}
}
24 changes: 24 additions & 0 deletions src/Common/src/Interop/ComCtl32/Interop.TBIF.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

internal static partial class Interop
{
internal static partial class ComCtl32
{
[Flags]
public enum TBIF : uint
{
IMAGE = 0x00000001,
TEXT = 0x00000002,
STATE = 0x00000004,
STYLE = 0x00000008,
LPARAM = 0x00000010,
COMMAND = 0x00000020,
SIZE = 0x00000040,
BYINDEX = 0x80000000,
}
}
}
24 changes: 24 additions & 0 deletions src/Common/src/Interop/ComCtl32/Interop.TBSTATE.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

internal static partial class Interop
{
internal static partial class ComCtl32
{
[Flags]
public enum TBSTATE : byte
{
CHECKED = 0x01,
PRESSED = 0x02,
ENABLED = 0x04,
HIDDEN = 0x08,
INDETERMINATE = 0x10,
WRAP = 0x20,
ELLIPSES = 0x40,
MARKED = 0x80,
}
}
}
38 changes: 38 additions & 0 deletions src/Common/src/Interop/ComCtl32/Interop.TBSTYLE.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

internal static partial class Interop
{
internal static partial class ComCtl32
{
[Flags]
public enum TBSTYLE : int
{
BUTTON = 0x0000,
SEP = 0x0001,
CHECK = 0x0002,
GROUP = 0x0004,
CHECKGROUP = GROUP,
DROPDOWN = 0x0008,
AUTOSIZE = 0x0010,
NOPREFIX = 0x0020,
TOOLTIPS = 0x0100,
WRAPABLE = 0x0200,
ALTDRAG = 0x0400,
FLAT = 0x0800,
LIST = 0x1000,
CUSTOMERASE = 0x2000,
REGISTERDROP = 0x4000,
TRANSPARENT = 0x800,
EX_DRAWDDARROWS = 0x00000001,
EX_MIXEDBUTTONS = 0x00000008,
EX_HIDECLIPPEDBUTTONS = 0x00000010,
EX_MULTICOLUMN = 0x00000002,
EX_VERTICAL = 0x00000004,
EX_DOUBLEBUFFER = 0x00000080,
}
}
}
60 changes: 0 additions & 60 deletions src/Common/src/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -889,23 +889,10 @@ public const int
TPM_RIGHTALIGN = 0x0008,
TPM_VERTICAL = 0x0040,
TV_FIRST = 0x1100,
TBSTATE_CHECKED = 0x01,
TBSTATE_ENABLED = 0x04,
TBSTATE_HIDDEN = 0x08,
TBSTATE_INDETERMINATE = 0x10,
TBSTYLE_BUTTON = 0x00,
TBSTYLE_SEP = 0x01,
TBSTYLE_CHECK = 0x02,
TBSTYLE_DROPDOWN = 0x08,
TBSTYLE_TOOLTIPS = 0x0100,
TBSTYLE_FLAT = 0x0800,
TBSTYLE_LIST = 0x1000,
TBSTYLE_EX_DRAWDDARROWS = 0x00000001,
TB_ENABLEBUTTON = (0x0400 + 1),
TB_ISBUTTONCHECKED = (0x0400 + 10),
TB_ISBUTTONINDETERMINATE = (0x0400 + 13),
TB_ADDBUTTONS = (0x0400 + 68),
TB_INSERTBUTTON = (0x0400 + 67),
TB_DELETEBUTTON = (0x0400 + 22),
TB_GETBUTTON = (0x0400 + 23),
TB_SAVERESTORE = (0x0400 + 76),
Expand All @@ -918,18 +905,10 @@ public const int
TB_SETIMAGELIST = (0x0400 + 48),
TB_GETRECT = (0x0400 + 51),
TB_GETBUTTONSIZE = (0x0400 + 58),
TB_GETBUTTONINFO = (0x0400 + 63),
TB_SETBUTTONINFO = (0x0400 + 64),
TB_SETEXTENDEDSTYLE = (0x0400 + 84),
TB_MAPACCELERATOR = (0x0400 + 90),
TB_GETTOOLTIPS = (0x0400 + 35),
TB_SETTOOLTIPS = (0x0400 + 36),
TBIF_IMAGE = 0x00000001,
TBIF_TEXT = 0x00000002,
TBIF_STATE = 0x00000004,
TBIF_STYLE = 0x00000008,
TBIF_COMMAND = 0x00000020,
TBIF_SIZE = 0x00000040,
TBN_GETBUTTONINFO = ((0 - 700) - 20),
TBN_QUERYINSERT = ((0 - 700) - 6),
TBN_DROPDOWN = ((0 - 700) - 10),
Expand Down Expand Up @@ -1058,7 +1037,6 @@ public const int
TCM_SETTOOLTIPS = (0x1300 + 46),
TCN_SELCHANGE = ((0 - 550) - 1),
TCN_SELCHANGING = ((0 - 550) - 2),
TBSTYLE_WRAPPABLE = 0x0200,
TVM_SETBKCOLOR = (TV_FIRST + 29),
TVM_SETTEXTCOLOR = (TV_FIRST + 30),
TYMED_NULL = 0,
Expand Down Expand Up @@ -2108,29 +2086,6 @@ public struct tagVARDESC
public /*NativeMethods.tagVARKIND*/ int varkind;
}

[StructLayout(LayoutKind.Sequential)]
public struct NMTOOLBAR
{
public User32.NMHDR hdr;
public int iItem;
public TBBUTTON tbButton;
public int cchText;
public IntPtr pszText;
}

[StructLayout(LayoutKind.Sequential)]
public struct TBBUTTON
{
public int iBitmap;
public int idCommand;
public byte fsState;
public byte fsStyle;
public byte bReserved0;
public byte bReserved1;
public IntPtr dwData;
public IntPtr iString;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class TOOLTIPTEXT
{
Expand Down Expand Up @@ -2163,21 +2118,6 @@ public class HDITEM2
public IntPtr pvFilter = IntPtr.Zero;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct TBBUTTONINFO
{
public int cbSize;
public int dwMask;
public int idCommand;
public int iImage;
public byte fsState;
public byte fsStyle;
public short cx;
public IntPtr lParam;
public IntPtr pszText;
public int cchTest;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class TV_HITTESTINFO
{
Expand Down
6 changes: 0 additions & 6 deletions src/Common/src/UnsafeNativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,6 @@ public static StringBuilder GetModuleFileNameLongPath(HandleRef hModule)
[DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, StringBuilder lParam);

[DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, ref NativeMethods.TBBUTTON lParam);

[DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, ref NativeMethods.TBBUTTONINFO lParam);

[DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, NativeMethods.TV_HITTESTINFO lParam);

Expand Down
Loading