duilib中 windows有關于陰影的屬性設定后無效,其中代碼中包含WndShadow檔案
uj5u.com熱心網友回復:
我做的只是搜索了一下。。http://tieba.baidu.com/p/3534520975
uj5u.com熱心網友回復:
這個我做過,最好是兩個視窗疊加,陰影視窗設定成layered,支持半透明。
放在正常視窗的下面,即可。
兩個視窗聯動。
uj5u.com熱心網友回復:
class DIRECTUI_API CSkinShadow{
public:
CSkinShadow(void);
virtual ~CSkinShadow(void);
protected:
//實體句柄,用于注冊串口類和創建視窗
static HINSTANCE s_hInstance;
HWND m_hWnd;
HWND m_hParent;
#pragma warning(push)
#pragma warning(disable:4786)
static std::map<HWND, CSkinShadow *> s_Shadowmap;
#pragma warning(pop)
LONG m_OriParentProc; // Original WndProc of parent window
BYTE m_Status;
enum ShadowStatus
{
SS_ENABLED = 1, // Shadow is enabled, if not, the following one is always false
SS_VISABLE = 1 << 1, // Shadow window is visible
SS_PARENTVISIBLE = 1<< 2, // Parent window is visible, if not, the above one is always false
};
signed char m_nEdgeSize; // Shadow window size, relative to parent window size
LPARAM m_WndSize; // Restore last parent window size,
// used to determine the update strategy when parent window is resized
bool m_bUpdate; // Set this to true if the shadow should not be update until next WM_PAINT is received
static CDuiImage m_Image;
// HINSTANCE m_hInstance;
public:
static bool Initialize(HINSTANCE hInstance);
static void SetImage( UINT nID, LPCTSTR lpszType, HINSTANCE hInstance );
void Create( HWND hParentWnd );
bool SetSize(int NewSize = 0);
// Redraw, resize and move the shadow
// called when window resized or shadow properties changed, but not only moved without resizing
void Update(HWND hParent);
void ShowShadow(BOOL bShow, HWND hParent);
// Show or hide the shadow, depending on the enabled status stored in m_Status
void Show(HWND hParent);
protected:
//static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK ParentProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
};
}
uj5u.com熱心網友回復:
class DIRECTUI_API CSkinShadow
{
public:
CSkinShadow(void);
virtual ~CSkinShadow(void);
protected:
//實體句柄,用于注冊串口類和創建視窗
static HINSTANCE s_hInstance;
HWND m_hWnd;
HWND m_hParent;
#pragma warning(push)
#pragma warning(disable:4786)
static std::map<HWND, CSkinShadow *> s_Shadowmap;
#pragma warning(pop)
LONG m_OriParentProc; // Original WndProc of parent window
BYTE m_Status;
enum ShadowStatus
{
SS_ENABLED = 1, // Shadow is enabled, if not, the following one is always false
SS_VISABLE = 1 << 1, // Shadow window is visible
SS_PARENTVISIBLE = 1<< 2, // Parent window is visible, if not, the above one is always false
};
signed char m_nEdgeSize; // Shadow window size, relative to parent window size
LPARAM m_WndSize; // Restore last parent window size,
// used to determine the update strategy when parent window is resized
bool m_bUpdate; // Set this to true if the shadow should not be update until next WM_PAINT is received
static CDuiImage m_Image;
// HINSTANCE m_hInstance;
public:
static bool Initialize(HINSTANCE hInstance);
static void SetImage( UINT nID, LPCTSTR lpszType, HINSTANCE hInstance );
void Create( HWND hParentWnd );
bool SetSize(int NewSize = 0);
// Redraw, resize and move the shadow
// called when window resized or shadow properties changed, but not only moved without resizing
void Update(HWND hParent);
void ShowShadow(BOOL bShow, HWND hParent);
// Show or hide the shadow, depending on the enabled status stored in m_Status
void Show(HWND hParent);
protected:
//static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK ParentProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
};
}
我們的產品用了duilib好幾年了,可以使用網上的CSkinShadow類,可以有效果的(陰影圖片是我們自己貼圖的)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/85587.html
標籤:界面
上一篇:Cbutton自繪圖
