static BOOL UpdateVolumeBarx(HWND hWnd, UINT nVolume, UINT nCount)
{ if (first)
{
first = false;
return TRUE;
} const UINT nMaxWidth = GetSystemMetrics(SM_CXSCREEN);
while (1)
{
g_nBarWidth  = (ITEM_WIDTH + ITEM_GAP) * nCount + SPK_WIDTH;
g_nBarWidth += 8 - (g_nBarWidth % 8);
if (g_nBarWidth <= nMaxWidth)
break; nCount  /= 2;
nVolume /= 2;
} BOOL bRetVal = TRUE;
BOOL bDDraw = CreateDDrawx(hWnd);
#ifdef SHARP_LQ035Q1DG01
int x = 0;//(GetSystemMetrics(SM_CXSCREEN) - g_nBarWidth) / 2 - 100;//执行此处
int y = 9;//GetSystemMetrics(SM_CYSCREEN) - 26;;//执行此处#else
int x = (GetSystemMetrics(SM_CXSCREEN) - g_nBarWidth) / 2 - 70;
int y = GetSystemMetrics(SM_CYSCREEN) - 30;
#endif
HDC hdcSurf = NULL;
if (bDDraw)
{
ASSERT(g_pDDSOverlay);
g_pDDSOverlay->SetOverlayPosition(x, y);
if (FAILED(g_pDDSOverlay->GetDC(&hdcSurf)))
return FALSE;
}
else
{
MoveWindow(hWnd, x, y, g_nBarWidth, BAR_HEIGHT, TRUE);
hdcSurf = GetDC(hWnd);
ShowWindow(hWnd, SW_SHOW);
}

bRetVal = DrawVolBarx(hdcSurf, nVolume, nCount); if (bDDraw)
g_pDDSOverlay->ReleaseDC(hdcSurf);
else 
ReleaseDC(hWnd, hdcSurf);
return TRUE;
}