@@ -35,6 +35,7 @@ | ||
35 | 35 | <ul class="history"> |
36 | 36 | <li>Changes |
37 | 37 | <ul> |
38 | + <!--li>文字の一部が見えなくなるので、Windows 11 でウィンドウの角が丸くならないようにした。</li--> | |
38 | 39 | <li>XMODEM: Fix to check all received datas and process correctly, even if received datas are accumulated.</li> |
39 | 40 | <li>YMODEM: ignore continuous 'C' when waiting for sending.</li> |
40 | 41 | <li>Changed default to on for High DPI support.</li> |
@@ -35,6 +35,7 @@ | ||
35 | 35 | <ul class="history"> |
36 | 36 | <li>変更 |
37 | 37 | <ul> |
38 | + <li>文字の一部が見えなくなるので、Windows 11 でウィンドウの角が丸くならないようにした。</li> | |
38 | 39 | <li>XMODEM 受信データが蓄積しても全体を調べて正しく処理するように修正した。</li> |
39 | 40 | <li>YMODEM 送信待ちの時、連続した 'C' を無視するようにした。</li> |
40 | 41 | <li>高DPI対応のデフォルトをONに変更</li> |
@@ -100,6 +100,8 @@ | ||
100 | 100 | // comctl32.dll |
101 | 101 | static HRESULT (WINAPI *pLoadIconWithScaleDown)(HINSTANCE hinst, PCWSTR pszName, int cx, int cy, HICON *phico); |
102 | 102 | |
103 | +// dwmapi.dll | |
104 | +HRESULT (WINAPI *pDwmSetWindowAttribute)(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute); | |
103 | 105 | |
104 | 106 | class Initializer { |
105 | 107 | public: |
@@ -240,6 +242,11 @@ | ||
240 | 242 | {}, |
241 | 243 | }; |
242 | 244 | |
245 | +static const APIInfo Lists_dwmapi[] = { // Windows Vista or later | |
246 | + { "DwmSetWindowAttribute", (void **)&pDwmSetWindowAttribute }, | |
247 | + {}, | |
248 | +}; | |
249 | + | |
243 | 250 | static const DllInfo DllInfos[] = { |
244 | 251 | { L"user32.dll", DLL_LOAD_LIBRARY_SYSTEM, DLL_ACCEPT_NOT_EXIST, Lists_user32 }, |
245 | 252 | { L"msimg32.dll", DLL_LOAD_LIBRARY_SYSTEM, DLL_ACCEPT_NOT_EXIST, Lists_msimg32 }, |
@@ -252,6 +259,7 @@ | ||
252 | 259 | { L"dbghelp.dll", DLL_LOAD_LIBRARY_SYSTEM, DLL_ACCEPT_NOT_EXIST, Lists_dbghelp }, |
253 | 260 | { L"shell32.dll", DLL_LOAD_LIBRARY_SYSTEM, DLL_ACCEPT_NOT_EXIST, Lists_shell32 }, |
254 | 261 | { L"comctl32.dll", DLL_LOAD_LIBRARY_SxS, DLL_ACCEPT_NOT_EXIST, Lists_comctl32 }, |
262 | + { L"dwmapi.dll", DLL_LOAD_LIBRARY_SYSTEM, DLL_ACCEPT_NOT_EXIST, Lists_dwmapi }, | |
255 | 263 | {}, |
256 | 264 | }; |
257 | 265 |
@@ -69,6 +69,17 @@ | ||
69 | 69 | #define OPENFILENAME_SIZE_VERSION_400A 76 |
70 | 70 | #endif |
71 | 71 | |
72 | +// 10.0.22000 or later | |
73 | +#define DWMWA_WINDOW_CORNER_PREFERENCE 33 | |
74 | +#if !defined(DWM_WINDOW_CORNER_PREFERENCE) | |
75 | +typedef enum { | |
76 | + DWMWCP_DEFAULT = 0, | |
77 | + DWMWCP_DONOTROUND = 1, | |
78 | + DWMWCP_ROUND = 2, | |
79 | + DWMWCP_ROUNDSMALL = 3 | |
80 | +} DWM_WINDOW_CORNER_PREFERENCE; | |
81 | +#endif | |
82 | + | |
72 | 83 | #if !defined(_WIN64) |
73 | 84 | #include <pshpack1.h> |
74 | 85 | #endif |
@@ -197,6 +208,8 @@ | ||
197 | 208 | // comctl32.dll |
198 | 209 | HRESULT _LoadIconWithScaleDown(HINSTANCE hinst, PCWSTR pszName, int cx, int cy, HICON *phico); |
199 | 210 | |
211 | +// dwmapi.dll | |
212 | +extern HRESULT (WINAPI *pDwmSetWindowAttribute)(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute); | |
200 | 213 | |
201 | 214 | void WinCompatInit(); |
202 | 215 |
@@ -97,11 +97,19 @@ | ||
97 | 97 | rect.bottom = rect.top + 400; //temporary height |
98 | 98 | } |
99 | 99 | CreateW(hInstance, TEKClassName, L"Tera Term", Style, rect, ::GetDesktopWindow(), NULL); |
100 | + | |
100 | 101 | //-------------------------------------------------------- |
101 | 102 | HTEKWin = GetSafeHwnd(); |
102 | 103 | if (HTEKWin == NULL) { |
103 | 104 | return; |
104 | 105 | } |
106 | + | |
107 | + // Windows 11 でウィンドウの角が丸くならないようにする | |
108 | + if (pDwmSetWindowAttribute != NULL) { | |
109 | + DWM_WINDOW_CORNER_PREFERENCE preference = DWMWCP_DONOTROUND; | |
110 | + pDwmSetWindowAttribute(HTEKWin, DWMWA_WINDOW_CORNER_PREFERENCE, &preference, sizeof(preference)); | |
111 | + } | |
112 | + | |
105 | 113 | tk.HWin = HTEKWin; |
106 | 114 | // register this window to the window list |
107 | 115 | RegWin(HVTWin,HTEKWin); |
@@ -401,6 +401,13 @@ | ||
401 | 401 | HVTWin = GetSafeHwnd(); |
402 | 402 | if (HVTWin == NULL) return; |
403 | 403 | cv.HWin = HVTWin; |
404 | + | |
405 | + // Windows 11 でウィンドウの角が丸くならないようにする | |
406 | + if (pDwmSetWindowAttribute != NULL) { | |
407 | + DWM_WINDOW_CORNER_PREFERENCE preference = DWMWCP_DONOTROUND; | |
408 | + pDwmSetWindowAttribute(HVTWin, DWMWA_WINDOW_CORNER_PREFERENCE, &preference, sizeof(preference)); | |
409 | + } | |
410 | + | |
404 | 411 | // register this window to the window list |
405 | 412 | SerialNo = RegWin(HVTWin,NULL); |
406 | 413 |