ReactOS  0.4.14-dev-368-gfa26425
CSearchBar.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Search Shell Extension
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: Search UI
5  * COPYRIGHT: Copyright 2019 Brock Mammen
6  */
7 
8 #include "CSearchBar.h"
9 #include <psdk/wingdi.h>
10 #include <commoncontrols.h>
11 #include <../browseui.h>
12 #include <shellapi.h>
13 #include <exdispid.h>
14 
16 
17 #if 1
18 #undef UNIMPLEMENTED
19 
20 #define UNIMPLEMENTED DbgPrint("%s is UNIMPLEMENTED!\n", __FUNCTION__)
21 #endif
22 
24  m_pSite(NULL),
25  m_bVisible(FALSE)
26 {
27 }
28 
30 {
31 }
32 
34 {
35  HKEY hkey;
36  DWORD dwType;
37  DWORD size = sizeof(DWORD);
38  DWORD result;
39  DWORD SearchHiddenValue = 0;
40 
41  result = RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer", 0, KEY_QUERY_VALUE, &hkey);
42  if (result == ERROR_SUCCESS)
43  {
44  if (RegQueryValueEx(hkey, L"SearchHidden", NULL, &dwType, (LPBYTE)&SearchHiddenValue, &size) == ERROR_SUCCESS)
45  {
46  if ((dwType != REG_DWORD) || (size != sizeof(DWORD)))
47  {
48  ERR("RegQueryKey for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SearchHidden\" returned error(s).\n");
49  SearchHiddenValue = 1;
50  }
51  else
52  {
53  TRACE("SearchHidden is '%d'.\n", SearchHiddenValue);
54  }
55  }
56  else
57  {
58  ERR("RegQueryKey for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\SearchHidden\" Failed.\n");
59  }
60  RegCloseKey(hkey);
61  }
62  else
63  ERR("RegOpenKey for \"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\" Failed.\n");
64 
65  if (SearchHiddenValue != 0)
67  else
69 
71 
72  HWND hCombobox = GetDlgItem(IDC_SEARCH_COMBOBOX);
73  CComPtr<IImageList> pImageList;
74  HRESULT hResult = SHGetImageList(SHIL_SMALL, IID_PPV_ARG(IImageList, &pImageList));
75  SendMessage(hCombobox, CBEM_SETIMAGELIST, 0, FAILED_UNEXPECTEDLY(hResult) ? 0 : reinterpret_cast<LPARAM>(pImageList.p));
76 
79  HWND hEditControl = reinterpret_cast<HWND>(SendMessage(hCombobox, CBEM_GETEDITCONTROL, 0, 0));
80  hResult = CAddressEditBox_CreateInstance(IID_PPV_ARG(IAddressEditBox, &m_AddressEditBox));
81  if (FAILED_UNEXPECTEDLY(hResult))
82  return FALSE;
83 
84  hResult = m_AddressEditBox->Init(hCombobox, hEditControl, 0, m_pSite);
85  if (FAILED_UNEXPECTEDLY(hResult))
86  return FALSE;
87 
88  // Subscribe to navigation events
89  CComPtr<IShellBrowser> pShellBrowser;
91  DWORD dwAdviseCookie;
92  if (SUCCEEDED(hResult))
93  AtlAdvise(pShellBrowser, static_cast<IDispatch *>(this), DIID_DWebBrowserEvents, &dwAdviseCookie);
94 
95  // Invoke the navigate event in case a search results folder is already open
96  DISPPARAMS params = {0};
98 
99  return TRUE;
100 }
101 
102 
103 // *** ATL event handlers ***
105 {
106  IUnknown_OnFocusChangeIS(m_pSite, static_cast<IDeskBand *>(this), TRUE);
107  bHandled = FALSE;
108  return TRUE;
109 }
110 
112 {
113  HRESULT hr;
114  CComPtr<IShellBrowser> pShellBrowser;
115  if (!ppShellBrowser)
116  ppShellBrowser = &pShellBrowser;
117  if (!*ppShellBrowser)
118  {
120  if (FAILED_UNEXPECTEDLY(hr))
121  return hr;
122  }
123 
124  CComPtr<IShellView> pShellView;
125  hr = (*ppShellBrowser)->QueryActiveShellView(&pShellView);
126  if (FAILED(hr) || !pShellView)
127  return hr;
128 
129  CComPtr<IFolderView> pFolderView;
130  hr = pShellView->QueryInterface(IID_PPV_ARG(IFolderView, &pFolderView));
131  if (FAILED(hr) || !pFolderView)
132  return hr;
133 
134  CComPtr<IShellFolder> pShellFolder;
135  if (!ppShellFolder)
136  ppShellFolder = &pShellFolder;
137  hr = pFolderView->GetFolder(IID_PPV_ARG(IShellFolder, ppShellFolder));
138  if (FAILED(hr) || !pShellFolder)
139  return hr;
140 
141  CLSID clsid;
142  hr = IUnknown_GetClassID(*ppShellFolder, &clsid);
143  if (FAILED(hr))
144  return hr;
145  if (clsid != CLSID_FindFolder)
146  return E_FAIL;
147 
148  if (pHwnd)
149  {
150  hr = pShellView->GetWindow(pHwnd);
151  if (FAILED_UNEXPECTEDLY(hr))
152  return hr;
153  }
154 
155  return S_OK;
156 }
157 
158 LRESULT CSearchBar::OnSearchButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
159 {
160  size_t len = 0;
161  WCHAR endchar;
162  WCHAR startchar;
163 
164  CComHeapPtr<SearchStart> pSearchStart(static_cast<SearchStart *>(CoTaskMemAlloc(sizeof(SearchStart))));
165  GetDlgItemText(IDC_SEARCH_FILENAME, pSearchStart->szFileName, _countof(pSearchStart->szFileName));
166  GetDlgItemText(IDC_SEARCH_QUERY, pSearchStart->szQuery, _countof(pSearchStart->szQuery));
167 
169 
170  if (!GetAddressEditBoxPath(pSearchStart->szPath))
171  {
172  ShellMessageBoxW(_AtlBaseModule.GetResourceInstance(), m_hWnd, MAKEINTRESOURCEW(IDS_SEARCHINVALID), MAKEINTRESOURCEW(IDS_SEARCHLABEL), MB_OK | MB_ICONERROR, pSearchStart->szPath);
173  return 0;
174  }
175 
176  // See if we have an szFileName by testing for its entry lenth > 0 and our searched FileName does not contain
177  // an asterisk or a question mark. If so, then prepend and append an asterisk to the searched FileName.
178  // (i.e. it's equivalent to searching for *<the_file_name>* )
179  if (FAILED (StringCchLengthW (pSearchStart->szFileName, MAX_PATH, &len))) return 0;
180  if ((len > 0) && !wcspbrk(pSearchStart->szFileName, L"*?"))
181  {
182  endchar = pSearchStart->szFileName[len - 1];
183  startchar = pSearchStart->szFileName[0];
184  if ((len < MAX_PATH - 1) && (startchar != L'*'))
185  {
186  memmove(&pSearchStart->szFileName[1], &pSearchStart->szFileName[0],
187  len * sizeof(WCHAR) + sizeof(WCHAR));
188  len = len + 1;
189  pSearchStart->szFileName[0] = L'*';
190  }
191 
192  // See if our last character is an asterisk and if not and we have room then add one
193  if ((len < MAX_PATH - 1) && (endchar != L'*'))
194  StringCchCatW(pSearchStart->szFileName, MAX_PATH, L"*");
195  }
196 
197  // Print our final search string for szFileName
198  TRACE("Searched szFileName is '%S'.\n", pSearchStart->szFileName);
199 
200  CComPtr<IShellBrowser> pShellBrowser;
202  if (FAILED_UNEXPECTEDLY(hr))
203  return 0;
204 
205  HWND hwnd;
206  if (FAILED(GetSearchResultsFolder(&pShellBrowser, &hwnd, NULL)))
207  {
208  // Open a new search results folder
209  WCHAR szShellGuid[MAX_PATH];
210  const WCHAR shellGuidPrefix[] = L"shell:::";
211  memcpy(szShellGuid, shellGuidPrefix, sizeof(shellGuidPrefix));
212  hr = StringFromGUID2(CLSID_FindFolder, szShellGuid + _countof(shellGuidPrefix) - 1,
213  _countof(szShellGuid) - _countof(shellGuidPrefix));
214  if (FAILED_UNEXPECTEDLY(hr))
215  return 0;
216 
217  CComHeapPtr<ITEMIDLIST> findFolderPidl;
218  hr = SHParseDisplayName(szShellGuid, NULL, &findFolderPidl, 0, NULL);
219  if (FAILED_UNEXPECTEDLY(hr))
220  return 0;
221 
222  hr = pShellBrowser->BrowseObject(findFolderPidl, 0);
223  if (FAILED_UNEXPECTEDLY(hr))
224  return 0;
225 
226  hr = GetSearchResultsFolder(&pShellBrowser, &hwnd, NULL);
227  if (FAILED_UNEXPECTEDLY(hr))
228  return 0;
229  }
230 
231  ::PostMessageW(hwnd, WM_SEARCH_START, 0, (LPARAM) pSearchStart.Detach());
232 
234 
235  return 0;
236 }
237 
238 LRESULT CSearchBar::OnStopButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
239 {
240  HWND hwnd;
242  if (SUCCEEDED(hr))
244 
245  return 0;
246 }
247 
249 {
250  HWND hComboboxEx = GetDlgItem(IDC_SEARCH_COMBOBOX);
251  ::GetWindowTextW(hComboboxEx, szPath, MAX_PATH);
252  INT iSelectedIndex = SendMessageW(hComboboxEx, CB_GETCURSEL, 0, 0);
253  if (iSelectedIndex != CB_ERR)
254  {
255  WCHAR szItemText[MAX_PATH];
256  COMBOBOXEXITEMW item = {0};
257  item.mask = CBEIF_LPARAM | CBEIF_TEXT;
258  item.iItem = iSelectedIndex;
259  item.pszText = szItemText;
260  item.cchTextMax = _countof(szItemText);
261  SendMessageW(hComboboxEx, CBEM_GETITEMW, 0, (LPARAM)&item);
262 
263  if (!wcscmp(szItemText, szPath) && SHGetPathFromIDListW((LPCITEMIDLIST)item.lParam, szItemText))
264  {
265  StringCbCopyW(szPath, MAX_PATH * sizeof(WCHAR), szItemText);
266  return TRUE;
267  }
268  }
269 
273 }
274 
276 {
277  INT iWidth = LOWORD(lParam);
278  INT iPadding = 10;
279 
281 
283  HDWP hdwp = BeginDeferWindowPos(_countof(inputs));
284  for (SIZE_T i = 0; i < _countof(inputs); i++)
285  {
286  CWindow wnd = (CWindow) GetDlgItem(inputs[i]);
287  RECT rect;
288  wnd.GetWindowRect(&rect);
289  POINT pt = { rect.left, rect.top };
290  ScreenToClient(&pt);
291  hdwp = wnd.DeferWindowPos(hdwp,
292  HWND_TOP,
293  iPadding,
294  pt.y,
295  iWidth - iPadding * 2,
296  rect.bottom - rect.top,
298  }
299  EndDeferWindowPos(hdwp);
300 
301  return 0;
302 }
303 
304 
305 // *** IOleWindow methods ***
307 {
308  if (!lphwnd)
309  return E_INVALIDARG;
310  *lphwnd = m_hWnd;
311  return S_OK;
312 }
313 
315 {
317  return E_NOTIMPL;
318 }
319 
320 
321 // *** IDockingWindow methods ***
323 {
324  // We do nothing, we don't have anything to save yet
325  TRACE("CloseDW called\n");
326  return S_OK;
327 }
328 
329 HRESULT STDMETHODCALLTYPE CSearchBar::ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
330 {
331  /* Must return E_NOTIMPL according to MSDN */
332  return E_NOTIMPL;
333 }
334 
336 {
337  m_bVisible = fShow;
338  ShowWindow(fShow);
339  return S_OK;
340 }
341 
342 
343 // *** IDeskBand methods ***
345 {
346  if (!pdbi)
347  {
348  return E_INVALIDARG;
349  }
350 
351  if (pdbi->dwMask & DBIM_MINSIZE)
352  {
353  pdbi->ptMinSize.x = 200;
354  pdbi->ptMinSize.y = 30;
355  }
356 
357  if (pdbi->dwMask & DBIM_MAXSIZE)
358  {
359  pdbi->ptMaxSize.y = -1;
360  }
361 
362  if (pdbi->dwMask & DBIM_INTEGRAL)
363  {
364  pdbi->ptIntegral.y = 1;
365  }
366 
367  if (pdbi->dwMask & DBIM_ACTUAL)
368  {
369  pdbi->ptActual.x = 200;
370  pdbi->ptActual.y = 30;
371  }
372 
373  if (pdbi->dwMask & DBIM_TITLE)
374  {
375  if (!LoadStringW(_AtlBaseModule.GetResourceInstance(), IDS_SEARCHLABEL, pdbi->wszTitle, _countof(pdbi->wszTitle)))
377  }
378 
379  if (pdbi->dwMask & DBIM_MODEFLAGS)
380  {
381  pdbi->dwModeFlags = DBIMF_NORMAL | DBIMF_VARIABLEHEIGHT;
382  }
383 
384  if (pdbi->dwMask & DBIM_BKCOLOR)
385  {
386  pdbi->dwMask &= ~DBIM_BKCOLOR;
387  }
388  return S_OK;
389 }
390 
391 
392 // *** IObjectWithSite methods ***
394 {
395  HRESULT hr;
396  HWND parentWnd;
397 
398  if (pUnkSite == m_pSite)
399  return S_OK;
400 
401  TRACE("SetSite called \n");
402  if (!pUnkSite)
403  {
404  DestroyWindow();
405  m_hWnd = NULL;
406  return S_OK;
407  }
408 
409  hr = IUnknown_GetWindow(pUnkSite, &parentWnd);
410  if (!SUCCEEDED(hr))
411  {
412  ERR("Could not get parent's window ! Status: %08lx\n", hr);
413  return E_INVALIDARG;
414  }
415 
416  m_pSite = pUnkSite;
417 
418  if (m_hWnd)
419  {
420  // Change its parent
421  SetParent(parentWnd);
422  }
423  else
424  {
425  CDialogImpl::Create(parentWnd);
426 
427  }
428  return S_OK;
429 }
430 
432 {
433  if (!ppvSite)
434  return E_POINTER;
435  *ppvSite = m_pSite;
436  return S_OK;
437 }
438 
439 
440 // *** IInputObject methods ***
442 {
443  if (fActivate)
444  {
445  //SetFocus();
446  SetActiveWindow();
447  }
448  // TODO: handle message
449  if(lpMsg)
450  {
451  TranslateMessage(lpMsg);
452  DispatchMessage(lpMsg);
453  }
454  return S_OK;
455 }
456 
458 {
459  return S_OK;
460 }
461 
463 {
464  if (IsDialogMessage(lpMsg))
465  return S_OK;
466 
467  if ((lpMsg->hwnd == m_hWnd || IsChild(lpMsg->hwnd)))
468  {
469  TranslateMessage(lpMsg);
470  DispatchMessage(lpMsg);
471  return S_OK;
472  }
473 
474  return S_FALSE;
475 }
476 
477 // *** IPersist methods ***
479 {
480  if (!pClassID)
481  return E_POINTER;
482  *pClassID = CLSID_FileSearchBand;
483  return S_OK;
484 }
485 
486 
487 // *** IPersistStream methods ***
489 {
491  return E_NOTIMPL;
492 }
493 
495 {
497  return E_NOTIMPL;
498 }
499 
501 {
503  return E_NOTIMPL;
504 }
505 
507 {
508  // TODO: calculate max size
510  return E_NOTIMPL;
511 }
512 
513 
514 // *** IDispatch methods ***
516 {
518  return E_NOTIMPL;
519 }
520 
522 {
524  return E_NOTIMPL;
525 }
526 
528 {
530  return E_NOTIMPL;
531 }
532 
534 {
537  HWND hProgressBar = GetDlgItem(IDC_PROGRESS_BAR);
538  ::ShowWindow(hProgressBar, bInProgress ? SW_SHOW : SW_HIDE);
539  ::PostMessage(hProgressBar, PBM_SETMARQUEE, bInProgress, 0);
540 }
541 
543 {
544  CComPtr<IShellFolder> pShellFolder;
545  HRESULT hr = GetSearchResultsFolder(NULL, NULL, &pShellFolder);
546  if (FAILED(hr))
547  return hr;
548 
549  DWORD fAdviseCookie;
550  hr = AtlAdvise(pShellFolder, static_cast<IDispatch *>(this), DIID_DSearchCommandEvents, &fAdviseCookie);
551  if (FAILED_UNEXPECTEDLY(hr))
552  return hr;
553 
554  return S_OK;
555 }
556 
557 HRESULT STDMETHODCALLTYPE CSearchBar::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
558 {
559  switch (dispIdMember)
560  {
563  {
565 
566  // Remove the search results folder from the address box
567  CComPtr<IDispatch> pDispatch;
568  HRESULT hResult = m_AddressEditBox->QueryInterface(IID_PPV_ARG(IDispatch, &pDispatch));
569  if (FAILED_UNEXPECTEDLY(hResult))
570  return hResult;
571  pDispatch->Invoke(dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
572  CComPtr<IShellService> pShellService;
573  hResult = m_AddressEditBox->QueryInterface(IID_PPV_ARG(IShellService, &pShellService));
574  if (FAILED_UNEXPECTEDLY(hResult))
575  return hResult;
576  hResult = pShellService->SetOwner(NULL);
577  if (FAILED_UNEXPECTEDLY(hResult))
578  return hResult;
579  HWND hComboboxEx = GetDlgItem(IDC_SEARCH_COMBOBOX);
580  int index = SendMessageW(hComboboxEx, CB_GETCOUNT, 0, 0);
581  if (index <= 0)
582  return S_OK;
583  COMBOBOXEXITEMW item = {0};
584  item.mask = CBEIF_LPARAM;
585  item.iItem = index - 1;
586  SendMessageW(hComboboxEx, CBEM_GETITEMW, 0, (LPARAM)&item);
587  if (!item.lParam)
588  return S_OK;
589  CComPtr<IShellFolder> pDesktopFolder;
590  hResult = SHGetDesktopFolder(&pDesktopFolder);
591  if (FAILED_UNEXPECTEDLY(hResult))
592  return hResult;
593  CComPtr<IShellFolder> pShellFolder;
594  hResult = pDesktopFolder->BindToObject((LPCITEMIDLIST)item.lParam, NULL, IID_PPV_ARG(IShellFolder, &pShellFolder));
595  if (FAILED(hResult))
596  return S_OK;
597  CLSID clsid;
598  hResult = IUnknown_GetClassID(pShellFolder, &clsid);
599  if (SUCCEEDED(hResult) && clsid == CLSID_FindFolder)
600  {
601  SendMessageW(hComboboxEx, CBEM_DELETEITEM, item.iItem, 0);
602  SendMessageW(hComboboxEx, CB_SETCURSEL, 0, 0);
603  }
604  return S_OK;
605  }
607  case DISPID_SEARCHABORT:
609  return S_OK;
610  default:
611  return E_INVALIDARG;
612  }
613 }
DBIM_BKCOLOR struct tagDESKBANDINFO DESKBANDINFO
#define IDC_PROGRESS_BAR
Definition: resource.h:134
#define RegQueryValueEx
Definition: winreg.h:524
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: CSearchBar.cpp:557
BOOL IsDialogMessage(LPMSG lpMsg)
Definition: atlwin.h:852
#define IDC_SEARCH_FILENAME
Definition: resource.h:162
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDC_SEARCH_QUERY
Definition: resource.h:163
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID)
Definition: CSearchBar.cpp:478
#define DispatchMessage
Definition: winuser.h:5666
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
BOOL WINAPI TranslateMessage(_In_ const MSG *)
HDWP WINAPI BeginDeferWindowPos(_In_ int)
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
UINT IsDlgButtonChecked(int nIDButton) const
Definition: atlwin.h:858
#define ERROR_SUCCESS
Definition: deptool.c:10
virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty)
Definition: CSearchBar.cpp:500
HRESULT hr
Definition: shlfolder.c:183
BOOL m_bVisible
Definition: CSearchBar.h:27
CComPtr< IAddressEditBox > m_AddressEditBox
Definition: CSearchBar.h:26
HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD *pdw)
Definition: atl.c:45
#define PBM_SETMARQUEE
Definition: commctrl.h:2195
#define IDS_SEARCHINVALID
Definition: resource.h:168
#define pt(x, y)
Definition: drawing.c:79
#define SW_HIDE
Definition: winuser.h:762
REFIID riid
Definition: precomp.h:44
_In_ BOOLEAN Create
Definition: pstypes.h:511
HRESULT CAddressEditBox_CreateInstance(REFIID riid, void **ppv)
Definition: browseui.cpp:33
#define _countof(array)
Definition: fontsub.cpp:30
#define HKEY_CURRENT_USER
Definition: winreg.h:11
HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObject, BOOL bFocus)
Definition: ordinal.c:4594
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1280
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: CSearchBar.cpp:275
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1220
#define DISPID_DOCUMENTCOMPLETE
Definition: webchild.h:61
virtual HRESULT STDMETHODCALLTYPE CloseDW(DWORD dwReserved)
Definition: CSearchBar.cpp:322
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define HWND_TOP
Definition: winuser.h:1193
#define WM_SEARCH_START
Definition: shellfind.h:29
DWORD LCID
Definition: nls.h:13
UINT_PTR WPARAM
Definition: windef.h:207
#define SWP_NOZORDER
Definition: winuser.h:1232
CWindow(HWND hWnd=NULL)
Definition: atlwin.h:271
static LPOLESTR
Definition: stg_prop.c:27
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1283
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1448
#define CB_GETCURSEL
Definition: winuser.h:1925
& rect
Definition: startmenu.cpp:1413
#define DISPID_SEARCHABORT
Definition: exdispid.h:174
WPARAM wParam
Definition: combotst.c:138
DWORD dwAttributes
Definition: vdmdbg.h:34
#define DISPATCH_METHOD
Definition: oleauto.h:1006
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
BOOL GetAddressEditBoxPath(WCHAR *szPath)
Definition: CSearchBar.cpp:248
#define SWP_NOCOPYBITS
Definition: winuser.h:1228
BOOL IsChild(const HWND hWnd) const
Definition: atlwin.h:846
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define UNIMPLEMENTED
Definition: CSearchBar.cpp:20
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
WCHAR szQuery[MAX_PATH]
Definition: shellfind.h:38
GLenum const GLfloat * params
Definition: glext.h:5645
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDC_SEARCH_BUTTON
Definition: resource.h:164
#define CBEIF_TEXT
Definition: commctrl.h:3782
virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite)
Definition: CSearchBar.cpp:393
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
Definition: shellord.c:2013
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
BOOL CheckDlgButton(int nIDButton, UINT nCheck)
Definition: atlwin.h:335
#define S_FALSE
Definition: winerror.h:2357
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:764
#define CBEM_DELETEITEM
Definition: commctrl.h:3827
#define E_INVALIDARG
Definition: ddrawi.h:101
#define DISPID_NAVIGATECOMPLETE2
Definition: webchild.h:54
#define CBEM_GETITEMW
Definition: commctrl.h:3839
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define DISPID_SEARCHCOMPLETE
Definition: exdispid.h:173
HRESULT GetSearchResultsFolder(IShellBrowser **ppShellBrowser, HWND *pHwnd, IShellFolder **ppShellFolder)
Definition: CSearchBar.cpp:111
#define CBEM_GETEDITCONTROL
Definition: commctrl.h:3829
GLuint index
Definition: glext.h:6031
#define SW_SHOW
Definition: winuser.h:769
HRESULT WINAPI IUnknown_GetClassID(IUnknown *lpUnknown, CLSID *clsid)
Definition: ordinal.c:1404
WCHAR szFileName[MAX_PATH]
Definition: shellfind.h:37
#define CB_ERR
Definition: winuser.h:2410
#define IDS_SEARCHLABEL
Definition: resource.h:121
HWND GetDlgItem(int nID)
Definition: atlwin.h:571
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow)
Definition: CSearchBar.cpp:335
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg)
Definition: CSearchBar.cpp:462
#define CBEIF_LPARAM
Definition: commctrl.h:3787
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: CSearchBar.cpp:527
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
GLsizeiptr size
Definition: glext.h:5919
#define CBEM_SETIMAGELIST
Definition: commctrl.h:3823
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define SWP_NOACTIVATE
Definition: winuser.h:1227
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:26
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
CComPtr< IUnknown > m_pSite
Definition: CSearchBar.h:25
int ShellMessageBoxW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType,...)
Definition: shellord.c:337
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_SEARCH_COMBOBOX
Definition: resource.h:166
virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize)
Definition: CSearchBar.cpp:506
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define CBEM_SETEXTENDEDSTYLE
Definition: commctrl.h:3831
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd)
Definition: CSearchBar.cpp:306
BOOL ScreenToClient(LPPOINT lpPoint) const
Definition: atlwin.h:1024
REFCLSID clsid
Definition: msctf.c:82
#define CBES_EX_NOSIZELIMIT
Definition: commctrl.h:3850
LRESULT OnSearchButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
Definition: CSearchBar.cpp:158
static const WCHAR L[]
Definition: oid.c:1250
WINE_DEFAULT_DEBUG_CHANNEL(shellfind)
#define MB_ICONERROR
Definition: winuser.h:781
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define GUID_NULL
Definition: ks.h:106
HWND m_hWnd
Definition: atlwin.h:268
#define CB_SETCURSEL
Definition: winuser.h:1943
BOOL DestroyWindow()
Definition: atlwin.h:428
UINT GetDlgItemText(int nID, LPTSTR lpStr, int nMaxCount) const
Definition: atlwin.h:583
#define BST_UNCHECKED
Definition: winuser.h:199
CSearchBar()
Definition: gui.cpp:724
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: CSearchBar.cpp:521
virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi)
Definition: CSearchBar.cpp:344
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define ERR(fmt,...)
Definition: debug.h:109
ULONG_PTR SIZE_T
Definition: typedefs.h:78
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define S_OK
Definition: intsafe.h:59
#define RegOpenKeyEx
Definition: winreg.h:520
static ATOM item
Definition: dde.c:856
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1265
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:976
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1408
LPCWSTR szPath
Definition: env.c:35
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
WCHAR szPath[MAX_PATH]
Definition: shellfind.h:36
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define E_NOTIMPL
Definition: ddrawi.h:99
virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm)
Definition: CSearchBar.cpp:494
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
Definition: pidl.c:1367
LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: CSearchBar.cpp:104
virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg)
Definition: CSearchBar.cpp:441
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcspbrk(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)
void SetSearchInProgress(BOOL bInProgress)
Definition: CSearchBar.cpp:533
unsigned int UINT
Definition: ndis.h:50
HRESULT TrySubscribeToSearchEvents()
Definition: CSearchBar.cpp:542
#define MB_OK
Definition: winuser.h:784
BOOL SearchHidden
Definition: shellfind.h:39
HWND SetParent(HWND hWndNewParent)
Definition: atlwin.h:1160
STRSAFEAPI StringCchLengthW(STRSAFE_LPCWSTR psz, size_t cchMax, size_t *pcchLength)
Definition: strsafe.h:842
HWND hwnd
Definition: winuser.h:3088
#define BST_CHECKED
Definition: winuser.h:197
#define WM_SEARCH_STOP
Definition: shellfind.h:30
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct stdole::DISPPARAMS DISPPARAMS
#define IDC_SEARCH_STOP_BUTTON
Definition: resource.h:165
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
#define SWP_NOMOVE
Definition: winuser.h:1229
#define SHIL_SMALL
Definition: shellapi.h:183
#define CB_GETCOUNT
Definition: winuser.h:1924
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDC_SEARCH_HIDDEN
Definition: resource.h:167
#define CBES_EX_CASESENSITIVE
Definition: commctrl.h:3851
#define SID_SShellBrowser
Definition: shlguid.h:125
HDWP DeferWindowPos(HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
Definition: atlwin.h:422
LONG_PTR LRESULT
Definition: windef.h:209
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
Definition: CSearchBar.cpp:314
#define E_POINTER
Definition: winerror.h:2365
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
GLuint64EXT * result
Definition: glext.h:11304
#define REG_DWORD
Definition: sdbapi.c:596
virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
Definition: CSearchBar.cpp:329
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
virtual HRESULT STDMETHODCALLTYPE IsDirty()
Definition: CSearchBar.cpp:488
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: CSearchBar.cpp:33
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
Definition: CSearchBar.cpp:515
HWND SetActiveWindow()
Definition: atlwin.h:1094
virtual HRESULT STDMETHODCALLTYPE HasFocusIO()
Definition: CSearchBar.cpp:457
virtual ~CSearchBar()
Definition: CSearchBar.cpp:29
#define SUCCEEDED(hr)
Definition: intsafe.h:57
LRESULT OnStopButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
Definition: CSearchBar.cpp:238
virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite)
Definition: CSearchBar.cpp:431
#define SWP_NOOWNERZORDER
Definition: winuser.h:1234
#define IDC_SEARCH_LABEL
Definition: resource.h:161