mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 02:25:40 +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;
|
return pDlgData;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL
|
static VOID
|
||||||
DlgData_LoadBitmaps(PDLG_DATA pDlgData)
|
DlgData_LoadBitmaps(_Inout_ PDLG_DATA pDlgData)
|
||||||
{
|
{
|
||||||
BITMAP bm;
|
BITMAP bm;
|
||||||
|
|
||||||
if (!pDlgData)
|
if (!pDlgData)
|
||||||
return FALSE;
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pDlgData->hLogoBitmap = LoadImageW(pDlgData->pgContext->hDllInstance,
|
pDlgData->hLogoBitmap = LoadImageW(pDlgData->pgContext->hDllInstance,
|
||||||
MAKEINTRESOURCEW(IDI_ROSLOGO), IMAGE_BITMAP,
|
MAKEINTRESOURCEW(IDI_ROSLOGO), IMAGE_BITMAP,
|
||||||
0, 0, LR_DEFAULTCOLOR);
|
0, 0, LR_DEFAULTCOLOR);
|
||||||
GetObject(pDlgData->hLogoBitmap, sizeof(bm), &bm);
|
if (pDlgData->hLogoBitmap)
|
||||||
pDlgData->LogoWidth = bm.bmWidth;
|
{
|
||||||
pDlgData->LogoHeight = bm.bmHeight;
|
GetObject(pDlgData->hLogoBitmap, sizeof(bm), &bm);
|
||||||
|
pDlgData->LogoWidth = bm.bmWidth;
|
||||||
|
pDlgData->LogoHeight = bm.bmHeight;
|
||||||
|
}
|
||||||
|
|
||||||
pDlgData->hBarBitmap = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_BAR),
|
pDlgData->hBarBitmap = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_BAR),
|
||||||
IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
|
IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
|
||||||
GetObject(pDlgData->hBarBitmap, sizeof(bm), &bm);
|
if (pDlgData->hBarBitmap)
|
||||||
pDlgData->BarWidth = bm.bmWidth;
|
{
|
||||||
pDlgData->BarHeight = bm.bmHeight;
|
GetObject(pDlgData->hBarBitmap, sizeof(bm), &bm);
|
||||||
|
pDlgData->BarWidth = bm.bmWidth;
|
||||||
return (pDlgData->hLogoBitmap != NULL && pDlgData->hBarBitmap != NULL);
|
pDlgData->BarHeight = bm.bmHeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -192,15 +198,18 @@ StatusDialogProc(
|
||||||
if (pDlgData == NULL)
|
if (pDlgData == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (DlgData_LoadBitmaps(pDlgData))
|
DlgData_LoadBitmaps(pDlgData);
|
||||||
|
if (pDlgData->hBarBitmap)
|
||||||
{
|
{
|
||||||
if (SetTimer(hwndDlg, IDT_BAR, 20, NULL) == 0)
|
if (SetTimer(hwndDlg, IDT_BAR, 20, NULL) == 0)
|
||||||
{
|
{
|
||||||
ERR("SetTimer(IDT_BAR) failed: %d\n", GetLastError());
|
ERR("SetTimer(IDT_BAR) failed: %d\n", GetLastError());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
/* Get the animation bar control */
|
{
|
||||||
pDlgData->hWndBarCtrl = GetDlgItem(hwndDlg, IDC_BAR);
|
/* Get the animation bar control */
|
||||||
|
pDlgData->hWndBarCtrl = GetDlgItem(hwndDlg, IDC_BAR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue