Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Possible to use common controls (progress bar) in network provider DLL?

28 views
Skip to first unread message

gbro...@gmail.com

unread,
Jan 17, 2006, 10:45:56 PM1/17/06
to
I'm trying to display a progress bar after a Ctrl-Alt-Del passsword
change using non-MFC dialogs, but the UI locks up while displaying
child dialogs shortly there after on roughly half of the XP machines
I've tested on. The same child dialogs work fine when the progress
dialog isn't displayed. Anyone know of any gotchas using comctl32 from
a system process? Here's the code that displays the progress dialog:

=================================
/* Initializing the dialog */
INITCOMMONCONTROLSEX InitCtrlEx;
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
InitCtrlEx.dwICC = ICC_PROGRESS_CLASS;
InitCommonControlsEx(&InitCtrlEx);

HWND hProgressWnd = CreateDialogParam(hInstance,
MAKEINTRESOURCE(IDD_PROGRESS), GetTopWindow(0),
(DLGPROC)ProgressDlgProc, NULL);

ShowWindow(hProgressWnd, SW_SHOWNORMAL);
UpdateWindow(hProgressWnd);
=================================
/* Window proc */
BOOL CALLBACK ProgressDlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam,
LPARAM lParam) {
switch(Msg) {
case WM_INITDIALOG:
SendDlgItemMessage(hWndDlg, IDC_PROGRESS, PBM_SETSTEP, (WPARAM)
1, 0);
SendDlgItemMessage(hWndDlg, IDC_PROGRESS, PBM_SETRANGE, 0,
MAKELPARAM(0, 5));
return TRUE;

case WM_COMMAND:
switch(wParam) {
case IDOK:
EndDialog(hWndDlg, 0);
return TRUE;
}
break;
}
return FALSE;
}
=================================
/* How the dialog is updated */
SendDlgItemMessage(hProgressWnd, IDC_PROGRESS, PBM_STEPIT, 0, 0);
UpdateWindow(hProgressWnd);
=================================

-Gregg

gbro...@gmail.com

unread,
Jan 18, 2006, 4:13:18 PM1/18/06
to
Figured it out - the parent window was specified incorrectly and any
modal dialogs (ala MessageBox) were disabling the immediate and ALL
parent windows which included the main system window - whoops.
Specifying NULL as the parent for the modeless progress dialog fixed
everything.

Thank you very much to Raymond Chen who got me thinking about it with
his blog entry on GetDesktopWindow():
http://blogs.msdn.com/oldnewthing/archive/2004/02/24/79212.aspx

Yes Virginia, there is a Santa Claus - his name is Chen!

-Gregg

0 new messages