2 * Copyright (C) 1998 Transarc Corporation.
9 * INCLUDES ___________________________________________________________________
13 #include <afs/param.h>
18 #include <WINNT/talocale.h>
20 #include "progress_dlg.h"
21 #include "animate_icon.h"
25 * DEFINITIONS _________________________________________________________________
31 * Variables _________________________________________________________________
34 static HWND hDlg = 0; // HWND for this page's dialog
35 static char *pszProgressMsg = 0;
40 * PROTOTYPES _________________________________________________________________
43 BOOL CALLBACK ProgressDlgProc(HWND hRHS, UINT msg, WPARAM wp, LPARAM lp);
44 static DWORD WINAPI DisplayProgressDlg(LPVOID param);
45 static void OnInitDialog(HWND hwndDlg);
50 * EXPORTED FUNCTIONS _________________________________________________________
53 BOOL ShowProgressDialog(char *pszMsg)
57 pszProgressMsg = pszMsg;
59 // Create a thread to show the dialog
60 HANDLE hThread = CreateThread(0, 0, DisplayProgressDlg, 0, 0, &dwThreadID);
64 return (hThread != 0);
67 void HideProgressDialog(void)
69 PostMessage(hDlg, WM_QUIT, 0, 0);
74 * Dialog Proc _________________________________________________________________
77 static BOOL CALLBACK ProgressDlgProc(HWND hwndDlg, UINT msg, WPARAM wp, LPARAM lp)
81 OnInitDialog(hwndDlg);
83 SetWindowText(GetDlgItem(hDlg, IDC_MSG), pszProgressMsg);
96 * Event Handler Functions __________________________________________________________
99 static void OnInitDialog(HWND hwndDlg)
103 SetWindowText(GetDlgItem(hDlg, IDC_MSG), pszProgressMsg);
105 hLogo = GetDlgItem(hDlg, IDC_LOGO);
107 StartAnimation(hLogo, 8);
112 StopAnimation(hLogo);
114 EndDialog(hDlg, IDOK);
119 * OTHER FUNCTIONS _________________________________________________________________
122 static DWORD WINAPI DisplayProgressDlg(LPVOID param)
124 ModalDialog (IDD_PROGRESS, 0, (DLGPROC)ProgressDlgProc);