⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uskin.h

📁 仿QQ的聊天程序vc++/mfc来学习的简易聊天室代码功能较全
💻 H
📖 第 1 页 / 共 2 页
字号:
// This file is a part of the NEEMedia USkin class library.
// 2005-2006 Never-Ending Media Technology Ltd,co., All Rights Reserved.
//
// THIS FILE IS THE PROPERTY OF NEEMEDIA AND IS NOT TO BE
// RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
// CONSENT OF NEEMEDIA.
//
// THIS CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
// IN THE USKIN PRO LICENSE AGREEMENT. NEEMEDIA GRANTS TO
// YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
// SINGLE COMPUTER.
//
// CONTACT INFORMATION:
// support@neemedia.com
// http://www.neemedia.com
//
/////////////////////////////////////////////////////////////////////////////

#ifndef _USKIN_H_
#define _USKIN_H_

#ifdef USKIN_EXPORTS
	#define USKIN_API __declspec(dllexport)
#else
	#define USKIN_API __declspec(dllimport)
#endif

/*----------------------------------------------------------------------------
Function Name	:USkinInit
Description		:Init uskin lib and load skin file. 
ProtoType		:
	BOOL USkinInit(  LPCTSTR lpszUserName    // user name
	  LPCTSTR lpszRegCode     // sn
	  LPCTSTR lpszFileName    // uskin file name
	);
Parameters		:
	lpszUserName 
		[in] user name.default is NULL 
	lpszRegCode 
		[in] correct sn with user name,default is NULL 
	lpszFileName 
		[in] uskin file name,path like:neemedia.u3,..\neemedia.u3 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero
*/
USKIN_API BOOL  __stdcall USkinInit(LPCTSTR lpszUserName,LPCTSTR lpszRegCode,LPCTSTR lpszFileName);

/*----------------------------------------------------------------------------
Function Name	:USkinExit
Description		:Exit uskin lib.free memory that uskin alloced 
ProtoType		:
	BOOL USkinExit(  );
Parameters		:
	none 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL  __stdcall USkinExit();

/*----------------------------------------------------------------------------
Function Name	:USkinLoadSkin
Description		:Load skin from file. 
ProtoType		:
	BOOL USkinLoadSkin(  LPCTSTR lpszFileName    // USkin file name
	);
Parameters		:
	lpszFileName 
		[in] uskin file name,support path like:neemedia.u3,..\neemedia.u3 
Return values	:
		If the function succeeds, the return value is nonzero. If the function fails, the return value is zero 
*/
USKIN_API BOOL  __stdcall USkinLoadSkin(LPCTSTR lpszFileName);

/*----------------------------------------------------------------------------
Function Name	:USkinAboutSkin
Description		:Show skin file's copyright information dialog,such as author,author's email,url. 
ProtoType		:
	BOOL USkinAboutSkin(  );
Parameters		:
	none 
Return values	:
	none 
*/
USKIN_API void	__stdcall USkinAboutSkin();

/*----------------------------------------------------------------------------
Function Name	:USkinGetMenu
Description		:retrieves the handle to the menu assigned to the given window
ProtoType		:
	HMENU USkinGetMenu(  HWND hWnd    // handle to the window
	);
Parameters		:
	hWnd 
		[in] handle to the window 
Return values	:
	The return value is the handle to the menu. If the given window has no menu, the return value is NULL. 
*/
USKIN_API HMENU __stdcall USkinGetMenu(HWND hWnd);

/*----------------------------------------------------------------------------
Function Name	:USkinUpdateMenuBar
Description		:Update window menubar after modify the menu get from USkinGetMenu. 
ProtoType		:
	BOOL USkinUpdateMenuBar(  HWND hWnd    // Handle of window
	);
Parameters		:
	hWnd 
		[in] handle of window to update menubar 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL  __stdcall USkinUpdateMenuBar(HWND hWnd);

/*----------------------------------------------------------------------------
Function Name	:USkinApplyColorTheme
Description		:Apply color theme using hue and saturation. 
ProtoType		:
	BOOL USkinApplyColorTheme(  float fHue    // hue
		  float fSaturation     // saturation
	);
Parameters		:
	fHue 
		[in] hue.value range :0.0f-360.f 
	fSaturation 
		[in] saturation.value range:0.0f - 1.0f 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL __stdcall USkinApplyColorTheme(float fHue,float fSaturation);

/*----------------------------------------------------------------------------
Function Name	:USkinRemoveSkin
Description		:Pause uskin.unlike USkinExit function,this function not exit uskin lib,just change the interface look and feel into windows default look 
ProtoType		:
	BOOL USkinRemoveSkin(  );
Parameters		:
	none 
Return values	:
	failed return false,otherwise return true 
*/
USKIN_API BOOL  __stdcall USkinRemoveSkin();

