ReactOS  0.4.15-dev-1377-ga59cecd
FindProgramDlg Struct Reference

Dialog to work with the complete list of start menu entries. More...

#include <searchprogram.h>

Inheritance diagram for FindProgramDlg:
Collaboration diagram for FindProgramDlg:

Public Types

typedef ResizeController< Dialogsuper
 
- Public Types inherited from ResizeController< Dialog >
typedef Dialog super
 
- Public Types inherited from Dialog
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 FindProgramDlg (HWND hwnd)
 
 ~FindProgramDlg ()
 
- Public Member Functions inherited from ResizeController< Dialog >
 ResizeController (HWND hwnd)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual void GetClientSpace (PRECT prect)
 
- Public Member Functions inherited from Dialog
 Dialog (HWND)
 
 ~Dialog ()
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
 Window (INT cx, INT cy, BOOL fAutoHide=FALSE)
 
virtual ~Window ()
 
virtual LRESULT CALLBACK WindowProcDx (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void DoAction ()
 

Protected Member Functions

virtual LRESULT WndProc (UINT, WPARAM, LPARAM)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
void Refresh (bool delete_cache=false)
 
void add_entry (const FPDEntry &cache_entry)
 
void LaunchSelected ()
 
void CheckEntries ()
 
- Protected Member Functions inherited from Dialog
int Command (int id, int code)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 
void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
 
void OnPaint (HWND hwnd)
 
void OnRButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnKey (HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)
 
void OnAppBarCallback (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL AppBar_Register (HWND hwnd)
 
BOOL AppBar_UnRegister (HWND hwnd)
 
BOOL AppBar_SetAutoHide (HWND hwnd, BOOL fHide)
 
BOOL AppBar_AutoHide (HWND hwnd)
 
BOOL AppBar_NoAutoHide (HWND hwnd)
 
BOOL AppBar_SetSide (HWND hwnd, UINT uSide)
 
void AppBar_SetAlwaysOnTop (HWND hwnd, BOOL fOnTop)
 
void AppBar_Hide (HWND hwnd)
 
void AppBar_UnHide (HWND hwnd)
 
void AppBar_SetAutoHideTimer (HWND hwnd)
 
void AppBar_SetAutoUnhideTimer (HWND hwnd)
 
void AppBar_Size (HWND hwnd)
 
void AppBar_QueryPos (HWND hwnd, LPRECT lprc)
 
void AppBar_QuerySetPos (UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
 
void AppBar_PosChanged (PAPPBARDATA pabd)
 
BOOL OnCreate (HWND hwnd, LPCREATESTRUCT lpCreateStruct)
 
void OnActivate (HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
 
void OnWindowPosChanged (HWND hwnd, const LPWINDOWPOS lpwpos)
 
void OnSize (HWND hwnd, UINT state, int cx, int cy)
 
void OnMove (HWND hwnd, int x, int y)
 
void OnNCDestroy (HWND hwnd)
 
void OnTimer (HWND hwnd, UINT id)
 
UINT OnNCHitTest (HWND hwnd, int x, int y)
 
void OnLButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnMouseMove (HWND hwnd, int x, int y, UINT keyFlags)
 
void OnLButtonUp (HWND hwnd, int x, int y, UINT keyFlags)
 
void GetWorkArea (LPRECT prc) const
 

Static Protected Member Functions

static void collect_programs_callback (Entry *entry, void *param)
 
static int CALLBACK CompareFunc (LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort)
 
- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window More...
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 

Protected Attributes

HWND _list_ctrl
 
HACCEL _haccel
 
String _lwr_filter
 
CollectProgramsThread _thread
 
FPDCache _cache
 
String _common_programs
 
String _user_programs
 
ListSort _sort
 
- Protected Attributes inherited from ResizeController< Dialog >
ResizeManager _resize_mgr
 
- Protected Attributes inherited from Window
HWND m_hwnd
 
BOOL m_fAutoHide
 
BOOL m_fOnTop
 
BOOL m_fHiding
 
UINT m_uSide
 
LONG m_cxWidth
 
LONG m_cyHeight
 
LONG m_cxSave
 
LONG m_cySave
 
BOOL m_fAppBarRegd
 
BOOL m_fMoving
 
BOOL m_bDragged
 
POINT m_ptDragOn
 
RECT m_rcAppBar
 
RECT m_rcDrag
 

Additional Inherited Members

- Static Public Member Functions inherited from Dialog
static int DoModal (UINT nid, CREATORFUNC creator, HWND hwndParent=0)
 
static int DoModal (UINT nid, CREATORFUNC_INFO creator, const void *info, HWND hwndParent=0)
 
- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle More...
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 
static BOOL DoRegisterClass (HINSTANCE hInstance)
 
static HWND DoCreateMainWnd (HINSTANCE hInstance, LPCTSTR pszText, INT cx, INT cy, DWORD style=WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN, DWORD exstyle=WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST, BOOL fAutoHide=FALSE)
 
static INT DoMainLoop ()
 
static WindowGetAppbarData (HWND hwnd)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI ActionThreadFunc (LPVOID args)
 
- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

Dialog to work with the complete list of start menu entries.

Definition at line 78 of file searchprogram.h.

Member Typedef Documentation

◆ super

Definition at line 80 of file searchprogram.h.

Constructor & Destructor Documentation

◆ FindProgramDlg()

FindProgramDlg::FindProgramDlg ( HWND  hwnd)

Definition at line 88 of file searchprogram.cpp.

89  : super(hwnd),
92  _sort(_list_ctrl, CompareFunc/*, (LPARAM)this*/)
93 {
94  TCHAR szTemp[256];
95  const size_t nChars = sizeof(szTemp)/sizeof(*szTemp);
97 
101 
102  _resize_mgr.Resize(+520, +300);
103 
105 
107 
109 
110  LoadString(g_Globals._hInstance, IDS_NAMECOLUMN, szTemp, nChars);
111  column.pszText = szTemp;
113 
114  column.cx = 300;
115  LoadString(g_Globals._hInstance, IDS_PATHCOLUMN, szTemp, nChars);
116  column.pszText = szTemp;
118 
119  column.cx = 400;
120  LoadString(g_Globals._hInstance, IDS_MENUCOLUMN, szTemp, nChars);
121  column.pszText = szTemp;
123 
125 
127  if (!_common_programs.empty())
128  _common_programs.append(_T("\\"));
129 
131  if (!_user_programs.empty())
132  _user_programs.append(_T("\\"));
133 
135 
136  Refresh();
137 
139 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
file system path of special folder
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define LVCF_WIDTH
Definition: commctrl.h:2583
#define LVSIL_SMALL
Definition: commctrl.h:2295
String _common_programs
Definition: searchprogram.h:93
#define LVCF_TEXT
Definition: commctrl.h:2584
#define IDA_SEARCH_PROGRAM
Definition: resource.h:77
#define IDC_PROGRAMS_FOUND
Definition: resource.h:166
ResizeController< Dialog > super
Definition: searchprogram.h:80
#define LV_COLUMN
Definition: commctrl.h:2543
#define IDS_MENUCOLUMN
Definition: resource.h:53
static void register_pretranslate(HWND hwnd)
Definition: window.cpp:579
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2730
#define LVCFMT_LEFT
Definition: commctrl.h:2594
#define IDC_FILTER
Definition: resource.h:165
CollectProgramsThread _thread
Definition: searchprogram.h:90
void Add(UINT id, int flags)
Definition: window.h:491
static int CALLBACK CompareFunc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort)
String _user_programs
Definition: searchprogram.h:93
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2034
ListSort _sort
Definition: searchprogram.h:95
#define LoadAccelerators
Definition: winuser.h:5785
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2632
static void collect_programs_callback(Entry *entry, void *param)
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2300
void Refresh(bool delete_cache=false)
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDS_NAMECOLUMN
Definition: resource.h:51
#define IDC_CHECK_ENTRIES
Definition: resource.h:176
HINSTANCE _hInstance
Definition: globals.h:270
#define IDI_SEARCH
Definition: resource.h:88
Definition: window.h:467
Definition: window.h:461
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
static VOID CenterWindow(HWND hWnd)
Definition: reactos.c:47
void SetWindowIcon(HWND hwnd, UINT nid)
set big and small icons out of the resources for a window
Definition: explorer.cpp:689
#define LVCF_FMT
Definition: commctrl.h:2582
ResizeManager _resize_mgr
Definition: window.h:563
#define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)
Definition: commctrl.h:2722
#define CSIDL_PROGRAMS
Definition: shlobj.h:2014
#define LoadString
Definition: winuser.h:5794
#define IDS_PATHCOLUMN
Definition: resource.h:52
void Resize(int dx, int dy)
Definition: window.cpp:847
IconCache _icon_cache
Definition: globals.h:285
HIMAGELIST get_sys_imagelist() const
Definition: globals.h:143

◆ ~FindProgramDlg()

FindProgramDlg::~FindProgramDlg ( )

Definition at line 141 of file searchprogram.cpp.

142 {
143  _thread.Stop();
144 
146 }
CollectProgramsThread _thread
Definition: searchprogram.h:90
static void unregister_pretranslate(HWND hwnd)
Definition: window.cpp:584

Member Function Documentation

◆ add_entry()

void FindProgramDlg::add_entry ( const FPDEntry cache_entry)
protected

Definition at line 229 of file searchprogram.cpp.

230 {
231  String lwr_path = cache_entry._path;
232  String lwr_name = cache_entry._entry->_display_name;
233 
234  lwr_path.toLower();
235  lwr_name.toLower();
236 
237  if (_lwr_filter.empty())
238  if (_tcsstr(lwr_name, _T("uninstal")) || _tcsstr(lwr_name, _T("deinstal"))) // filter out deinstallation links
239  return;
240 
241  if (!_tcsstr(lwr_path, _lwr_filter) && !_tcsstr(lwr_name, _lwr_filter))
242  return;
243 
245 
246  item.pszText = cache_entry._entry->_display_name;
247  item.iImage = cache_entry._idxIcon;
248  item.lParam = (LPARAM) &cache_entry;
249  item.iItem = ListView_InsertItem(_list_ctrl, &item); // We could use the information in _sort to enable manual sorting while populating the list.
250 
251  item.mask = LVIF_TEXT;
252 
253  item.iSubItem = 1;
254  item.pszText = (LPTSTR)(LPCTSTR)cache_entry._path;
256 
257  item.iSubItem = 2;
258  item.pszText = (LPTSTR)(LPCTSTR)cache_entry._menu_path;
260 }
#define LV_ITEM
Definition: commctrl.h:2333
String _lwr_filter
Definition: searchprogram.h:88
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define INT_MAX
Definition: limits.h:40
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2397
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2404
Definition: svc_auth_des.c:77
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define LVIF_TEXT
Definition: commctrl.h:2305
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
LONG_PTR LPARAM
Definition: windef.h:208
#define _tcsstr
Definition: xmlstorage.h:199
#define _T(x)
Definition: vfdio.h:22
#define LVIF_IMAGE
Definition: commctrl.h:2306
static ATOM item
Definition: dde.c:856
#define LVIF_PARAM
Definition: commctrl.h:2307

Referenced by collect_programs_callback(), and Refresh().

◆ CheckEntries()

void FindProgramDlg::CheckEntries ( )
protected
Todo:
check all entries for existing targets, display a list of not working entries and ask the user for permission to delete them

Definition at line 418 of file searchprogram.cpp.

419 {
421 }

Referenced by Command().

◆ collect_programs_callback()

void FindProgramDlg::collect_programs_callback ( Entry entry,
void param 
)
staticprotected

Definition at line 173 of file searchprogram.cpp.

174 {
175  FindProgramDlg* pThis = (FindProgramDlg*) param;
176 
177  IShellLink* pShellLink;
178  HRESULT hr = entry->GetUIObjectOf(pThis->_hwnd, IID_IShellLink, (LPVOID*)&pShellLink);
179 
180  if (SUCCEEDED(hr)) {
181  ShellLinkPtr shell_link(pShellLink);
182 
183  shell_link->Release();
184 
185  /*hr = pShellLink->Resolve(pThis->_hwnd, SLR_NO_UI);
186  if (SUCCEEDED(hr))*/ {
187  WIN32_FIND_DATA wfd;
189 
190  hr = pShellLink->GetPath(path, COUNTOF(path)-1, &wfd, SLGP_UNCPRIORITY);
191 
192  if (SUCCEEDED(hr)) {
193  TCHAR entry_path[MAX_PATH];
194 
195  entry->get_path(entry_path, COUNTOF(entry_path));
196 
197  String menu_path;
198 
199  int len = pThis->_common_programs.size();
200 
201  if (len && !_tcsnicmp(entry_path, pThis->_common_programs, len))
202  menu_path = ResString(IDS_ALL_USERS) + (String(entry_path)+len);
203  else if ((len=pThis->_user_programs.size()) && !_tcsnicmp(entry_path, pThis->_user_programs, len))
204  menu_path = String(entry_path)+len;
205 
206  // store info in cache
207  FPDEntry new_entry;
208 
209  new_entry._entry = entry;
210  new_entry._menu_path = menu_path;
211  new_entry._path = path;
212  new_entry._idxIcon = I_IMAGECALLBACK;
213 
214  pThis->_cache.push_front(new_entry);
215  FPDEntry& cache_entry = pThis->_cache.front();
216 
217  Lock lock(pThis->_thread._crit_sect);
218 
219  // resolve deadlocks while executing Thread::Stop()
220  if (!pThis->_thread.is_alive())
221  return;
222 
223  pThis->add_entry(cache_entry);
224  }
225  }
226  }
227 }
entry for the list in "find program" dialogs
Definition: searchprogram.h:66
rwlock_t lock
Definition: tcpcore.h:1163
String _common_programs
Definition: searchprogram.h:93
HRESULT hr
Definition: shlfolder.c:183
GLsizei const GLchar ** path
Definition: glext.h:7234
CollectProgramsThread _thread
Definition: searchprogram.h:90
#define IID_IShellLink
Definition: shlguid.h:128
Definition: svc_auth_des.c:77
String _user_programs
Definition: searchprogram.h:93
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
#define _tcsnicmp
Definition: xmlstorage.h:207
if SUCCEEDED(hr)
IShellLink smart pointer.
Definition: shellclasses.h:607
char TCHAR
Definition: xmlstorage.h:189
LONG HRESULT
Definition: typedefs.h:79
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:34
reference front()
Definition: _list.h:385
uint32_t entry
Definition: isohybrid.c:63
GLenum GLsizei len
Definition: glext.h:6722
Entry * _entry
Definition: searchprogram.h:68
Dialog to work with the complete list of start menu entries.
Definition: searchprogram.h:78
int _idxIcon
Definition: searchprogram.h:69
#define I_IMAGECALLBACK
Definition: commctrl.h:2381
void add_entry(const FPDEntry &cache_entry)
void push_front(const_reference __x)
Definition: _list.h:508
String _path
Definition: searchprogram.h:71
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
String _menu_path
Definition: searchprogram.h:70
#define COUNTOF(x)
Definition: utility.h:93
convenient loading of string resources
Definition: globals.h:303
#define IDS_ALL_USERS
Definition: resource.h:29
FPDCache _cache
Definition: searchprogram.h:91

◆ Command()

int FindProgramDlg::Command ( int  id,
int  code 
)
protectedvirtual

Reimplemented from Window.

Definition at line 284 of file searchprogram.cpp.

285 {
286  if (code == BN_CLICKED) {
287  switch(id) {
288  case ID_REFRESH:
289  Refresh(true);
290  break;
291 
292  case IDOK:
293  LaunchSelected();
294  break;
295 
296  case IDC_CHECK_ENTRIES:
297  CheckEntries();
298  break;
299 
300  default:
301  return super::Command(id, code);
302  }
303 
304  return 0;
305  }
306  else if (code == EN_CHANGE) {
307  switch(id) {
308  case IDC_FILTER:
309  Refresh();
310  break;
311  }
312 
313  return 0;
314  }
315 
316  return 1;
317 }
#define IDOK
Definition: winuser.h:824
#define ID_REFRESH
Definition: resource.h:16
#define IDC_FILTER
Definition: resource.h:165
void Refresh(bool delete_cache=false)
#define IDC_CHECK_ENTRIES
Definition: resource.h:176
#define BN_CLICKED
Definition: winuser.h:1907
Definition: inflate.c:139
int Command(int id, int code)
Definition: window.cpp:765
#define EN_CHANGE
Definition: winuser.h:2004

◆ CompareFunc()

int CALLBACK FindProgramDlg::CompareFunc ( LPARAM  lparam1,
LPARAM  lparam2,
LPARAM  lparamSort 
)
staticprotected

Definition at line 393 of file searchprogram.cpp.

394 {
395  ListSort* sort = (ListSort*)lparamSort;
396 
397  FPDEntry& a = *(FPDEntry*)lparam1;
398  FPDEntry& b = *(FPDEntry*)lparam2;
399 
400  int cmp = 0;
401 
402  switch(sort->_sort_crit) {
403  case 0:
404  cmp = _tcsicoll(a._entry->_display_name, b._entry->_display_name);
405  break;
406 
407  case 1:
408  cmp = _tcsicoll(a._path, b._path);
409  break;
410 
411  case 2:
412  cmp = _tcsicoll(a._menu_path, b._menu_path);
413  }
414 
415  return sort->_direction? -cmp: cmp;
416 }
entry for the list in "find program" dialogs
Definition: searchprogram.h:66
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
Definition: _algo.c:993
sorting of list controls
Definition: window.h:951
#define cmp(status, error)
Definition: error.c:114
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define _tcsicoll
Definition: tchar.h:1436

◆ LaunchSelected()

void FindProgramDlg::LaunchSelected ( )
protected

Definition at line 319 of file searchprogram.cpp.

320 {
321  Lock lock(_thread._crit_sect);
322 
324 
325  if (count > 1)
327  return;
328 
329  for(int idx=-1; (idx=ListView_GetNextItem(_list_ctrl, idx, LVNI_SELECTED))!=-1; ) {
331 
332  if (lparam) {
334  cache_entry._entry->launch_entry(_hwnd);
335  }
336  }
337 }
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2430
entry for the list in "find program" dialogs
Definition: searchprogram.h:66
#define IDOK
Definition: winuser.h:824
rwlock_t lock
Definition: tcpcore.h:1163
GLuint GLuint GLsizei count
Definition: gl.h:1545
CollectProgramsThread _thread
Definition: searchprogram.h:90
#define LVNI_SELECTED
Definition: commctrl.h:2420
Definition: svc_auth_des.c:77
#define ListView_GetSelectedCount(hwndLV)
Definition: commctrl.h:2705
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
unsigned int idx
Definition: utils.c:41
LONG_PTR LPARAM
Definition: windef.h:208
#define MB_OKCANCEL
Definition: winuser.h:798
#define IDS_TITLE
Definition: resource.h:30
#define IDS_LAUNCH_MANY_PROGRAMS
Definition: resource.h:32
#define MessageBox
Definition: winuser.h:5797
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
convenient loading of string resources
Definition: globals.h:303
int ListView_GetItemData(HWND list_ctrl, int idx)
Definition: window.h:915

Referenced by Command(), and Notify().

◆ Notify()

int FindProgramDlg::Notify ( int  id,
NMHDR pnmh 
)
protectedvirtual

Reimplemented from Window.

Definition at line 339 of file searchprogram.cpp.

340 {
341  switch(pnmh->code) {
342  case LVN_GETDISPINFO: {
343  LV_DISPINFO* pDispInfo = (LV_DISPINFO*) pnmh;
344 
345  if (pnmh->hwndFrom == _list_ctrl) {
346  if (pDispInfo->item.mask & LVIF_IMAGE) {
347  FPDEntry& cache_entry = *(FPDEntry*)pDispInfo->item.lParam;
348  Entry* entry = cache_entry._entry;
349 
350  if (entry->_icon_id == ICID_UNKNOWN)
351  entry->_icon_id = entry->extract_icon(ICF_SYSCACHE);
352 
353  pDispInfo->item.iImage = g_Globals._icon_cache.get_icon(entry->_icon_id).get_sysiml_idx();
354  pDispInfo->item.mask |= LVIF_DI_SETITEM;
355 
356  return 1;
357  }
358  }}
359  break;
360 
361  case NM_DBLCLK:
362  if (pnmh->hwndFrom == _list_ctrl)
363  LaunchSelected();
364  /*{
365  Lock lock(_thread._crit_sect);
366 
367  LPNMLISTVIEW pnmv = (LPNMLISTVIEW) pnmh;
368  LPARAM lparam = ListView_GetItemData(pnmh->hwndFrom, pnmv->iItem);
369 
370  if (lparam) {
371  FPDEntry& cache_entry = *(FPDEntry*)lparam;
372  cache_entry._entry->launch_entry(_hwnd);
373  }
374  }*/
375  break;
376 
377  case HDN_ITEMCLICK: {
378  WaitCursor wait;
379  NMHEADER* phdr = (NMHEADER*)pnmh;
380 
381  if (GetParent(pnmh->hwndFrom) == _list_ctrl) {
382  if (_thread._cache_valid) { // disable manual sorting while populating the list
383  _sort.toggle_sort(phdr->iItem);
384  _sort.sort();
385  }
386  }
387  break;}
388  }
389 
390  return 0;
391 }
entry for the list in "find program" dialogs
Definition: searchprogram.h:66
CollectProgramsThread _thread
Definition: searchprogram.h:90
Definition: svc_auth_des.c:77
ListSort _sort
Definition: searchprogram.h:95
UINT code
Definition: winuser.h:3134
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define LVIF_IMAGE
Definition: commctrl.h:2306
uint32_t entry
Definition: isohybrid.c:63
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define LV_DISPINFO
Definition: commctrl.h:3166
const Icon & get_icon(int icon_id)
Definition: explorer.cpp:625
HWND hwndFrom
Definition: winuser.h:3132
void sort()
Definition: window.cpp:1292
#define LVN_GETDISPINFO
Definition: commctrl.h:3156
#define HDN_ITEMCLICK
Definition: commctrl.h:864
HWND WINAPI GetParent(_In_ HWND)
#define NM_DBLCLK
Definition: commctrl.h:131
#define NMHEADER
Definition: commctrl.h:890
#define LVIF_DI_SETITEM
Definition: commctrl.h:3162
int get_sysiml_idx() const
Definition: globals.h:109
base of all file and directory entries
Definition: entries.h:82
void toggle_sort(int idx)
Definition: window.cpp:1282
IconCache _icon_cache
Definition: globals.h:285

◆ Refresh()

void FindProgramDlg::Refresh ( bool  delete_cache = false)
protected

Definition at line 149 of file searchprogram.cpp.

150 {
151  WaitCursor wait;
152 
153  _thread.Stop();
154 
155  TCHAR buffer[1024];
157  CharLower(buffer);
159 
160  HiddenWindow hide_listctrl(_list_ctrl);
161 
163 
165  _thread.free_dirs();
166  _thread.Start();
167  } else {
168  for(FPDCache::const_iterator it=_cache.begin(); it!=_cache.end(); ++it)
169  add_entry(*it);
170  }
171 }
String _lwr_filter
Definition: searchprogram.h:88
iterator begin()
Definition: _list.h:367
GLuint buffer
Definition: glext.h:5915
#define IDC_FILTER
Definition: resource.h:165
CollectProgramsThread _thread
Definition: searchprogram.h:90
#define GetWindowText
Definition: winuser.h:5773
static void delete_cache(struct netbuf *)
Definition: rpcb_clnt.c:171
_STLP_PRIV _List_iterator< FPDEntry, _Const_traits< FPDEntry > > const_iterator
Definition: _list.h:276
char TCHAR
Definition: xmlstorage.h:189
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
void add_entry(const FPDEntry &cache_entry)
iterator end()
Definition: _list.h:370
#define CharLower
Definition: winuser.h:5712
#define COUNTOF(x)
Definition: utility.h:93
FPDCache _cache
Definition: searchprogram.h:91
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2410

Referenced by Command(), and FindProgramDlg().

◆ WndProc()

LRESULT FindProgramDlg::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual

Reimplemented from Window.

Definition at line 262 of file searchprogram.cpp.

263 {
264  switch(nmsg) {
265  case WM_CLOSE:
266  (void)ListView_SetImageList(_list_ctrl, 0, LVSIL_SMALL); // detach system image list
267  goto def;
268 
269  case PM_TRANSLATE_MSG: {
270  MSG* pmsg = (MSG*) lparam;
271 
272  if (TranslateAccelerator(_hwnd, _haccel, pmsg))
273  return TRUE;
274 
275  return FALSE;}
276 
277  default: def:
278  return super::WndProc(nmsg, wparam, lparam);
279  }
280 
281  return 0;
282 }
#define TranslateAccelerator
Definition: winuser.h:5835
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define LVSIL_SMALL
Definition: commctrl.h:2295
#define TRUE
Definition: types.h:120
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define PM_TRANSLATE_MSG
Definition: window.h:266
#define FALSE
Definition: types.h:117
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2300
#define WM_CLOSE
Definition: winuser.h:1603
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.h:525
static UINT WPARAM wparam
Definition: combo.c:716

Member Data Documentation

◆ _cache

FPDCache FindProgramDlg::_cache
protected

Definition at line 91 of file searchprogram.h.

Referenced by collect_programs_callback(), and Refresh().

◆ _common_programs

String FindProgramDlg::_common_programs
protected

Definition at line 93 of file searchprogram.h.

Referenced by collect_programs_callback(), and FindProgramDlg().

◆ _haccel

HACCEL FindProgramDlg::_haccel
protected

Definition at line 87 of file searchprogram.h.

Referenced by FindProgramDlg(), and WndProc().

◆ _list_ctrl

HWND FindProgramDlg::_list_ctrl
protected

Definition at line 86 of file searchprogram.h.

Referenced by add_entry(), FindProgramDlg(), LaunchSelected(), Notify(), Refresh(), and WndProc().

◆ _lwr_filter

String FindProgramDlg::_lwr_filter
protected

Definition at line 88 of file searchprogram.h.

Referenced by add_entry(), and Refresh().

◆ _sort

ListSort FindProgramDlg::_sort
protected

Definition at line 95 of file searchprogram.h.

Referenced by Notify().

◆ _thread

CollectProgramsThread FindProgramDlg::_thread
protected

◆ _user_programs

String FindProgramDlg::_user_programs
protected

Definition at line 93 of file searchprogram.h.

Referenced by collect_programs_callback(), and FindProgramDlg().


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