fix termination of "search program" dialog

svn path=/trunk/; revision=14451
This commit is contained in:
Martin Fuchs 2005-04-02 18:24:13 +00:00
parent 275c59c4d4
commit 38024cdd26
3 changed files with 18 additions and 14 deletions

View file

@ -1,5 +1,5 @@
/* /*
* Copyright 2003, 2004 Martin Fuchs * Copyright 2003, 2004, 2005 Martin Fuchs
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -42,10 +42,11 @@ int CollectProgramsThread::Run()
} catch(COMException&) { } catch(COMException&) {
} }
try { if (_alive)
collect_programs(SpecialFolderPath(CSIDL_PROGRAMS, _hwnd)); try {
} catch(COMException&) { collect_programs(SpecialFolderPath(CSIDL_PROGRAMS, _hwnd));
} } catch(COMException&) {
}
if (_alive) if (_alive)
_cache_valid = true; _cache_valid = true;
@ -60,16 +61,13 @@ void CollectProgramsThread::collect_programs(const ShellPath& path)
dir->smart_scan(SORT_NONE, /*SCAN_EXTRACT_ICONS|*/SCAN_FILESYSTEM); dir->smart_scan(SORT_NONE, /*SCAN_EXTRACT_ICONS|*/SCAN_FILESYSTEM);
for(Entry*entry=dir->_down; entry; entry=entry->_next) { for(Entry*entry=dir->_down; _alive && entry; entry=entry->_next) {
if (!_alive)
break;
if (entry->_shell_attribs & SFGAO_HIDDEN) if (entry->_shell_attribs & SFGAO_HIDDEN)
continue; continue;
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
collect_programs(entry->create_absolute_pidl()); collect_programs(entry->create_absolute_pidl());
} else if (entry->_shell_attribs & SFGAO_LINK) else if (entry->_shell_attribs & SFGAO_LINK)
if (_alive) if (_alive)
_callback(entry, _para); _callback(entry, _para);
} }
@ -139,6 +137,8 @@ FindProgramDlg::FindProgramDlg(HWND hwnd)
FindProgramDlg::~FindProgramDlg() FindProgramDlg::~FindProgramDlg()
{ {
_thread.Stop();
unregister_pretranslate(_hwnd); unregister_pretranslate(_hwnd);
} }
@ -262,6 +262,10 @@ void FindProgramDlg::add_entry(const FPDEntry& cache_entry)
LRESULT FindProgramDlg::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) LRESULT FindProgramDlg::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
{ {
switch(nmsg) { switch(nmsg) {
case WM_CLOSE:
ListView_SetImageList(_list_ctrl, 0, LVSIL_SMALL); // detach system image list
goto def;
case PM_TRANSLATE_MSG: { case PM_TRANSLATE_MSG: {
MSG* pmsg = (MSG*) lparam; MSG* pmsg = (MSG*) lparam;
@ -270,7 +274,7 @@ LRESULT FindProgramDlg::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
return FALSE;} return FALSE;}
default: default: def:
return super::WndProc(nmsg, wparam, lparam); return super::WndProc(nmsg, wparam, lparam);
} }

View file

@ -387,7 +387,7 @@ const Icon& IconCache::extract(const String& path)
SHFILEINFO sfi; SHFILEINFO sfi;
#if 1 // use system image list #if 1 // use system image list - the "search program dialog" needs it
HIMAGELIST himlSys = (HIMAGELIST) SHGetFileInfo(path, 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX|SHGFI_SMALLICON); HIMAGELIST himlSys = (HIMAGELIST) SHGetFileInfo(path, 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX|SHGFI_SMALLICON);
if (himlSys) { if (himlSys) {

View file

@ -425,7 +425,7 @@ LRESULT StartMenu::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
break; break;
case PM_SELECT_ENTRY: case PM_SELECT_ENTRY:
SelectButtonIndex(0, wparam?true:false); SelectButtonIndex(0, wparam!=0);
break; break;
#ifdef _LIGHT_STARTMENU #ifdef _LIGHT_STARTMENU