Commit 5ebd4e02 authored by Sergey Radionov's avatar Sergey Radionov Committed by Cheng Sun

win32: added support of background color changing

Modified-by: 's avatarCheng Sun <chengsun9@gmail.com>
Signed-off-by: 's avatarCheng Sun <chengsun9@gmail.com>
parent 9581a8c3
......@@ -607,6 +607,10 @@ VLCHolderWnd::CreateHolderWindow(HINSTANCE hInstance,
VLCHolderWnd::~VLCHolderWnd()
{
if(_hBgBrush) {
DeleteObject(_hBgBrush);
_hBgBrush = 0;
}
}
bool VLCHolderWnd::Create(HWND hWndParent)
......@@ -618,7 +622,13 @@ bool VLCHolderWnd::Create(HWND hWndParent)
void VLCHolderWnd::PreRegisterWindowClass(WNDCLASS* wc)
{
wc->hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
if( !_hBgBrush){
BYTE r = 0, g = 0, b = 0;
HtmlColor2RGB(PO()->get_bg_color(), &r, &g, &b);
_hBgBrush = CreateSolidBrush(RGB(r, g, b));
}
wc->hbrBackground = _hBgBrush;
wc->lpszClassName = TEXT("Web Plugin VLC Window Holder Class");
}
......
......@@ -145,7 +145,7 @@ public:
protected:
VLCHolderWnd(HINSTANCE hInstance, VLCWindowsManager* WM)
: VLCWnd(hInstance), _hMouseHook(NULL), _MouseHookThreadId(0),
_wm(WM), _CtrlsWnd(0) {};
_wm(WM), _CtrlsWnd(0), _hBgBrush(0) {};
bool Create(HWND hWndParent);
virtual void PreRegisterWindowClass(WNDCLASS* wc);
......@@ -184,6 +184,7 @@ private:
private:
VLCWindowsManager* _wm;
HBRUSH _hBgBrush;
VLCControlsWnd* _CtrlsWnd;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment