ReactOS 0.4.15-dev-8145-ga541a46
CollectProgramsThread Struct Reference

Thread for collecting start menu entries. More...

#include <searchprogram.h>

Inheritance diagram for CollectProgramsThread:
Collaboration diagram for CollectProgramsThread:

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
 

Detailed Description

Thread for collecting start menu entries.

Definition at line 35 of file searchprogram.h.

Constructor & Destructor Documentation

◆ CollectProgramsThread()

CollectProgramsThread::CollectProgramsThread ( COLLECT_CALLBACK  callback,
HWND  hwnd,
void para 
)
inline

Definition at line 37 of file searchprogram.h.

38 : _cache_valid(false),
40 _hwnd(hwnd),
41 _para(para)
42 {
43 }
static IPrintDialogCallback callback
Definition: printdlg.c:326
COLLECT_CALLBACK _callback
Definition: searchprogram.h:56
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ ~CollectProgramsThread()

CollectProgramsThread::~CollectProgramsThread ( )
inline

Definition at line 45 of file searchprogram.h.

46 {
47 free_dirs();
48 }

Member Function Documentation

◆ collect_programs()

void CollectProgramsThread::collect_programs ( const ShellPath path)
protected

Definition at line 55 of file searchprogram.cpp.

56{
58 _dirs.push(dir);
59
60 dir->smart_scan(SORT_NONE);
61
62 for(Entry*entry=dir->_down; _alive && entry; entry=entry->_next) {
63 if (entry->_shell_attribs & SFGAO_HIDDEN)
64 continue;
65
66 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
67 collect_programs(entry->create_absolute_pidl());
68 else if (entry->_shell_attribs & SFGAO_LINK)
69 if (_alive)
71 }
72}
unsigned int dir
Definition: maze.c:112
void push(const value_type &__x)
Definition: _stack.h:86
@ SORT_NONE
Definition: entries.h:45
uint32_t entry
Definition: isohybrid.c:63
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
ShellFolder & GetDesktopFolder()
void collect_programs(const ShellPath &path)
ShellDirectoryStack _dirs
Definition: searchprogram.h:59
base of all file and directory entries
Definition: entries.h:83
shell folder entry
Definition: shellfs.h:54

Referenced by collect_programs(), and Run().

◆ free_dirs()

void CollectProgramsThread::free_dirs ( )

Definition at line 74 of file searchprogram.cpp.

75{
76 while(!_dirs.empty()) {
78 dir->free_subentries();
79 _dirs.pop();
80 }
81}
bool empty() const
Definition: _stack.h:82
reference top()
Definition: _stack.h:84
void pop()
Definition: _stack.h:87

Referenced by FindProgramDlg::Refresh(), and ~CollectProgramsThread().

◆ Run()

int CollectProgramsThread::Run ( )

Definition at line 36 of file searchprogram.cpp.

37{
38 try {
40 } catch(COMException&) {
41 }
42
43 if (_alive)
44 try {
46 } catch(COMException&) {
47 }
48
49 if (_alive)
50 _cache_valid = true;
51
52 return 0;
53}
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2188
#define CSIDL_PROGRAMS
Definition: shlobj.h:2168
Exception with context information.
Definition: shellclasses.h:114
Retrieval of special shell folder paths.
Definition: shellclasses.h:982

Member Data Documentation

◆ _cache_valid

bool CollectProgramsThread::_cache_valid

Definition at line 53 of file searchprogram.h.

Referenced by FindProgramDlg::Notify(), FindProgramDlg::Refresh(), and Run().

◆ _callback

COLLECT_CALLBACK CollectProgramsThread::_callback
protected

Definition at line 56 of file searchprogram.h.

Referenced by collect_programs().

◆ _dirs

ShellDirectoryStack CollectProgramsThread::_dirs
protected

Definition at line 59 of file searchprogram.h.

Referenced by collect_programs(), and free_dirs().

◆ _hwnd

HWND CollectProgramsThread::_hwnd
protected

Definition at line 57 of file searchprogram.h.

Referenced by Run().

◆ _para

void* CollectProgramsThread::_para
protected

Definition at line 58 of file searchprogram.h.

Referenced by collect_programs().


The documentation for this struct was generated from the following files: