它需要一些嘗試從我的部分錯誤,但__stdcall
是我需要的調用約定。之前我曾嘗試過__cdecl
,但這(顯然)沒有奏效。
.H
HTHEME (__stdcall *OpenThemeData)(
HWND hwnd,
LPCWSTR pszClassList
);
HRESULT (__stdcall *GetThemePartSize)(
HTHEME hTheme,
__in_opt HDC hdc,
int iPartId,
int iStateId,
__in_opt LPCRECT prc,
enum THEMESIZE eSize,
__out SIZE *psz
);
HRESULT (__stdcall *DrawThemeBackground)(
HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pRect,
__in_opt LPCRECT pClipRect
);
HRESULT (__stdcall *DrawThemeEdge)(
HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pDestRect,
UINT uEdge,
UINT uFlags,
__out_opt LPRECT pContentRect
);
HRESULT (__stdcall * CloseThemeData)(
HTHEME hTheme
);
的.cpp
OpenThemeData = (HTHEME (__stdcall *)(
HWND hwnd,
LPCWSTR pszClassList
)) GetProcAddress (DllHandle, "OpenThemeData") ;
GetThemePartSize = (HRESULT (__stdcall *)(
HTHEME hTheme,
__in_opt HDC hdc,
int iPartId,
int iStateId,
__in_opt LPCRECT prc,
enum THEMESIZE eSize,
__out SIZE *psz
)) GetProcAddress (DllHandle, "GetThemePartSize") ;
DrawThemeBackground = (HRESULT (__stdcall *)(
HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pRect,
__in_opt LPCRECT pClipRect
)) GetProcAddress (DllHandle, "DrawThemeBackground") ;
DrawThemeEdge = (HRESULT (__stdcall *)(
HTHEME hTheme,
HDC hdc,
int iPartId,
int iStateId,
LPCRECT pDestRect,
UINT uEdge,
UINT uFlags,
__out_opt LPRECT pContentRect
)) GetProcAddress (DllHandle, "DrawThemeEdge") ;
CloseThemeData = (HRESULT (__stdcall *)(
HTHEME hTheme
)) GetProcAddress (DllHandle, "CloseThemeData") ;
一切都工作得很好,現在,還對Win2K的