Home > Software engineering >  Skinsharp dynamic change skin problem SkinH_AttachEx SkinH_AttachResEx are not success, strives for
Skinsharp dynamic change skin problem SkinH_AttachEx SkinH_AttachResEx are not success, strives for

Time:05-07

The problems such as topic,
Use the SkinH_Attach (); Can be successful,
The code below
 
/* * * * * * * * * * * * * * * * * * * * * * error code * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
# define SRET_OK 0//success
//# define SRET_ERROR 1 failed
2//# define SRET_ERROR_READ skin file read error
3//# define SRET_ERROR_PARAM parameter error
4//# define SRET_ERROR_CREATE failed to create the skin
5//# define SRET_ERROR_FORMAT skin format is not correct
6//# define SRET_ERROR_VERSION skin version are not compatible
7//# define SRET_ERROR_PASSWORD skin key error
8//# define SRET_ERROR_INVALID skinning engine invalid
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Int k=SkinH_AttachEx (_T ("..//Debug//0011. She "), NULL);//the return value 1;

Int n=SkinH_AttachResEx ((LPCTSTR) (IDR_SHE1), _T (" SHE "), _T (" "), 0, 0).//the return value 3

/*
Function: the specified resource and specify the corresponding hue, saturation and brightness
The return value: failed to successfully returns 0, returns non-zero
*/
DECLSKINHAPI SkinH_AttachRes (
LPBYTE pShe,/skin/resources data pointer
DWORD dwSize,/skin/resources data length
LPCTSTR strPassword,//the skin keys
Int nHue,//hue, value range - 180-180, the default value of 0
Int nSat,//saturation, and value range - 100-100, the default value of 0
Int nBri//brightness, scope - 100-100, the default value of 0
);


/*
Function: the specified skin resources and specify the corresponding hue, saturation and brightness
The return value: failed to successfully returns 0, returns non-zero
*/
DECLSKINHAPI SkinH_AttachResEx (
LPCTSTR lpName,//resource name
LPCTSTR lpType,//resource type
LPCTSTR strPassword,//the skin keys
Int nHue,//hue, value range - 180-180, the default value of 0
Int nSat,//saturation, and value range - 100-100, the default value of 0
Int nBri//brightness, scope - 100-100, the default value of 0
);

/*
 


Resource file:
# define IDR_SHE1 133
# define IDR_SHE2 134
# define IDR_SHE3 135
# define IDR_SHE4 136
# define IDR_SHE5 137
# define IDR_SHE6 138
# define IDR_SHE7 139
# define IDR_SHE8 140
# define IDR_SHE9 141
# define IDR_SHE10 142

IDR_SHE1 SHE "D: \ \ VS_2012project \ \ YH_ES \ \ Debug \ \ sharpskin \ \ 0001. SHE"
IDR_SHE2 SHE "D: \ \ VS_2012project \ \ YH_ES \ \ Debug \ \ sharpskin \ \ 0002. SHE"
IDR_SHE3 SHE "D: \ \ VS_2012project \ \ YH_ES \ \ Debug \ \ sharpskin \ \ 0003. SHE"
IDR_SHE4 SHE "D: \ \ VS_2012project \ \ YH_ES \ \ Debug \ \ sharpskin \ \ 0004. SHE"
IDR_SHE5 SHE "D: \ \ VS_2012project \ \ YH_ES \ \ Debug \ \ sharpskin \ \ 0005. SHE"
IDR_SHE6 SHE "D: \ \ VS_2012project \ \ YH_ES \ \ Debug \ \ sharpskin \ \ 0006. SHE"
IDR_SHE7 SHE "D: \ \ VS_2012project \ \ YH_ES \ \ Debug \ \ sharpskin \ \ 0007. SHE"
IDR_SHE8 SHE "D: \ \ VS_2012project \ \ YH_ES \ \ Debug \ \ sharpskin \ \ 0008. SHE"
IDR_SHE9 SHE "D: \ \ VS_2012project \ \ YH_ES \ \ Debug \ \ sharpskin \ \ 0009. SHE"
IDR_SHE10 SHE "D: \ \ VS_2012project \ \ YH_ES \ \ Debug \ \ sharpskin \ \ 0010. SHE"
  • Related