Fixed hidpi issues in Win32

git-svn-id: svn://ultimatepp.org/upp/trunk@6086 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-05-21 13:49:06 +00:00
parent 83734aa7b7
commit b5c4a7760b
3 changed files with 11 additions and 1 deletions

View file

@ -120,7 +120,7 @@ void OutFilterStream::Close()
void OutFilterStream::FlushOut()
{
if(ptr != ~buffer) {
Filter(~buffer, ptr - ~buffer);
Filter(~buffer, (int)(ptr - ~buffer));
ptr = ~buffer;
}
}

View file

@ -243,6 +243,12 @@ void Ctrl::InitWin32(HINSTANCE hInstance)
{
GuiLock __;
LLOG("InitWin32");
BOOL (STDAPICALLTYPE * SetProcessDPIAware)(void);
DllFn(SetProcessDPIAware, "User32.dll", "SetProcessDPIAware");
if(SetProcessDPIAware)
(*SetProcessDPIAware)();
InstallPanicMessageBox(&Win32PanicMessageBox);
// RLOGBLOCK("Ctrl::InitWin32");
sMainThreadId = GetCurrentThreadId();

View file

@ -15,6 +15,10 @@ void GetStdFontSys(String& name, int& height)
name = "Arial";
height = 10;
#else
BOOL (STDAPICALLTYPE * SetProcessDPIAware)(void);
DllFn(SetProcessDPIAware, "User32.dll", "SetProcessDPIAware");
if(SetProcessDPIAware)
(*SetProcessDPIAware)();
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(ncm);
::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);