2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * INCLUDES ___________________________________________________________________
15 #include <afs/param.h>
20 #include <WINNT/talocale.h>
22 #include "progress_dlg.h"
23 #include "animate_icon.h"
27 * DEFINITIONS _________________________________________________________________
33 * Variables _________________________________________________________________
36 static HWND hDlg = 0; // HWND for this page's dialog
37 static char *pszProgressMsg = 0;
42 * PROTOTYPES _________________________________________________________________
45 BOOL CALLBACK ProgressDlgProc(HWND hRHS, UINT msg, WPARAM wp, LPARAM lp);
46 static DWORD WINAPI DisplayProgressDlg(LPVOID param);
47 static void OnInitDialog(HWND hwndDlg);
52 * EXPORTED FUNCTIONS _________________________________________________________
55 BOOL ShowProgressDialog(char *pszMsg)
59 pszProgressMsg = pszMsg;
61 // Create a thread to show the dialog
62 HANDLE hThread = CreateThread(0, 0, DisplayProgressDlg, 0, 0, &dwThreadID);
66 return (hThread != 0);
69 void HideProgressDialog(void)
71 PostMessage(hDlg, WM_QUIT, 0, 0);
76 * Dialog Proc _________________________________________________________________
79 static BOOL CALLBACK ProgressDlgProc(HWND hwndDlg, UINT msg, WPARAM wp, LPARAM lp)
83 OnInitDialog(hwndDlg);
85 SetWindowText(GetDlgItem(hDlg, IDC_MSG), pszProgressMsg);
98 * Event Handler Functions __________________________________________________________
101 static void OnInitDialog(HWND hwndDlg)
105 SetWindowText(GetDlgItem(hDlg, IDC_MSG), pszProgressMsg);
107 hLogo = GetDlgItem(hDlg, IDC_LOGO);
109 StartAnimation(hLogo, 8);
114 StopAnimation(hLogo);
116 EndDialog(hDlg, IDOK);
121 * OTHER FUNCTIONS _________________________________________________________________
124 static DWORD WINAPI DisplayProgressDlg(LPVOID param)
126 ModalDialog (IDD_PROGRESS, 0, (DLGPROC)ProgressDlgProc);