fixed: garbage drop target on windows when elevated.
This commit is contained in:
parent
d03b398bc1
commit
af51454e98
|
@ -148,11 +148,15 @@ CMSWindowsScreen::CMSWindowsScreen(
|
||||||
LOG((CLOG_DEBUG "screen shape: %d,%d %dx%d %s", m_x, m_y, m_w, m_h, m_multimon ? "(multi-monitor)" : ""));
|
LOG((CLOG_DEBUG "screen shape: %d,%d %dx%d %s", m_x, m_y, m_w, m_h, m_multimon ? "(multi-monitor)" : ""));
|
||||||
LOG((CLOG_DEBUG "window is 0x%08x", m_window));
|
LOG((CLOG_DEBUG "window is 0x%08x", m_window));
|
||||||
|
|
||||||
wchar_t* desktopPath = 0;
|
// SHGetFolderPath is deprecated in vista, but use it for xp support.
|
||||||
SHGetKnownFolderPath(FOLDERID_Desktop, 0, NULL, &desktopPath);
|
char desktopPath[MAX_PATH];
|
||||||
m_desktopPath = _bstr_t(desktopPath);
|
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_DESKTOP, NULL, 0, desktopPath))) {
|
||||||
CoTaskMemFree(static_cast<void*>(desktopPath));
|
m_desktopPath = CString(desktopPath);
|
||||||
LOG((CLOG_DEBUG "using desktop for drop target: %s", m_desktopPath.c_str()));
|
LOG((CLOG_DEBUG "using desktop for drop target: %s", m_desktopPath.c_str()));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LOG((CLOG_ERR "failed to get desktop path, no drop target available, error=%d", GetLastError()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
delete m_keyState;
|
delete m_keyState;
|
||||||
|
|
Loading…
Reference in New Issue