mirror of
https://github.com/reactos/reactos.git
synced 2024-11-04 22:00:55 +00:00
[MSGINA] gui: Improve DlgData_LoadBitmaps() (#2520)
And let bar timer depend on the bar image only.
Addendum to 623dd26cce
.
This commit is contained in:
parent
6baa151888
commit
64fea1dbd0
1 changed files with 24 additions and 15 deletions
|
@ -56,28 +56,34 @@ DlgData_Create(HWND hwndDlg, PGINA_CONTEXT pgContext)
|
|||
return pDlgData;
|
||||
}
|
||||
|
||||
static BOOL
|
||||
DlgData_LoadBitmaps(PDLG_DATA pDlgData)
|
||||
static VOID
|
||||
DlgData_LoadBitmaps(_Inout_ PDLG_DATA pDlgData)
|
||||
{
|
||||
BITMAP bm;
|
||||
|
||||
if (!pDlgData)
|
||||
return FALSE;
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pDlgData->hLogoBitmap = LoadImageW(pDlgData->pgContext->hDllInstance,
|
||||
MAKEINTRESOURCEW(IDI_ROSLOGO), IMAGE_BITMAP,
|
||||
0, 0, LR_DEFAULTCOLOR);
|
||||
GetObject(pDlgData->hLogoBitmap, sizeof(bm), &bm);
|
||||
pDlgData->LogoWidth = bm.bmWidth;
|
||||
pDlgData->LogoHeight = bm.bmHeight;
|
||||
if (pDlgData->hLogoBitmap)
|
||||
{
|
||||
GetObject(pDlgData->hLogoBitmap, sizeof(bm), &bm);
|
||||
pDlgData->LogoWidth = bm.bmWidth;
|
||||
pDlgData->LogoHeight = bm.bmHeight;
|
||||
}
|
||||
|
||||
pDlgData->hBarBitmap = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_BAR),
|
||||
IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
|
||||
GetObject(pDlgData->hBarBitmap, sizeof(bm), &bm);
|
||||
pDlgData->BarWidth = bm.bmWidth;
|
||||
pDlgData->BarHeight = bm.bmHeight;
|
||||
|
||||
return (pDlgData->hLogoBitmap != NULL && pDlgData->hBarBitmap != NULL);
|
||||
if (pDlgData->hBarBitmap)
|
||||
{
|
||||
GetObject(pDlgData->hBarBitmap, sizeof(bm), &bm);
|
||||
pDlgData->BarWidth = bm.bmWidth;
|
||||
pDlgData->BarHeight = bm.bmHeight;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -192,15 +198,18 @@ StatusDialogProc(
|
|||
if (pDlgData == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (DlgData_LoadBitmaps(pDlgData))
|
||||
DlgData_LoadBitmaps(pDlgData);
|
||||
if (pDlgData->hBarBitmap)
|
||||
{
|
||||
if (SetTimer(hwndDlg, IDT_BAR, 20, NULL) == 0)
|
||||
{
|
||||
ERR("SetTimer(IDT_BAR) failed: %d\n", GetLastError());
|
||||
}
|
||||
|
||||
/* Get the animation bar control */
|
||||
pDlgData->hWndBarCtrl = GetDlgItem(hwndDlg, IDC_BAR);
|
||||
else
|
||||
{
|
||||
/* Get the animation bar control */
|
||||
pDlgData->hWndBarCtrl = GetDlgItem(hwndDlg, IDC_BAR);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue