Home > Software engineering >  Duilib form shadow
Duilib form shadow

Time:09-27

Duilib Windows about the shadow in the attribute set is invalid, after which the code contained in the WndShadow file

CodePudding user response:

I just search,
http://tieba.baidu.com/p/3534520975

CodePudding user response:

refer to the original poster weixin_36587312 response:
duilib Windows about the shadow in the attribute set is invalid, after which the code contained in the WndShadow file

This I have done, it is best superposition of two Windows, shadow window set to layered, support the translucent,
Under the normal window, can,
Two Windows,

CodePudding user response:

The class DIRECTUI_API CSkinShadow
{
Public:
CSkinShadow (void);
Virtual ~ CSkinShadow (void);

Protected:
//instance handle, used to register a serial port and create a window
The static HINSTANCE s_hInstance;
The HWND m_hWnd;
The HWND m_hParent;
# pragma warning (push)
# pragma warning (4786) disable:
The static STD: : map# pragma warning (pop)

LONG m_OriParentProc;//the Original WndProc of the parent window
BYTE m_Status;

Enum ShadowStatus
{
SS_ENABLED=1,//Shadow is enabled, if not, the following one is always false
SS_VISABLE=1 & lt; <1,//Shadow window is visible
SS_PARENTVISIBLE=1 & lt; <2,//the Parent window is visible, if not, the above one is always false
};

Signed char m_nEdgeSize;//Shadow window size, relative to the parent window size
LPARAM m_WndSize;//Restore the last parent window size,
//2 to determine the update strategy when the parent window is resized
Bool m_bUpdate;//Set this to true if the shadow should not be update until next WM_PAINT is received

The static CDuiImage m_Image;

//HINSTANCE m_hInstance;
Public:
The static bool Initialize (HINSTANCE HINSTANCE);
The static void SetImage (UINT nID, LPCTSTR lpszType, HINSTANCE HINSTANCE);
Void the Create (HWND hParentWnd);
Bool SetSize (int NewSize=0);

//the Redraw, resize and move the shadow
//called when the window resized or shadow properties changed, but not only version without resizing
Void the Update (HWND hParent);

Void ShowShadow (BOOL bShow, HWND hParent);

//Show/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);
The static LRESULT CALLBACK ParentProc (HWND HWND, UINT uMsg, WPARAM WPARAM, LPARAM LPARAM);
};
}

CodePudding user response:

 class DIRECTUI_API CSkinShadow 
{
Public:
CSkinShadow (void);
Virtual ~ CSkinShadow (void);

Protected:
//instance handle, used to register a serial port and create a window
The static HINSTANCE s_hInstance;
The HWND m_hWnd;
The HWND m_hParent;
# pragma warning (push)
# pragma warning (4786) disable:
The static STD: : map# pragma warning (pop)

LONG m_OriParentProc;//the Original WndProc of the parent window
BYTE m_Status;

Enum ShadowStatus
{
SS_ENABLED=1,//Shadow is enabled, if not, the following one is always false
SS_VISABLE=1 & lt; <1,//Shadow window is visible
SS_PARENTVISIBLE=1 & lt; <2,//the Parent window is visible, if not, the above one is always false
};

Signed char m_nEdgeSize;//Shadow window size, relative to the parent window size
LPARAM m_WndSize;//Restore the last parent window size,
//2 to determine the update strategy when the parent window is resized
Bool m_bUpdate;//Set this to true if the shadow should not be update until next WM_PAINT is received

The static CDuiImage m_Image;

//HINSTANCE m_hInstance;
Public:
The static bool Initialize (HINSTANCE HINSTANCE);
The static void SetImage (UINT nID, LPCTSTR lpszType, HINSTANCE HINSTANCE);
Void the Create (HWND hParentWnd);
Bool SetSize (int NewSize=0);

//the Redraw, resize and move the shadow
//called when the window resized or shadow properties changed, but not only version without resizing
Void the Update (HWND hParent);

Void ShowShadow (BOOL bShow, HWND hParent);

//Show/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);
The static LRESULT CALLBACK ParentProc (HWND HWND, UINT uMsg, WPARAM WPARAM, LPARAM LPARAM);
};
}

Our products are used for duilib for several years, you can use the online CSkinShadow class, can have the effect of (shadow image is our own map)
  • Related