/*
- * Copyright 2003, 2004 Martin Fuchs
+ * Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
} catch(COMException&) {
}
- try {
- collect_programs(SpecialFolderPath(CSIDL_PROGRAMS, _hwnd));
- } catch(COMException&) {
- }
+ if (_alive)
+ try {
+ collect_programs(SpecialFolderPath(CSIDL_PROGRAMS, _hwnd));
+ } catch(COMException&) {
+ }
if (_alive)
_cache_valid = true;
dir->smart_scan(SORT_NONE, /*SCAN_EXTRACT_ICONS|*/SCAN_FILESYSTEM);
- for(Entry*entry=dir->_down; entry; entry=entry->_next) {
- if (!_alive)
- break;
-
+ for(Entry*entry=dir->_down; _alive && entry; entry=entry->_next) {
if (entry->_shell_attribs & SFGAO_HIDDEN)
continue;
- if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
collect_programs(entry->create_absolute_pidl());
- } else if (entry->_shell_attribs & SFGAO_LINK)
+ else if (entry->_shell_attribs & SFGAO_LINK)
if (_alive)
_callback(entry, _para);
}
FindProgramDlg::~FindProgramDlg()
{
+ _thread.Stop();
+
unregister_pretranslate(_hwnd);
}
LRESULT FindProgramDlg::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
{
switch(nmsg) {
+ case WM_CLOSE:
+ ListView_SetImageList(_list_ctrl, 0, LVSIL_SMALL); // detach system image list
+ goto def;
+
case PM_TRANSLATE_MSG: {
MSG* pmsg = (MSG*) lparam;
return FALSE;}
- default:
+ default: def:
return super::WndProc(nmsg, wparam, lparam);
}