/*----------------------------------------------------------------------------
Function Name	:USkinRestoreSkin
Description		:After USkinRemoveSkin,call this function to change interface to uskin look and feel. 
ProtoType		:
	BOOL USkinRestoreSkin(  );
Parameters		:
	none 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL  __stdcall USkinRestoreSkin();


////////////////////////////////////////////////////////////////////////////////
//-------------------Professional Function List--------------------------------
//Notes: following function only valide in professional version,
//       not valide in free version
//
////////////////////////////////////////////////////////////////////////////////

/*----------------------------------------------------------------------------
Function Name	:USkinApplyColorThemeByRGB
Description		:Apply color theme using RGB value. 
ProtoType		:
	BOOL USkinApplyColorThemeByRGB(  COLORREF clrTheme    // RGB color
	);
Parameters		:
	clrTheme 
		[in] RGB color to apply theme 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
*/
USKIN_API BOOL __stdcall USkinApplyColorThemeByRGB(COLORREF clrTheme);

/*----------------------------------------------------------------------------
Function Name	:USkinLoadSkinFromBuffer
Description		:Load uskin from buffer and change the interface look and feel. 
ProtoType		:
	BOOL USkinLoadSkinFromBuffer(  byte* lpBuffer    // pointer to uskin data in memory
		  UINT nBufferSize     // memory buffer size
	);
Parameters		:
	lpBuffer 
		[in] uskin data pointer,take careful use,must pass valid pointer,can be null 
	nBufferSize 
		[in] memory buffer size 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL __stdcall USkinLoadSkinFromBuffer(byte* lpBuffer,UINT nBufferSize);

/*----------------------------------------------------------------------------
Function Name	:USkinLoadSkinFromResource
Description		:Load uskin from resource and change the interface look and feel. 
ProtoType		:
	BOOL USkinLoadSkinFromResource(  HMODULE hInstance    // handle of module
		  LPCTSTR lpszResourceName     // resource name
		LPCTSTR lpszResourceType     // resouce type
	);
Parameters		:
	hInstance 
		[in] module handle,if hInstance is NULL,will use current module handle as default 
	lpszResourceName 
		[in] resource name of uskin resource 
	lpszResourceType 
		[in] resource type 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL __stdcall USkinLoadSkinFromResource(HMODULE hInstance,LPCTSTR lpszResourceName,LPCTSTR lpszResourceType);

/*----------------------------------------------------------------------------
Function Name	:USkinSetMenuItemImage
Description		:Set menu item image. 
ProtoType		:
	BOOL USkinSetMenuItemImage(  HWND hWnd    // The handle to the window
		UINT nMenuID     // menu item ID
		HIMAGELIST hImageList     // The handle to the image list
		UINT nImageIndex     // image index 
	);
Parameters		:
	hWnd 
		[in] The handle to the window,if null USkinSetMenuItemImage will set image list to global menu 
	nMenuID 
		[in] ID of menu item 
	hImageList 
		[in] The handle to the image list,if null not set 
	nImageIndex 
		[in] image index in image list 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL __stdcall USkinSetMenuItemImage(HWND hWnd,UINT nMenuID,HIMAGELIST hImageList,UINT nImageIndex);

/*----------------------------------------------------------------------------
Function Name	:USkinSetMenuItemImageEx
Description		:Set menu item image. 
ProtoType		:
	BOOL USkinSetMenuItemImageEx(  HWND hWnd    // The handle to the window
		UINT nMenuID     // menu item's ID
		HIMAGELIST hImageList     // image list handle
		UINT nImageIndex     // image index in image list
		HIMAGELIST hImageListHot     // hilighted state image list handle
		UINT nImageIndexHot     // image index in image list
		HIMAGELIST hImageListDisabled     // disabled state image list handle
		UINT nImageIndexDisabled     // image index in image list
	);
Parameters		:
	hWnd 
		[in] The handle to the window,if is null the USkinSetMenuItemImageEx will set global menu item image 
	nMenuID 
		[in] menu item ID 
	hImageList 
		[in] The handle to the image list ,if is null ,not set 
	nImageIndex 
		[in] image index in image list 
	hImageListHot 
		[in] The handle to the hilighted state image list,if null not set 
	nImageIndexHot 
		[in] image index in image list 
	hImageListDisabled 
		[in] The handle to the disabeld state imag list, if null not set 
	nImageIndexDisabled 
		[in] image index in image list 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL __stdcall USkinSetMenuItemImageEx(HWND hWnd,UINT nMenuID,HIMAGELIST hImageList,UINT nImageIndex,HIMAGELIST hImageListHot,UINT nImageIndexHot,HIMAGELIST hImageListDisabled,UINT nImageIndexDisabled);

typedef HANDLE HUSKIN;

/*----------------------------------------------------------------------------
Function Name	:USkinOpenSkinData
Description		:Open custom define skin object data. 
ProtoType		:
	HUSKIN USkinOpenSkinData(  LPCTSTR lpszSkinObjectName    // custom define skin object name
	);
Parameters		:
	lpszSkinObjectName 
		[in] custom define uskin object name 
Return values	:
	If the function succeeds, the return value is handle of uskin object. If the function fails, the return value is NULL 
*/
USKIN_API HUSKIN __stdcall USkinOpenSkinData(LPCTSTR lpszSkinObjectName);

