LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int atox( const TCHAR *str, TCHAR **next );
+void SetDpiAware();
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
MSG msg;
HACCEL hAccelTable;
+ SetDpiAware();
+
// \83O\83\8d\81[\83o\83\8b\95¶\8e\9a\97ñ\82ð\8f\89\8aú\89»\82µ\82Ä\82¢\82Ü\82·\81B
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_DCHK64, szWindowClass, MAX_LOADSTRING);
return NULL;
return pi.hProcess;
}
+
+typedef WINUSERAPI BOOL (WINAPI *FNSetProcessDpiAwarenessContext)(UINT_PTR vaule);
+#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((UINT_PTR)-4)
+void SetDpiAware()
+{
+ HINSTANCE hDll = LoadLibrary( _T("user32") );
+ if (!hDll)
+ return;
+ FNSetProcessDpiAwarenessContext fnSetProcessDpiAwarenessContext = (FNSetProcessDpiAwarenessContext)GetProcAddress(hDll, "SetProcessDpiAwarenessContext");
+ if (fnSetProcessDpiAwarenessContext){
+ if (fnSetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2)){
+ } else {
+ DBW("x64-SetDpiAware failed: %d", GetLastError());
+ }
+ }
+ FreeLibrary(hDll);
+}
+