using System; using System.Runtime.InteropServices; using static Vanara.PInvoke.Gdi32; using static Vanara.PInvoke.Kernel32; // ReSharper disable InconsistentNaming // ReSharper disable FieldCanBeMadeReadOnly.Global // ReSharper disable InconsistentNaming namespace Vanara.PInvoke { public static partial class ComCtl32 { /// Status bar text drawing flags. [Flags] public enum SBT { /// Prevents borders from being drawn around the specified text. SBT_NOBORDERS = 0x0100, /// Draws highlighted borders that make the text stand out. SBT_POPOUT = 0x0200, /// Indicates that the string pointed to by pszText will be displayed in the opposite direction to the text in the parent window. SBT_RTLREADING = 0x0400, /// Tab characters are ignored. SBT_NOTABPARSING = 0x0800, /// The text is drawn by the parent window. SBT_OWNERDRAW = 0x1000, } /// The DrawStatusText function draws the specified text in the style of a status window with borders. /// /// Type: HDC /// Handle to the display context for the window. /// /// /// Type: LPCRECT /// /// Pointer to a RECT structure that contains the position, in client coordinates, of the rectangle in which the text is drawn. The function draws /// the borders just inside the edges of the specified rectangle. /// /// /// /// Type: LPCTSTR /// /// Pointer to a null-terminated string that specifies the text to display. Tab characters in the string determine whether the string is left-aligned, /// right-aligned, or centered. /// /// /// /// Type: UINT /// Text drawing flags. This parameter can be a combination of these values: /// /// /// /// Value /// Meaning /// /// /// SBT_NOBORDERS /// Prevents borders from being drawn around the specified text. /// /// /// SBT_POPOUT /// Draws highlighted borders that make the text stand out. /// /// /// SBT_RTLREADING /// Indicates that the string pointed to by pszText will be displayed in the opposite direction to the text in the parent window. /// /// /// /// /// This function does not return a value. // void DrawStatusText( HDC hdc, LPCRECT lprc, LPCTSTR pszText, UINT uFlags); // https://msdn.microsoft.com/en-us/library/windows/desktop/bb760763(v=vs.85).aspx [DllImport(Lib.ComCtl32, SetLastError = false, CharSet = CharSet.Auto)] [PInvokeData("Commctrl.h", MSDNShortId = "bb760763")] public static extern void DrawStatusText(SafeDCHandle hdc, ref RECT lprc, string pszText, SBT uFlags); /// /// Processes WM_MENUSELECT and WM_COMMAND messages and displays Help text about the current menu in the specified status window. /// /// /// Type: UINT /// Message being processed. This can be either WM_MENUSELECT or WM_COMMAND. /// /// /// Type: WPARAM /// wParam of the message specified in uMsg. /// /// /// Type: LPARAM /// lParam of the message specified in uMsg. /// /// /// Type: HMENU /// Handle to the application's main menu. /// /// /// Type: HINSTANCE /// Handle to the module that contains the string resources. /// /// /// Type: HWND /// Handle to the status window. /// /// /// Type: LPUINT /// /// Pointer to an array of values that contains pairs of string resource identifiers and menu handles. The function searches the array for the handle to /// the selected menu and, if found, uses the corresponding resource identifier to load the appropriate Help string. /// /// /// No return value. // void MenuHelp( UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, LPUINT lpwIDs); // https://msdn.microsoft.com/en-us/library/windows/desktop/bb760765(v=vs.85).aspx [DllImport(Lib.ComCtl32, SetLastError = false, ExactSpelling = true)] [PInvokeData("Commctrl.h", MSDNShortId = "bb760765")] public static extern void MenuHelp(uint uMsg, IntPtr wParam, IntPtr lParam, IntPtr hMainMenu, SafeLibraryHandle hInst, HandleRef hwndStatus, IntPtr lpwIDs); } }