diff --git a/windows/windlg.c b/windows/windlg.c index f10f091a..adb0639f 100644 --- a/windows/windlg.c +++ b/windows/windlg.c @@ -205,19 +205,6 @@ static INT_PTR CALLBACK LicenceProc(HWND hwnd, UINT msg, return 0; } -static void MakeDlgItemBorderless(HWND parent, int id) -{ - HWND child = GetDlgItem(parent, id); - LONG_PTR style = GetWindowLongPtr(child, GWL_STYLE); - LONG_PTR exstyle = GetWindowLongPtr(child, GWL_EXSTYLE); - style &= ~WS_BORDER; - exstyle &= ~(WS_EX_CLIENTEDGE | WS_EX_STATICEDGE | WS_EX_WINDOWEDGE); - SetWindowLongPtr(child, GWL_STYLE, style); - SetWindowLongPtr(child, GWL_EXSTYLE, exstyle); - SetWindowPos(child, NULL, 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); -} - static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { diff --git a/windows/winpgen.c b/windows/winpgen.c index 81dc64a3..7c44a279 100644 --- a/windows/winpgen.c +++ b/windows/winpgen.c @@ -512,6 +512,7 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg, "\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved."); sfree(buildinfo_text); SetDlgItemText(hwnd, 1000, text); + MakeDlgItemBorderless(hwnd, 1000); sfree(text); } return 1; diff --git a/windows/winpgnt.c b/windows/winpgnt.c index 9477085d..951a3474 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -144,6 +144,7 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg, "\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved."); sfree(buildinfo_text); SetDlgItemText(hwnd, IDC_ABOUT_TEXTBOX, text); + MakeDlgItemBorderless(hwnd, IDC_ABOUT_TEXTBOX); sfree(text); return 1; } diff --git a/windows/winstuff.h b/windows/winstuff.h index 31012c6a..21c96764 100644 --- a/windows/winstuff.h +++ b/windows/winstuff.h @@ -373,6 +373,7 @@ void filereq_free(filereq *state); void pgp_fingerprints_msgbox(HWND owner); int message_box(HWND owner, LPCTSTR text, LPCTSTR caption, DWORD style, DWORD helpctxid); +void MakeDlgItemBorderless(HWND parent, int id); char *GetDlgItemText_alloc(HWND hwnd, int id); void split_into_argv(char *, int *, char ***, char ***); diff --git a/windows/winutils.c b/windows/winutils.c index df0c41be..973c3be0 100644 --- a/windows/winutils.c +++ b/windows/winutils.c @@ -157,6 +157,23 @@ void pgp_fingerprints_msgbox(HWND owner) HELPCTXID(pgp_fingerprints)); } +/* + * Helper function to remove the border around a dialog item such as + * a read-only edit control. + */ +void MakeDlgItemBorderless(HWND parent, int id) +{ + HWND child = GetDlgItem(parent, id); + LONG_PTR style = GetWindowLongPtr(child, GWL_STYLE); + LONG_PTR exstyle = GetWindowLongPtr(child, GWL_EXSTYLE); + style &= ~WS_BORDER; + exstyle &= ~(WS_EX_CLIENTEDGE | WS_EX_STATICEDGE | WS_EX_WINDOWEDGE); + SetWindowLongPtr(child, GWL_STYLE, style); + SetWindowLongPtr(child, GWL_EXSTYLE, exstyle); + SetWindowPos(child, NULL, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); +} + /* * Handy wrapper around GetDlgItemText which doesn't make you invent * an arbitrary length limit on the output string. Returned string is