mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[x86-64] Prefer to use GetWindowLongPtr for x86/x86-x64
It is peferrable to use GetWindowLongPtr instead of GetWindowLong for both x86 and x86-64 support, since return value may be pointer in some cases and, when platform is x86-64 and accepting value is LONG, higher bits of result may be lost. See https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlonga
This commit is contained in:
parent
e0bc2e5ffd
commit
f667dd6616
1 changed files with 4 additions and 4 deletions
8
src/ui.c
8
src/ui.c
|
@ -149,7 +149,7 @@ void GetMainButtonsWidth(HWND hDlg)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
RECT rc;
|
RECT rc;
|
||||||
LONG style;
|
LONG_PTR style;
|
||||||
char download[64];
|
char download[64];
|
||||||
|
|
||||||
GetWindowRect(GetDlgItem(hDlg, main_button_ids[0]), &rc);
|
GetWindowRect(GetDlgItem(hDlg, main_button_ids[0]), &rc);
|
||||||
|
@ -167,9 +167,9 @@ void GetMainButtonsWidth(HWND hDlg)
|
||||||
static_strcpy(download, lmprintf(MSG_040));
|
static_strcpy(download, lmprintf(MSG_040));
|
||||||
CharUpperBuffU(download, sizeof(download));
|
CharUpperBuffU(download, sizeof(download));
|
||||||
bw = max(bw, GetTextSize(GetDlgItem(hDlg, IDC_SELECT), download).cx + (3 * cbw) / 2);
|
bw = max(bw, GetTextSize(GetDlgItem(hDlg, IDC_SELECT), download).cx + (3 * cbw) / 2);
|
||||||
style = GetWindowLong(GetDlgItem(hDlg, IDC_SELECT), GWL_STYLE);
|
style = GetWindowLongPtr(GetDlgItem(hDlg, IDC_SELECT), GWL_STYLE);
|
||||||
style|= BS_SPLITBUTTON;
|
style |= BS_SPLITBUTTON;
|
||||||
SetWindowLong(GetDlgItem(hDlg, IDC_SELECT), GWL_STYLE, style);
|
SetWindowLongPtr(GetDlgItem(hDlg, IDC_SELECT), GWL_STYLE, style);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue