winecfg: Use hourglass cursor when opening audio drivers.

Misbehaving drivers can take a while to open so change to the hour
glass cursor when opening them.
This commit is contained in:
Robert Reif 2005-12-26 12:55:40 +01:00 committed by Alexandre Julliard
parent 9da8128e4f
commit 35a92c86d5
1 changed files with 18 additions and 0 deletions

View File

@ -181,6 +181,7 @@ static void initAudioDeviceTree(HWND hDlg)
HWND tree = NULL;
HIMAGELIST hImageList;
HBITMAP hBitMap;
HCURSOR old_cursor;
tree = GetDlgItem(hDlg, IDC_AUDIO_TREE);
@ -205,6 +206,11 @@ static void initAudioDeviceTree(HWND hDlg)
insert.u.item.cChildren = 1;
root = (HTREEITEM)SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
/* change to the wait cursor because this can take a while if there is a
* misbehaving driver that takes a long time to open
*/
old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
/* iterate over list of loaded drivers */
for (pAudioDrv = loadedAudioDrv, i = 0; *pAudioDrv->szName; i++, pAudioDrv++) {
HDRVR hdrv;
@ -433,6 +439,9 @@ static void initAudioDeviceTree(HWND hDlg)
}
}
/* restore the original cursor */
SetCursor(old_cursor);
SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_SELECTITEM, 0, 0);
SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_EXPAND, TVE_EXPAND, (LPARAM)root);
for (j = 0; j < i; j++)
@ -444,6 +453,7 @@ static void findAudioDrivers(void)
{
int numFound = 0;
const AUDIO_DRIVER *pAudioDrv = NULL;
HCURSOR old_cursor;
/* delete an existing list */
if (loadedAudioDrv)
@ -452,6 +462,11 @@ static void findAudioDrivers(void)
loadedAudioDrv = 0;
}
/* change to the wait cursor because this can take a while if there is a
* misbehaving driver that takes a long time to open
*/
old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
for (pAudioDrv = getAudioDrivers(); *pAudioDrv->szName; pAudioDrv++)
{
if (strlen(pAudioDrv->szDriver))
@ -476,6 +491,9 @@ static void findAudioDrivers(void)
}
}
/* restore the original cursor */
SetCursor(old_cursor);
/* terminate list with empty driver */
loadedAudioDrv = HeapReAlloc(GetProcessHeap(), 0, loadedAudioDrv, (numFound + 1) * sizeof(AUDIO_DRIVER));
CopyMemory(&loadedAudioDrv[numFound], pAudioDrv, sizeof(AUDIO_DRIVER));