Build and run ::wxGetUserName() silently with unusual configs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
3d971ca9f1
commit
66d84d1130
@ -31,6 +31,7 @@
|
|||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#endif //WX_PRECOMP
|
#endif //WX_PRECOMP
|
||||||
|
|
||||||
|
#include "wx/msw/registry.h"
|
||||||
#include "wx/apptrait.h"
|
#include "wx/apptrait.h"
|
||||||
#include "wx/dynlib.h"
|
#include "wx/dynlib.h"
|
||||||
#include "wx/dynload.h"
|
#include "wx/dynload.h"
|
||||||
@ -288,11 +289,12 @@ bool wxGetUserName(wxChar *buf, int maxSize)
|
|||||||
wxCHECK_MSG( buf && ( maxSize > 0 ), false,
|
wxCHECK_MSG( buf && ( maxSize > 0 ), false,
|
||||||
_T("empty buffer in wxGetUserName") );
|
_T("empty buffer in wxGetUserName") );
|
||||||
#if defined(__WXWINCE__)
|
#if defined(__WXWINCE__)
|
||||||
wxRegKey key(wxRegKey::HKCU, wxT("Control Panel\\Owner\\Owner"));
|
wxLogNull noLog;
|
||||||
|
wxRegKey key(wxRegKey::HKCU, wxT("ControlPanel\\Owner"));
|
||||||
if(!key.Open(wxRegKey::Read))
|
if(!key.Open(wxRegKey::Read))
|
||||||
return false;
|
return false;
|
||||||
wxString name;
|
wxString name;
|
||||||
if(!key.QueryValue(wxEmptyString, name))
|
if(!key.QueryValue(wxT("Owner"),name))
|
||||||
return false;
|
return false;
|
||||||
wxStrncpy(buf, name.c_str(), maxSize-1);
|
wxStrncpy(buf, name.c_str(), maxSize-1);
|
||||||
buf[maxSize-1] = _T('\0');
|
buf[maxSize-1] = _T('\0');
|
||||||
|
Loading…
Reference in New Issue
Block a user