private int DialogProc( IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam, IntPtr lpRefData) { // Fetch the HWND - it may be the first we're getting it. hWndDialog = hwnd; // Big switch on the various notifications the // dialog proc can get. switch ((SafeNativeMethods.TASKDIALOG_NOTIFICATIONS)msg) { case SafeNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_CREATED: int result = PerformDialogInitialization(); outerDialog.RaiseOpenedEvent(); return(result); case SafeNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_BUTTON_CLICKED: return(HandleButtonClick((int)wParam)); case SafeNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_RADIO_BUTTON_CLICKED: return(HandleRadioButtonClick((int)wParam)); case SafeNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_HYPERLINK_CLICKED: return(HandleHyperlinkClick(lParam)); case SafeNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_HELP: return(HandleHelpInvocation()); case SafeNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_TIMER: return(HandleTick((int)wParam)); case SafeNativeMethods.TASKDIALOG_NOTIFICATIONS.TDN_DESTROYED: return(PerformDialogCleanup()); default: break; } return((int)HRESULT.S_OK); }