X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4676948b6814c97b93c431a8cbcd8c0352c87ba9..665b71b17c8eb8f2586a8c84f8d9cf0d8559bf35:/src/msw/utilsgui.cpp diff --git a/src/msw/utilsgui.cpp b/src/msw/utilsgui.cpp index 9b14ea38ac..ebcb3ef138 100644 --- a/src/msw/utilsgui.cpp +++ b/src/msw/utilsgui.cpp @@ -6,7 +6,7 @@ // Created: 21.06.2003 (extracted from msw/utils.cpp) // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// License: wxWindows license +// License: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -99,7 +99,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, wxChar **valu return FALSE; } if (*value) delete[] (*value); - *value = copystring(buf); + *value = wxStrcpy(new wxChar[wxStrlen(buf) + 1], buf); return TRUE; } @@ -334,7 +334,7 @@ void wxDisplaySizeMM(int *width, int *height) void wxClientDisplayRect(int *x, int *y, int *width, int *height) { -#if defined(__WIN16__) || defined(__WXMICROWIN__) +#if defined(__WXMICROWIN__) *x = 0; *y = 0; wxDisplaySize(width, height); #else @@ -361,8 +361,7 @@ wxString WXDLLEXPORT wxGetWindowText(WXHWND hWnd) if ( hWnd ) { int len = GetWindowTextLength((HWND)hWnd) + 1; - ::GetWindowText((HWND)hWnd, str.GetWriteBuf(len), len); - str.UngetWriteBuf(); + ::GetWindowText((HWND)hWnd, wxStringBuffer(str, len), len); } return str; @@ -380,9 +379,8 @@ wxString WXDLLEXPORT wxGetWindowClass(WXHWND hWnd) for ( ;; ) { - int count = ::GetClassName((HWND)hWnd, str.GetWriteBuf(len), len); + int count = ::GetClassName((HWND)hWnd, wxStringBuffer(str, len), len); - str.UngetWriteBuf(); if ( count == len ) { // the class name might have been truncated, retry with larger @@ -402,11 +400,7 @@ wxString WXDLLEXPORT wxGetWindowClass(WXHWND hWnd) WXWORD WXDLLEXPORT wxGetWindowId(WXHWND hWnd) { -#ifndef __WIN32__ - return (WXWORD)GetWindowWord((HWND)hWnd, GWW_ID); -#else // Win32 return (WXWORD)GetWindowLong((HWND)hWnd, GWL_ID); -#endif // Win16/32 } // ----------------------------------------------------------------------------