1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

No border on Windows Pageant/PuTTYgen About boxes.

(Bringing them in line with the PuTTY one in cc6ab00b71.)
This commit is contained in:
Jacob Nevins 2021-04-06 21:14:51 +01:00
parent 48e89caf13
commit 71e9e59c68
5 changed files with 20 additions and 13 deletions

View File

@ -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)
{

View File

@ -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;

View File

@ -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;
}

View File

@ -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 ***);

View File

@ -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