Commit ba581fdd authored by hybrid's avatar hybrid

Relaxed the Window caption setting in order to avoid problems with threaded...

Relaxed the Window caption setting in order to avoid problems with threaded applications or external windows.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1604 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 28dbc4be
...@@ -602,21 +602,24 @@ void CIrrDeviceWin32::resizeIfNecessary() ...@@ -602,21 +602,24 @@ void CIrrDeviceWin32::resizeIfNecessary()
} }
//! sets the caption of the window //! sets the caption of the window
void CIrrDeviceWin32::setWindowCaption(const wchar_t* text) void CIrrDeviceWin32::setWindowCaption(const wchar_t* text)
{ {
DWORD dwResult;
if (IsNonNTWindows) if (IsNonNTWindows)
{ {
core::stringc s = text; const core::stringc s = text;
SetWindowTextA(HWnd, s.c_str()); SendMessageTimeout(HWnd, WM_SETTEXT, 0,
reinterpret_cast<LPARAM>(s.c_str()),
SMTO_ABORTIFHUNG, 2000, &dwResult);
} }
else else
SetWindowTextW(HWnd, text); SendMessageTimeoutW(HWnd, WM_SETTEXT, 0,
reinterpret_cast<LPARAM>(text),
SMTO_ABORTIFHUNG, 2000, &dwResult);
} }
//! presents a surface in the client area //! presents a surface in the client area
bool CIrrDeviceWin32::present(video::IImage* image, void* windowId, core::rect<s32>* src) bool CIrrDeviceWin32::present(video::IImage* image, void* windowId, core::rect<s32>* src)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment