int CLyricPopupWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: 여기에 특수화된 작성 코드를 추가합니다.
return 0;
}
BOOL CLyricPopupWnd::PreTranslateMessage(MSG* pMsg)
{
// TODO: 여기에 특수화된 코드를 추가 및/또는 기본 클래스를 호출합니다.
return CWnd::PreTranslateMessage(pMsg);
}
void CTry01Dlg::OnButton3()
{
// TODO: Add your control notification handler code here
m_pLyricPopupWnd = new CLyricPopupWnd() ; //클래스 할당
//배경색이 검정색인 윈도우 클래스 등록
LPCTSTR lpClassName = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW,
0,(HBRUSH)GetStockObject(BLACK_BRUSH));
/*
or
WNDCLASS wndcls = {0,};
// Fill in the window class structure with parameters
// that describe the main window.
wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
//you can specify your own window procedure
wndcls.lpfnWndProc = ::DefWindowProc;
wndcls.hInstance = AfxGetInstanceHandle();
wndcls.hIcon = 0;
wndcls.hCursor = LoadCursor(0, MAKEINTRESOURCE(IDC_ARROW));
wndcls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wndcls.lpszMenuName = NULL;
// Specify your own class name for using FindWindow later
wndcls.lpszClassName =_T("Layered");
// Register the new class and trace if it fails
if(!AfxRegisterClass(&wndcls))
{
TRACE("Class Registration Failed\n");
return FALSE;
}
*/
m_pLyricPopupWnd->CreateEx(
WS_EX_TOPMOST|WS_EX_TRANSPARENT|WS_EX_LAYERED, //확장 윈도우 Style
lpClassName, //클래스 Name
_T("LYRICPOPUP"), //윈도우 Name
WS_POPUPWINDOW|WS_VISIBLE,//윈도우 Style
CRect(
LYRIC_POPUPWND_XPOS,
LYRIC_POPUPWND_YPOS,
LYRIC_POPUPWND_XPOS+LYRIC_POPUPWND_WIDTH,
LYRIC_POPUPWND_HEIGHT+LYRIC_POPUPWND_HEIGHT), //윈도우 위치 및 크기
this, //부모 윈도우 포인터
NULL //추가 데이타
);
}