/*----------------------------------------------------------------------------
Function Name	:USkinCloseSkinData
Description		:Close custom skin data. 
ProtoType		:
	BOOL USkinCloseSkinData(  HUSKIN hUSkin    // handle to the uskin object
	);
Parameters		:
	hUSkin 
		[in] The handle of uskin object 
Return values	:
	If the function succeeds, the return value is a handle to the uskin object. If the function fails, the return value is NULL. 
*/
USKIN_API BOOL __stdcall USkinCloseSkinData(HUSKIN hUSkin);

/*----------------------------------------------------------------------------
Function Name	:USkinGetBool
Description		:Get custom define skin object bool property value. 
ProtoType		:
	BOOL USkinGetBool(  HUSKIN hUSkin    // The handle to the uskin object
		LPCTSTR lpszSkinPropName    // property name
		BOOL* lpValue    // 
	);
Parameters		:
	hUSkin 
		[in] The handle to the uskin object 
	lpszSkinPropName 
		[in] property name 
	lpValue 
		[out] BOOL vlaue pointer 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL __stdcall USkinGetBool(HUSKIN hUSkin,LPCTSTR lpszSkinPropName,BOOL* lpValue);

/*----------------------------------------------------------------------------
Function Name	:USkinGetInt
Description		:Get int property value of uskin object. 
ProtoType		:
	BOOL USkinGetInt(  HUSKIN hUSkin    // handle to the uskin object
		LPCTSTR lpszSkinPropName    // property name
		int* lpValue    // 
	);
Parameters		:
	hUSkin 
		[in] handle to the uskin object 
	lpszSkinPropName 
		[in] property name 
	lpValue 
		[out] int value pointer 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL __stdcall USkinGetInt(HUSKIN hUSkin,LPCTSTR lpszSkinPropName,int* lpValue);

/*----------------------------------------------------------------------------
Function Name	:USkinGetDWORD
Description		:Get custom define skin object DWORD property value. 
ProtoType		:
	BOOL USkinGetDWORD(  HUSKIN hUSkin    // The handle to the uskin object
		LPCTSTR lpszSkinPropName    // property name
		DWORD* lpValue    // 
	);
Parameters		:
	hUSkin 
		[in] The handle to the uskin object 
	lpszSkinPropName 
		[in] property name 
	lpValue 
		[out] DWORD value pointer 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL __stdcall USkinGetDWORD(HUSKIN hUSkin,LPCTSTR lpszSkinPropName,DWORD* lpValue);

/*----------------------------------------------------------------------------
Function Name	:USkinGetDouble
Description		:Get custom define skin object double property value. 
ProtoType		:
	BOOL USkinGetDouble(  HUSKIN hUSkin    // The handle to the uskin object
		LPCTSTR lpszSkinPropName    // property name
		double* lpValue    // 
	);
Parameters		:
	hUSkin 
		[in] The handle to the uskin object 
	lpszSkinPropName 
		[in] property name 
	lpValue 
		[out] double value pointer 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 
*/
USKIN_API BOOL __stdcall USkinGetDouble(HUSKIN hUSkin,LPCTSTR lpszSkinPropName,double* lpValue);

/*----------------------------------------------------------------------------
Function Name	:USkinGetString
Description		:Get custom define skin object string property value. 
ProtoType		:
	BOOL USkinGetString(  HUSKIN hUSkin    // The handle to the uskin object
		LPCTSTR lpszSkinPropName    // property name
		LPTSTR lpString    // pointer to the string buffer
		UINT nMaxSize    // string buffer max size
	);
Parameters		:
	hUSkin 
		[in] The handle to the uskin object 
	lpszSkinPropName 
		[in] property name 
	lpString 
		[out] pointer to the string buffer 
	nMaxSize 
		[in] max size of string buffer 
Return values	:
	If the function succeeds, the return value is nonzero. If the function fails, the return value is zero 
*/
USKIN_API BOOL __stdcall USkinGetString(HUSKIN hUSkin,LPCTSTR lpszSkinPropName,LPTSTR lpString,UINT nMaxSize);

/*----------------------------------------------------------------------------
Function Name	:USkinGetEnumString
Description		:Get custom define skin object enum value name. 
ProtoType		:
	BOOL USkinGetEnumString(  HUSKIN hUSkin    // The handle to the uskin object
		LPCTSTR lpszSkinPropName    // property name
		LPTSTR lpString    // pointer to the string buffer
		UINT nMaxSize    // 
	);
Parameters		:
	hUSkin 
		[in] The handle to the uskin object 
	lpszSkinPropName 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -