Thread for collecting start menu entries. More...
#include <searchprogram.h>


Public Member Functions | |
| CollectProgramsThread (COLLECT_CALLBACK callback, HWND hwnd, void *para) | |
| ~CollectProgramsThread () | |
| int | Run () |
| void | free_dirs () |
Public Attributes | |
| bool | _cache_valid |
Protected Member Functions | |
| void | collect_programs (const ShellPath &path) |
Protected Attributes | |
| COLLECT_CALLBACK | _callback |
| HWND | _hwnd |
| void * | _para |
| ShellDirectoryStack | _dirs |
Thread for collecting start menu entries.
Definition at line 35 of file searchprogram.h.
| CollectProgramsThread::CollectProgramsThread | ( | COLLECT_CALLBACK | callback, |
| HWND | hwnd, | ||
| void * | para | ||
| ) | [inline] |
Definition at line 37 of file searchprogram.h.
: _cache_valid(false), _callback(callback), _hwnd(hwnd), _para(para) { }
| CollectProgramsThread::~CollectProgramsThread | ( | ) | [inline] |
Definition at line 45 of file searchprogram.h.
References free_dirs().
{
free_dirs();
}

| void CollectProgramsThread::collect_programs | ( | const ShellPath & | path ) | [protected] |
Definition at line 57 of file searchprogram.cpp.
References Thread::_alive, _callback, _dirs, Entry::_down, _para, GetDesktopFolder(), Entry::smart_scan(), and SORT_NONE.
Referenced by Run().
{
ShellDirectory* dir = new ShellDirectory(GetDesktopFolder(), path, 0);
_dirs.push(dir);
dir->smart_scan(SORT_NONE);
for(Entry*entry=dir->_down; _alive && entry; entry=entry->_next) {
if (entry->_shell_attribs & SFGAO_HIDDEN)
continue;
if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
collect_programs(entry->create_absolute_pidl());
else if (entry->_shell_attribs & SFGAO_LINK)
if (_alive)
_callback(entry, _para);
}
}


| void CollectProgramsThread::free_dirs | ( | ) |
Definition at line 76 of file searchprogram.cpp.
References _dirs, and Entry::free_subentries().
Referenced by FindProgramDlg::Refresh(), and ~CollectProgramsThread().
{
while(!_dirs.empty()) {
ShellDirectory* dir = _dirs.top();
dir->free_subentries();
_dirs.pop();
}
}


| int CollectProgramsThread::Run | ( | ) | [virtual] |
Implements Thread.
Definition at line 38 of file searchprogram.cpp.
References Thread::_alive, _cache_valid, _hwnd, and collect_programs().
{
try {
collect_programs(SpecialFolderPath(CSIDL_COMMON_PROGRAMS, _hwnd));
} catch(COMException&) {
}
if (_alive)
try {
collect_programs(SpecialFolderPath(CSIDL_PROGRAMS, _hwnd));
} catch(COMException&) {
}
if (_alive)
_cache_valid = true;
return 0;
}

Definition at line 53 of file searchprogram.h.
Referenced by FindProgramDlg::Notify(), FindProgramDlg::Refresh(), and Run().
COLLECT_CALLBACK CollectProgramsThread::_callback [protected] |
Definition at line 56 of file searchprogram.h.
Referenced by collect_programs().
ShellDirectoryStack CollectProgramsThread::_dirs [protected] |
Definition at line 59 of file searchprogram.h.
Referenced by collect_programs(), and free_dirs().
HWND CollectProgramsThread::_hwnd [protected] |
Definition at line 57 of file searchprogram.h.
Referenced by Run().
void* CollectProgramsThread::_para [protected] |
Definition at line 58 of file searchprogram.h.
Referenced by collect_programs().
|
ROS Explorer Source Code Documentation
generated on 02.01.2013 by
|