diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c index 1d0a424c190..3d78e92d1a1 100644 --- a/programs/winecfg/audio.c +++ b/programs/winecfg/audio.c @@ -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));