VOID CSubChatEdit::EnterChatBox(LPVOID userData){
-
- ((CSubChatEdit*)userData)->SetReadOnly(TRUE);
- if(((CSubChatEdit*)userData)->self.nicoLiveStream.IsOwner()){
-
- Sleep(1500);
-
- }else {
- Sleep(3000);
- }
- ((CSubChatEdit*)userData)->AgreeEnter();
-
- _endthread();
- return;
-}
-
-BOOL CCommentWriteWindow::SendChat(){
-
- _beginthread(CSubChatEdit::EnterChatBox,0,&this->commentSubEdit);
-
+ auto owner = ((CSubChatEdit*)userData)->self;
+ auto &self = *((CSubChatEdit*)userData);
CCommentMaker commentMaker;
- std::vector<TCHAR> chat(commentSubEdit.GetWindowTextLengthW() + 1);
+ std::vector<TCHAR> chat(owner.commentSubEdit.GetWindowTextLengthW() + 1);
- commentSubEdit.GetWindowTextW(&chat[0],chat.size());
+ owner.commentSubEdit.GetWindowTextW(&chat[0],chat.size());
commentMaker.SetChatString(&chat[0]);
- if(this->anonymousButton.GetCheck() == BST_CHECKED){
+ if(owner.anonymousButton.GetCheck() == BST_CHECKED){
commentMaker.AddMail(ANONYMOUS_MAILCOMMAND);
}
- INT_PTR sizeIndex = commentSizeBox.GetCurSel();
+ INT_PTR sizeIndex = owner.commentSizeBox.GetCurSel();
if(sizeIndex == CB_ERR)sizeIndex = 0;
- auto &rCommentSizeInfo = *(CommentSizeInfo*)commentSizeBox.GetItemDataPtr(sizeIndex);
+ auto &rCommentSizeInfo = *(CommentSizeInfo*)owner.commentSizeBox.GetItemDataPtr(sizeIndex);
if(_tcscmp(rCommentSizeInfo.userData,DEFAULT_COMMENTSIZE) != 0){
commentMaker.AddMail(rCommentSizeInfo.userData);
}
- INT_PTR posIndex = commentPosBox.GetCurSel();
+ INT_PTR posIndex = owner.commentPosBox.GetCurSel();
if(posIndex == CB_ERR)posIndex = 0;
- auto &rCommentPosInfo = *(CommentPosInfo*)commentPosBox.GetItemDataPtr(posIndex);
+ auto &rCommentPosInfo = *(CommentPosInfo*)owner.commentPosBox.GetItemDataPtr(posIndex);
if(_tcscmp(rCommentPosInfo.userData,DEFAULT_COMMENTPOS) != 0){
commentMaker.AddMail(rCommentPosInfo.userData);
}
- INT_PTR colorIndex = commentColorBox.GetCurSel();
+ INT_PTR colorIndex = owner.commentColorBox.GetCurSel();
if(colorIndex == CB_ERR)colorIndex = 0;
- auto &rCommentColorInfo = *(CommentColorInfo*)commentColorBox.GetItemDataPtr(colorIndex);
+ auto &rCommentColorInfo = *(CommentColorInfo*)owner.commentColorBox.GetItemDataPtr(colorIndex);
if(_tcscmp(rCommentColorInfo.name,DEFAULT_COMMENTCOLOR) != 0){
}
- BOOL rslt = FALSE;
NLIB_RESULT code = NLIB_ERR_CODE_NOTSET;
- if(nicoLiveStream.IsOwner() ==TRUE && this->ownerModeButton.GetCheck() == BST_CHECKED){
+ if(owner.nicoLiveStream.IsOwner() ==TRUE && owner.ownerModeButton.GetCheck() == BST_CHECKED){
- code = nicoLiveStream.SendOwnerChat(commentMaker);
+ code = owner.nicoLiveStream.SendOwnerChat(commentMaker);
} else {
- code = nicoLiveStream.SendChat(commentMaker);
+ code = owner.nicoLiveStream.SendChat(commentMaker);
}
case NLIB_ERR_OK:
- rslt = TRUE;
- this->commentSubEdit.SetWindowText(TEXT(""));
+
+ owner.commentSubEdit.SetWindowText(TEXT(""));
goto end;
case NLIB_ERR_NOT_LIVECONNECT:
case NLIB_FAILED_CONNECT:
- ::MessageBox(*this,NLIB_GetErrorMessage(code),TEXT("\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\83G\83\89\81["),MB_ICONERROR | MB_OK);
- commentSubEdit.AgreeEnter();
+ ::MessageBox(owner,NLIB_GetErrorMessage(code),TEXT("\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\83G\83\89\81["),MB_ICONERROR | MB_OK);
+ owner.commentSubEdit.AgreeEnter();
break;
default:
UnexpectedErrorMessageShow(TEXT("\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\92\86\82É"),NLIB_GetErrorMessage(code),__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
- commentSubEdit.AgreeEnter();
+ owner.commentSubEdit.AgreeEnter();
break;
}
- rslt = FALSE;
+end:
+
+
+
+ if((owner.nicoLiveStream.IsOwner())){
+ Sleep(1000);
+
+ }else {
+ Sleep(3000);
+ }
+ ((CSubChatEdit*)userData)->AgreeEnter();
+
+ _endthread();
+ return;
+}
+
+BOOL CCommentWriteWindow::SendChat(){
+
+ this->commentSubEdit.SetReadOnly(TRUE);
+ _beginthread(CSubChatEdit::EnterChatBox,0,&this->commentSubEdit);
+
-end:
+
- return rslt;
+
+
+ return TRUE;
}