I have more info :
WindowImplWin32::WindowImplWin32(WindowHandle handle) :
m_handle (handle),
m_callback (0),
m_cursor (NULL),
m_icon (NULL),
m_keyRepeatEnabled(true),
m_isCursorIn (false),
m_lastSize (0, 0),
m_resizing (false)
{
if (m_handle)
{
SetLastError(0);
// We change the event procedure of the control (it is important to save the old one)
SetWindowLongPtr(m_handle, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
m_callback = SetWindowLongPtr(m_handle, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(&WindowImplWin32::globalOnEvent));
int err = GetLastError();
int a = err;
a += 1;
}
}
GetLastError() returns 5
ERROR_ACCESS_DENIED
5 (0x5)
Access is denied.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx