That shouldn't have gotten in there...

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3077 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-10-30 23:12:25 +00:00
parent 570f1b0e75
commit f9c8fd6682

View file

@ -353,7 +353,8 @@ static int CALLBACK WINAPI BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lPara
} }
return 0; return 0;
} }
BOOL bMainShown = FALSE;
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
if (uMsg == WM_INITDIALOG || uMsg == WM_NOTIFY_OUTER_NEXT) if (uMsg == WM_INITDIALOG || uMsg == WM_NOTIFY_OUTER_NEXT)
@ -380,11 +381,11 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
m_hwndOK=GetDlgItem(hwndDlg,IDOK); m_hwndOK=GetDlgItem(hwndDlg,IDOK);
m_hwndCancel=GetDlgItem(hwndDlg,IDCANCEL); m_hwndCancel=GetDlgItem(hwndDlg,IDCANCEL);
SetDlgItemTextFromLang(hwndDlg,IDC_VERSTR,LANG_BRANDING); SetDlgItemTextFromLang(hwndDlg,IDC_VERSTR,LANG_BRANDING);
SetClassLong(hwndDlg,GCL_HICON,(long)g_hIcon); SetClassLong(hwndDlg,GCL_HICON,(long)g_hIcon);
#if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_ENHANCEDUI_SUPPORT) #if defined(NSIS_SUPPORT_CODECALLBACKS) && defined(NSIS_CONFIG_ENHANCEDUI_SUPPORT)
g_quit_flag = ExecuteCodeSegment(g_header->code_onGUIInit,NULL); if (!(g_quit_flag = ExecuteCodeSegment(g_header->code_onGUIInit,NULL)))
#endif #endif
//ShowWindow(hwndDlg,SW_SHOW); ShowWindow(hwndDlg,SW_SHOW);
} }
this_page=g_pages+m_page; this_page=g_pages+m_page;
@ -421,7 +422,7 @@ nextPage:
} }
else else
{ {
HWND hwndtmp, newPage; HWND hwndtmp;
int pflags = this_page->flags; int pflags = this_page->flags;
@ -455,10 +456,7 @@ nextPage:
} }
#endif //NSIS_SUPPORT_CODECALLBACKS #endif //NSIS_SUPPORT_CODECALLBACKS
if (this_page->wndproc_id != PWP_COMPLETED) { if (this_page->wndproc_id != PWP_COMPLETED) DestroyWindow(m_curwnd);
// Done inside WM_NOTIFY_CUSTOM_READY
//DestroyWindow(m_curwnd);
}
else { else {
if (g_exec_flags.abort) SetFocus(m_hwndCancel); if (g_exec_flags.abort) SetFocus(m_hwndCancel);
else if (g_exec_flags.autoclose) goto nextPage; else if (g_exec_flags.autoclose) goto nextPage;
@ -471,25 +469,25 @@ nextPage:
if (this_page->dlg_id > 0) // NSIS page if (this_page->dlg_id > 0) // NSIS page
{ {
newPage=CreateDialogParam( m_curwnd=CreateDialogParam(
g_hInstance, g_hInstance,
MAKEINTRESOURCE(this_page->dlg_id+dlg_offset), MAKEINTRESOURCE(this_page->dlg_id+dlg_offset),
hwndDlg,winprocs[this_page->wndproc_id],(LPARAM)this_page hwndDlg,winprocs[this_page->wndproc_id],(LPARAM)this_page
); );
if (newPage) if (m_curwnd)
{ {
RECT r; RECT r;
SetDlgItemTextFromLang(newPage,IDC_INTROTEXT,this_page->parms[0]); SetDlgItemTextFromLang(m_curwnd,IDC_INTROTEXT,this_page->parms[0]);
GetWindowRect(GetDlgItem(hwndDlg,IDC_CHILDRECT),&r); GetWindowRect(GetDlgItem(hwndDlg,IDC_CHILDRECT),&r);
ScreenToClient(hwndDlg,(LPPOINT)&r); ScreenToClient(hwndDlg,(LPPOINT)&r);
SetWindowPos(newPage,0,r.left,r.top,0,0,SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOREDRAW); SetWindowPos(m_curwnd,0,r.left,r.top,0,0,SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
SendMessage(hwndDlg, WM_NOTIFY_CUSTOM_READY, (WPARAM)newPage, 0);
#ifdef NSIS_SUPPORT_CODECALLBACKS #ifdef NSIS_SUPPORT_CODECALLBACKS
ExecuteCodeSegment(this_page->showfunc,NULL); ExecuteCodeSegment(this_page->showfunc,NULL);
#endif //NSIS_SUPPORT_CODECALLBACKS #endif //NSIS_SUPPORT_CODECALLBACKS
SendMessage(newPage,WM_NOTIFY_START,0,0); ShowWindow(m_curwnd,SW_SHOWNA);
SendMessage(m_curwnd,WM_NOTIFY_START,0,0);
} }
//XGE 5th September 2002 - Do *not* move the focus to the OK button if we are //XGE 5th September 2002 - Do *not* move the focus to the OK button if we are
@ -513,23 +511,10 @@ nextPage:
} }
#endif //NSIS_SUPPORT_BGBG #endif //NSIS_SUPPORT_BGBG
if (uMsg == WM_NOTIFY_CUSTOM_READY ) { if (uMsg == WM_NOTIFY_CUSTOM_READY) {
SetWindowPos(m_curwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_HIDEWINDOW | SWP_NOREDRAW );
DestroyWindow(m_curwnd); DestroyWindow(m_curwnd);
m_curwnd = (HWND)wParam; m_curwnd = (HWND)wParam;
SetWindowPos(m_curwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW );
if ( !bMainShown )
{
bMainShown = TRUE;
SetWindowPos(hwndDlg, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_SHOWWINDOW | SWP_FRAMECHANGED);
}
InvalidateRect(hwndDlg, NULL, TRUE);
} }
if (uMsg == WM_CLOSE) if (uMsg == WM_CLOSE)
{ {
if (!IsWindowEnabled(m_hwndCancel) && IsWindowEnabled(m_hwndOK)) if (!IsWindowEnabled(m_hwndCancel) && IsWindowEnabled(m_hwndOK))
@ -574,7 +559,6 @@ nextPage:
else else
{ {
// Forward WM_COMMANDs to inner dialogs, can be custom ones // Forward WM_COMMANDs to inner dialogs, can be custom ones
// It allow inner dialogs to react on keyboard, ex: button can be clicked using the ENTER key
SendMessage(m_curwnd, uMsg, wParam, lParam); SendMessage(m_curwnd, uMsg, wParam, lParam);
} }
} }