首页 > 其他 > 详细

cocos2d设置窗口标题

时间:2019-10-18 18:45:18      阅读:125      评论:0      收藏:0      [点我收藏+]
	//窗口标题
#ifdef WIN32
		CCEGLView* pGlView=CCDirector::sharedDirector()->getOpenGLView();
		if (pGlView)
		{
			std::string temp = U8ToA(name.c_str());
			int len=MultiByteToWideChar(CP_ACP, 0, (LPCSTR)temp.c_str(), -1, NULL,0); 
			wchar_t * wszUtf8 = new wchar_t[len+1]; 
			memset(wszUtf8, 0, len * 2 + 2); 
			MultiByteToWideChar(CP_ACP, 0, (LPCSTR)temp.c_str(), -1, (LPWSTR)wszUtf8, len);
			std::wstring szDst = wszUtf8;
			delete[] wszUtf8;

			//LPCWSTR
			HWND _handle= pGlView->getHWnd(); 
			SetWindowTextW(_handle,szDst.c_str());

			
		}
		
#endif

  

cocos2d设置窗口标题

原文:https://www.cnblogs.com/gamesky/p/11699652.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!