Added warnings to titlebar

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@779 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
rainwater 2002-08-28 17:44:47 +00:00
parent 79df7a5bf4
commit 69182b36aa
2 changed files with 9 additions and 1 deletions

View file

@ -36,6 +36,7 @@ static int dy;
HINSTANCE g_hInstance;
HWND g_hwnd;
HANDLE g_hThread;
BOOL g_warnings;
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmdShow) {
HACCEL haccel;
@ -45,6 +46,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmd
else while (*g_script++!=' ');
while (*g_script==' ') g_script++;
g_retcode = -1; // return code is always false unless set to true by GetExitCodeProcess
g_warnings = FALSE;
HWND hDialog = CreateDialog(g_hInstance,MAKEINTRESOURCE(DLG_MAIN),0,DialogProc);
if (!hDialog) {
char buf [MAX_STRING];
@ -135,7 +137,8 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
}
if (g_retcode==0) {
MessageBeep(MB_ICONASTERISK);
SetTitle(g_hwnd,"Finished Sucessfully");
if (g_warnings) SetTitle(g_hwnd,"Finished with Warnings");
else SetTitle(g_hwnd,"Finished Sucessfully");
}
else SetTitle(g_hwnd,"Compile Error: See Log for Details");
EnableItems(g_hwnd);

View file

@ -56,6 +56,8 @@ void ClearLog(HWND hwnd) {
char g_output_exe[1024];
char g_input_script[1024];
BOOL g_input_found;
extern BOOL g_warnings;
void LogMessage(HWND hwnd,const char *str) {
if (!str || !*str) return;
int len=SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
@ -77,6 +79,9 @@ void LogMessage(HWND hwnd,const char *str) {
g_input_found=TRUE;
}
}
if (my_strstr(existing_text," warning:")||my_strstr(existing_text," warnings:")) {
g_warnings = TRUE;
}
SetDlgItemText(hwnd, IDC_LOGWIN, existing_text);
SendDlgItemMessage(hwnd, IDC_LOGWIN,EM_SETSEL,lstrlen(existing_text),lstrlen(existing_text));
SendDlgItemMessage(hwnd, IDC_LOGWIN,EM_SCROLLCARET,0,0);