mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-10 11:59:58 -05:00
Initial community commit
This commit is contained in:
33
Src/Winamp/WADrawDC.cpp
Normal file
33
Src/Winamp/WADrawDC.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
#include "draw.h"
|
||||
#include "WADrawDC.h"
|
||||
|
||||
WADrawDC::WADrawDC(HWND _hwnd)
|
||||
{
|
||||
hdc = draw_GetWindowDC(_hwnd);
|
||||
hwnd=_hwnd;
|
||||
}
|
||||
|
||||
WADrawDC::WADrawDC(HDC _hdc, HWND _hwnd)
|
||||
{
|
||||
if (!_hdc)
|
||||
{
|
||||
hdc = draw_GetWindowDC(_hwnd);
|
||||
hwnd=_hwnd;
|
||||
}
|
||||
else
|
||||
{
|
||||
hdc=_hdc;
|
||||
hwnd=0; // set to 0 so we know not to call draw_ReleaseDC
|
||||
}
|
||||
}
|
||||
|
||||
WADrawDC::~WADrawDC()
|
||||
{
|
||||
if (hwnd)
|
||||
draw_ReleaseDC(hwnd,hdc);
|
||||
}
|
||||
|
||||
WADrawDC::operator HDC()
|
||||
{
|
||||
return hdc;
|
||||
}
|
Reference in New Issue
Block a user