📄 skinmagiclib.h
字号:
// specified by the y parameter.
// TPM_VCENTERALIGN If this flag is set, the function centers the shortcut menu
// vertically relative to the coordinate specified by the y parameter.
//
// x
// [in] Specifies the horizontal location of the shortcut menu,
// in screen coordinates.
// y
// [in] Specifies the vertical location of the shortcut menu,
// in screen coordinates.
// hWnd
// [in] Handle to the window that owns the shortcut menu.
// This window receives all messages from the menu.
// The window does not receive a WM_COMMAND message from the
// menu until the function returns.
BOOL __stdcall TrackSkinPopupMenu( HMENU hMenu, UINT uFlags, int x, int y, HWND hWnd );
int __stdcall EnableCaptionButtons(HWND hWnd , LPCTSTR lpName , BOOL bEnable );
//for custom control support
#define WM_SKINDATACHANGED WM_USER + 2000
//for
#define WM_SETSKIN WM_APP + 1000
typedef HANDLE HSKIN; // handle to a skin data object
int __stdcall RegisterSkinWindow( HWND hWnd , UINT uNotifyMsg );
int __stdcall UnregisterSkinWindow( HWND hWnd );
HSKIN __stdcall OpenSkinData( LPCTSTR pszSkinObjectName );
void __stdcall CloseSkinData( HSKIN hSkin );
//stocked property for every custom control
int __stdcall GetSkinControlRect( HSKIN hSkin , RECT* pRect, BOOL* pAutoPlace );
int __stdcall GetSkinControlID( HSKIN hSkin , DWORD* dwID );
int __stdcall GetSkinControlFont( HSKIN hSkin , HFONT* phFont , COLORREF* pColor );
int __stdcall GetSkinControlColor( HSKIN hSkin , COLORREF* pColor );
int __stdcall GetSkinControlBkColor( HSKIN hSkin , COLORREF* pColor );
int __stdcall GetSkinTransparentColor( COLORREF* pColor , BOOL* pBool );
//user customed property
int __stdcall GetSkinFont( HSKIN hSkin,LPCTSTR pszName , LOGFONT* pLogFont , COLORREF* pColor );
int __stdcall GetSkinColor( HSKIN hSkin , LPCTSTR pszName, COLORREF* pColor );
int __stdcall GetSkinBool( HSKIN hSkin , LPCTSTR pszName, bool* pbVal );
int __stdcall GetSkinInt( HSKIN hSkin , LPCTSTR pszName, int* piVal );
int __stdcall GetSkinDWORD( HSKIN hSkin , LPCTSTR pszName, DWORD* pdwVal );
int __stdcall GetSkinEnum( HSKIN hSkin , LPCTSTR pszName, DWORD* pdwVal );
int __stdcall GetSkinString( HSKIN hSkin, LPCTSTR pszName , LPTSTR pszBuff , unsigned long* pMaxBuffChars );
int __stdcall DrawSkinImageRect( HSKIN hSkin,
LPCTSTR pszName,
HDC hdc,
RECT* pRect
);
int __stdcall DrawSkinImageSection( HSKIN hSkin,
LPCTSTR pszName,
HDC hdc,
RECT* pRect );
int __stdcall DrawSkinImageSectionFrame( HSKIN hSkin,
LPCTSTR pszName,
HDC hdc,
RECT* pRect );
int __stdcall GetSkinImageSectionMargins( HSKIN hSkin, LPCTSTR pszName , const RECT* pRect , const RECT* pMargins );
int __stdcall CreateSkinImageRectRegion( HSKIN hSkin,
LPCTSTR pszName,
RECT* pBoundRect,
SIZE* pImgSize,
HRGN* pRegion);
int __stdcall CreateSkinImageSectionRegion( HSKIN hSkin,
LPCTSTR pszName,
RECT* pRect,
HRGN* pRegion );
int __stdcall DrawSkinTextEffect( HSKIN hSkin,
LPCTSTR pszName,
HDC hdc,
const RECT* pRect,
LPCTSTR lpText,
UINT uLen,
UINT uFlag );
///////////////////////////////////////////////////////////////////////////////////////////////
//CreateImageList
//
//The CreateImageList create a new image list from skin file.
//
// Parameters:
// lpImagelistObjectName [in] The skinImageList object name.
// Return Values
// Returns the handle to the image list if successful, or NULL otherwise
///////////////////////////////////////////////////////////////////////////////////////////////
HIMAGELIST __stdcall CreateImageList( LPCTSTR pszImageListObjectName );
struct MENUIMAGEINFO
{
UINT itemID;
int iImage;
};
//////////////////////////////////////////////////////////////////////////////////////////////////
//Function: SetWindowMainMenuImage
// The SetWindowMainMenuImage function set windows main menu item's bitmap.
//
//Parameters:
// hWnd
// [in] Handle to the window own the menu..
// pMenuImage
// [in] Pointer of an array of MENUIMAGEINFO struct .
// nCount
// [in] length of array pMenuImage.
// hImageList
// [in] imagelist used by the main menu to display normal item images.
// hHotImageList
// [in] imagelist used by the main menu to display hot item images.
// hDisabledImagelist
// [in] imagelist used by the main menu to display disabled item images.
//
//Return Values:
// If the function success, the return value is nonzero
// If the function fail, the return value is zero
///////////////////////////////////////////////////////////////////////////////////////////
int __stdcall SetWindowMainMenuImage( HWND hWnd ,
MENUIMAGEINFO* pMenuImage,
UINT nCount ,
HIMAGELIST hImageList ,
HIMAGELIST hHotImageList,
HIMAGELIST hDisabledImagelist );
/////////////////////////////////////////////////////////////////////////////////////////////
//Function: TrackSkinPopupMenuEx
// The TrackSkinPopupMenuEx function displays a shortcut menu at the
// specified location and tracks the selection of items on the menu.
// The shortcut menu can appear anywhere on the screen.
//
//Parameters
// hMenu
// [in] Handle to the shortcut menu to be displayed.
// The handle can be obtained by calling CreatePopupMenu
// to create a new shortcut menu, or by calling GetSubMenu
// to retrieve a handle to a submenu associated with an
// existing menu item.
// lpSkinPopupMenuName
// [in] The SkinPopupMenu object name. If lpSkinPopupMenuName is NULL SkinMagic
// use default popupmenu skindata.
// uFlags
// [in] Use zero of more of these flags to specify function options.
// Use one of the following flags to specify how the function positions
// the shortcut menu horizontally.
// ------------------------------------------------------------------------------
// TPM_CENTERALIGN If this flag is set, the function centers the shortcut
// menu horizontally relative to the coordinate specified
// by the x parameter.
// TPM_LEFTALIGN If this flag is set, the function positions the shortcut
// menu so that its left side is aligned with the coordinate
// specified by the x parameter.
// TPM_RIGHTALIGN Positions the shortcut menu so that its right side is
// aligned with the coordinate specified by the x parameter.
// ------------------------------------------------------------------------------
// Use one of the following flags to specify how the function positions the shortcut
// menu vertically.
// TPM_BOTTOMALIGN If this flag is set, the function positions the shortcut
// menu so that its bottom side is aligned with the coordinate
// specified by the y parameter.
// TPM_TOPALIGN If this flag is set, the function positions the shortcut
// menu so that its top side is aligned with the coordinate
// specified by the y parameter.
// TPM_VCENTERALIGN If this flag is set, the function centers the shortcut menu
// vertically relative to the coordinate specified by the y parameter.
//
// x
// [in] Specifies the horizontal location of the shortcut menu,
// in screen coordinates.
// y
// [in] Specifies the vertical location of the shortcut menu,
// in screen coordinates.
// hWnd
// [in] Handle to the window that owns the shortcut menu.
// This window receives all messages from the menu.
// The window does not receive a WM_COMMAND message from the
// menu until the function returns.
// pMenuImage
// [in] Pointer of an array of MENUIMAGEINFO struct .
// nCount
// [in] length of array pMenuImage.
// hImageList
// [in] imagelist used by the main menu to display normal item images.
// hHotImageList
// [in] imagelist used by the main menu to display hot item images.
// hDisabledImagelist
// [in] imagelist used by the main menu to display disabled item images.
///////////////////////////////////////////////////////////////////////////////////////////
BOOL __stdcall TrackSkinPopupMenuEx( HMENU hMenu,
LPCTSTR lpSkinName,
UINT uFlags,
int x,
int y,
HWND hWnd ,
MENUIMAGEINFO* pMenuImage,
UINT nCount ,
HIMAGELIST hImageList ,
HIMAGELIST hHotImageList,
HIMAGELIST hDisabledImagelist );
int __stdcall RedrawCaptionStatic( HWND hWnd , LPCTSTR lpName );
DWORD __stdcall GetSkinMagicErrorCode();
//menu function
//Use these function to get and set skinned window's menu
HMENU __stdcall GetSkinMenu( HWND hWnd );
BOOL __stdcall SetSkinMenu( HWND hWnd , HMENU hMenu );
//The state of caption button
#define CPBS_HOVERED 0x00000000
#define CPBS_PRESSED 0x00000001
#define CPBS_DISABLED 0x00000002
#define CPBS_NORMAL 0x00000003
//////////////////////////////////////////////////////////////////////////////////////////////////
//Function: GetCaptionButtonState
// The GetCaptionBttonState function get captionbutton object's state.
//
//Parameters:
// hWnd
// [in] Handle to the window own the captionbutton.
// lpName
// [in] the captionbutton's name
// pdwState
// [out] the state of captionbutton.
//
//Return Values:
// If the function success, the return value is nonzero
// If the function fail, the return value is zero
///////////////////////////////////////////////////////////////////////////////////////////
int __stdcall GetCaptionButtonState(HWND hWnd , LPCTSTR lpName , DWORD* pdwState );
//////////////////////////////////////////////////////////////////////////////////////////////////
//Function: SetCaptionButtonState
// The SetCaptionBttonState function set captionbutton object's state.
//
//Parameters:
// hWnd
// [in] Handle to the window own the captionbutton.
// lpName
// [in] the captionbutton's name
// dwState
// [in] the state of captionbutton.
//
//Return Values:
// If the function success, the return value is nonzero
// If the function fail, the return value is zero
///////////////////////////////////////////////////////////////////////////////////////////
int __stdcall SetCaptionButtonState(HWND hWnd , LPCTSTR lpName , DWORD dwState );
///////////////////////////////////////////////////////////////////////////////////////////
int __stdcall SetSkinWindowAccelerator( HWND hWnd, HACCEL hAccTable );
////////////////////////////////////////////////////////////////////////////////////////////
int __stdcall SetControlTooltip( HWND hWnd , LPCTSTR lpTooltip );
int __stdcall SetCaptionButtonTooltip( HWND hWnd , LPCTSTR lpName , LPCTSTR lpTooltip );
int __stdcall ShowTooltipPoint( HWND hWnd , LPCTSTR lpTooltip , LPPOINT lpPoint );
int __stdcall HideTooltip();
int __stdcall SetControlSkin( HWND hWnd , LPCTSTR szSkinName, LPCTSTR szOwnerSkinName );
COLORREF __stdcall GetSkinSysColor( int nIndex );
HBRUSH __stdcall GetSkinSysColorBrush( int nIndex );
//
int __stdcall ShowSkinObject( HWND hWnd , LPCTSTR szSkinObject , BOOL bVisible );
int __stdcall SetSkinObjectText( HWND hWnd , LPCTSTR szSkinObject , LPCTSTR lpText );
int __stdcall GetSkinObjectText( HWND hWnd , LPCTSTR szSkinObject , LPTSTR lpText , int nMaxCount );
int __stdcall GetLibVersion( LPTSTR lpVersion );
int __stdcall GetSkinClientRect( HWND hWnd, LPRECT lpRect );
#define WM_CB_MOUSEMOVE WM_USER + 2001
#define WM_CB_LBUTTONDOWN WM_USER + 2002
#define WM_CB_RBUTTONDOWN WM_USER + 2003
#define WM_CB_LBUTTONUP WM_USER + 2004
#define WM_CB_RBUTTONUP WM_USER + 2005
#define WM_CB_LBUTTONDBLCLK WM_USER + 2006
#define WM_CB_MOUSELEAVE WM_USER + 2007
#define WM_CB_NOTIFY WM_USER + 2008
#define WM_PAINTCLIENT WM_USER + 2009
//wParam hDC
//lParam lpRect - the client rect
#pragma pack(pop)
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -