Robert Reif : winecfg: Use hourglass cursor when opening audio
drivers.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Dec 26 11:46:00 CST 2005
Module: wine
Branch: refs/heads/master
Commit: 35a92c86d537e4824b8f2da8d50c76f5d205b1d1
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=35a92c86d537e4824b8f2da8d50c76f5d205b1d1
Author: Robert Reif <reif at earthlink.net>
Date: Mon Dec 26 12:55:40 2005 +0100
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.
---
programs/winecfg/audio.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c
index 1d0a424..3d78e92 100644
--- a/programs/winecfg/audio.c
+++ b/programs/winecfg/audio.c
@@ -181,6 +181,7 @@ static void initAudioDeviceTree(HWND hDl
HWND tree = NULL;
HIMAGELIST hImageList;
HBITMAP hBitMap;
+ HCURSOR old_cursor;
tree = GetDlgItem(hDlg, IDC_AUDIO_TREE);
@@ -205,6 +206,11 @@ static void initAudioDeviceTree(HWND hDl
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 hDl
}
}
+ /* 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));
More information about the wine-cvs
mailing list