const static LPCTSTR WRITE_BOTTONSTRING = TEXT("\8f\91\82«\8d\9e\82Ý");
const static LPCTSTR CHECKBUTTON_HIDDENSTRING = TEXT(" ");
+
+const static COLORREF OWNEREDITCOLOR = RGB(255,192,192);
+const static COLORREF NORMALEDITCOLOR = RGB(255,255,255);
const static RECT COMMENTWRITEWINDOW_SEPARATEFSIZE = {0,5,0,5};
const static UINT_PTR COMMENTWRITEWINDOW_SIDESEPARATESIZE = 5;
const static UINT_PTR INIT_COMMENTWRITE_MAXLENGTH = 60;
commentSizeBox.SetFont(AtlGetDefaultGuiFont());
commentColorBox.SetFont(AtlGetDefaultGuiFont());
- anonymousButton.SetWindowTextW(ANONYMOUS_MAILCOMMAND);
+
anonymousButton.SetFont(AtlGetDefaultGuiFont());
commentSubEdit.SetFont(AtlGetDefaultGuiFont());
commentSubEdit.SetLimitText(commentWriteMaxLength);
timeLogFont.lfWeight = FW_BOLD;
timeFont.CreateFontIndirectW(&timeLogFont);
-
-
+ anonymousButton.SetWindowTextW(ANONYMOUS_MAILCOMMAND);
+ ownerModeButton.SetWindowText(OWNERMODE_BOTTONSTRING);
return 0;
}
if(nicoLiveStream.IsOwner() == TRUE){
this->ownerModeButton.ShowWindow(SW_SHOW);
+ ownerModeButton.SetCheck(BST_CHECKED);
+ editBkColor = OWNEREDITCOLOR;
} else {
this->ownerModeButton.ShowWindow(SW_HIDE);
+ editBkColor = NORMALEDITCOLOR;
}
+ if(this->editBkBrush.IsNull() ==FALSE){
+ editBkBrush.DeleteObject();
+ }
+
+ editBkBrush.CreateSolidBrush(editBkColor);
+ SIZE size;
+ RECT windowRect;
+ this->GetClientRect(&windowRect);
+ size.cx = windowRect.right - windowRect.left;
+ size.cy = windowRect.bottom - windowRect.top;
+ ChangeSize(size);
return;
}
}
+LRESULT CCommentWriteWindow::OnCtlolorEdit(HDC hdc,HWND hWnd){
+
+ if(hWnd == this->commentSubEdit){
+
+
+ SetBkMode(hdc, TRANSPARENT); // \94w\8ci\82ð\93§\89ß
+ SetBkColor(hdc,this->editBkColor); // \83e\83L\83X\83g\82ª\8f\91\82©\82ê\82Ä\82¢\82é\95\94\95ª\82Ì\83e\83L\83X\83g\82Ì\94w\8ci\82Ì\90F
+
+ return (LRESULT)editBkBrush.m_hBrush;
+ }
+
+ return 0;
+}
+
LRESULT CCommentWriteWindow::OnButton(UINT hiWparam,INT_PTR loWparam,HWND lParam){
if(lParam == commentWriteButton){
this->SendChat();
+ } else if(lParam == this->ownerModeButton){
+
+ if(this->ownerModeButton.GetCheck() == BST_CHECKED){
+
+ this->editBkColor = OWNEREDITCOLOR;
+
+ } else {
+
+ this->editBkColor = NORMALEDITCOLOR;
+ }
+
+ if(this->editBkBrush.IsNull() == FALSE){
+
+ this->editBkBrush.DeleteObject();
+
+ }
+
+ this->editBkBrush.CreateSolidBrush(editBkColor);
+ commentSubEdit.Invalidate();
+
}
return TRUE;
time_t streamTime; //\95ú\91\97\8co\89ß\8e\9e\8aÔ
CFont checkButtonFont; //184\95\\8e¦\97p\83t\83H\83\93\83g
CFont timeFont; //\8co\89ß\8e\9e\8aÔ\95\\8e¦\97p\83t\83H\83\93\83g
-
+ COLORREF editBkColor; //\83G\83f\83B\83b\83g\82Ì\94w\8ci\90F
+ CBrush editBkBrush; //\83G\83f\83B\83b\83g\82Ì\94w\8ci\83u\83\89\83V
//\83R\83\93\83g\83\8d\81[\83\8bID
enum CONTROLID{
MSG_WM_PAINT(OnPaint)
MSG_WM_SIZE(OnSize)
MSG_WM_ERASEBKGND(OnEraseBkGnd)
+ MSG_WM_CTLCOLOREDIT(OnCtlolorEdit)
MSG_WM_DRAWITEM(OnDrawItem)
MSG_WM_MEASUREITEM(OnMeasureItem)
MSG_WM_TIMER(OnTimer)
COMMAND_CODE_HANDLER_EX(BN_CLICKED,OnButton)
-
END_MSG_MAP()
LRESULT OnButton(UINT hiWparam,INT_PTR loWparam,HWND lParam);
+ ///
+ ///\83G\83f\83B\83b\83g\83R\83\93\83g\83\8d\81[\83\8b\83J\83X\83^\83\80\83h\83\8d\81[
+ ///
+ LRESULT OnCtlolorEdit(HDC hdc,HWND hWnd);
+
VOID OnTimer(UINT id);