ReactOS 0.4.17-dev-854-gda13f3c
filedlgbrowser.c
Go to the documentation of this file.
1/*
2 * Implementation of IShellBrowser for the File Open common dialog
3 *
4 * Copyright 1999 Francois Boisvert
5 * Copyright 1999, 2000 Juergen Schmied
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include <stdarg.h>
23#include <stdio.h>
24#include <string.h>
25
26#define COBJMACROS
27#include "windef.h"
28#include "winbase.h"
29#include "winnls.h"
30#include "wingdi.h"
31#include "winuser.h"
32#include "winreg.h"
33
34#define NO_SHLWAPI_STREAM
35#include "shlwapi.h"
36#include "filedlgbrowser.h"
37#include "cdlg.h"
38#include "shlguid.h"
39#include "servprov.h"
40#include "wine/debug.h"
41#include "wine/heap.h"
42#ifdef __REACTOS__
44#endif
45
47
48typedef struct
49{
50
54 LONG ref; /* Reference counter */
55 HWND hwndOwner; /* Owner dialog of the interface */
56
58
60{
61 return CONTAINING_RECORD(iface, IShellBrowserImpl, IShellBrowser_iface);
62}
63
65{
66 return CONTAINING_RECORD(iface, IShellBrowserImpl, ICommDlgBrowser_iface);
67}
68
70{
71 return CONTAINING_RECORD(iface, IShellBrowserImpl, IServiceProvider_iface);
72}
73
74/**************************************************************************
75* vtable
76*/
77static const IShellBrowserVtbl IShellBrowserImpl_Vtbl;
78static const ICommDlgBrowserVtbl IShellBrowserImpl_ICommDlgBrowser_Vtbl;
79static const IServiceProviderVtbl IShellBrowserImpl_IServiceProvider_Vtbl;
80
81/*
82 * Helper functions
83 */
84
85#define add_flag(a) if (flags & a) {strcat(str, #a );strcat(str," ");}
86static void COMDLG32_DumpSBSPFlags(UINT uflags)
87{
88 if (TRACE_ON(commdlg))
89 {
90 unsigned int i;
91 static const struct {
92 DWORD mask;
93 const char *name;
94 } flags[] = {
95#define FE(x) { x, #x}
96 /* SBSP_DEFBROWSER == 0 */
97 FE(SBSP_SAMEBROWSER),
98 FE(SBSP_NEWBROWSER),
99
100 /* SBSP_DEFMODE == 0 */
101 FE(SBSP_OPENMODE),
102 FE(SBSP_EXPLOREMODE),
103 FE(SBSP_HELPMODE),
104 FE(SBSP_NOTRANSFERHIST),
105
106 /* SBSP_ABSOLUTE == 0 */
107 FE(SBSP_RELATIVE),
108 FE(SBSP_PARENT),
109 FE(SBSP_NAVIGATEBACK),
110 FE(SBSP_NAVIGATEFORWARD),
111 FE(SBSP_ALLOW_AUTONAVIGATE),
112
113 FE(SBSP_NOAUTOSELECT),
114 FE(SBSP_WRITENOHISTORY),
115
116 FE(SBSP_REDIRECT),
117 FE(SBSP_INITIATEDBYHLINKFRAME),
118 };
119#undef FE
120 TRACE("SBSP Flags: %08x =", uflags);
121 for (i = 0; i < ARRAY_SIZE(flags); i++)
122 if (flags[i].mask & uflags)
123 TRACE("%s ", flags[i].name);
124 TRACE("\n");
125 }
126}
127
128static void COMDLG32_UpdateCurrentDir(const FileOpenDlgInfos *fodInfos)
129{
130 LPSHELLFOLDER psfDesktop;
131 STRRET strret;
132 HRESULT res;
133
134 res = SHGetDesktopFolder(&psfDesktop);
135 if (FAILED(res))
136 return;
137
138 res = IShellFolder_GetDisplayNameOf(psfDesktop, fodInfos->ShellInfos.pidlAbsCurrent,
139 SHGDN_FORPARSING, &strret);
140 if (SUCCEEDED(res)) {
141 WCHAR wszCurrentDir[MAX_PATH];
142
143 res = StrRetToBufW(&strret, fodInfos->ShellInfos.pidlAbsCurrent, wszCurrentDir, MAX_PATH);
144 if (SUCCEEDED(res))
145 SetCurrentDirectoryW(wszCurrentDir);
146 }
147#ifdef __REACTOS__
148 DoUpdateAutoCompleteWithCWD(fodInfos, fodInfos->ShellInfos.pidlAbsCurrent);
149#endif
150
151 IShellFolder_Release(psfDesktop);
152}
153
154/* copied from shell32 to avoid linking to it */
156{
157 TRACE("dest=%p len=0x%lx strret=%p pidl=%p\n", dest , len, src, pidl);
158
159 switch (src->uType)
160 {
161 case STRRET_WSTR:
162 lstrcpynW(dest, src->pOleStr, len);
163 CoTaskMemFree(src->pOleStr);
164 break;
165
166 case STRRET_CSTR:
167 if (len && !MultiByteToWideChar( CP_ACP, 0, src->cStr, -1, dest, len ))
168 ((LPWSTR)dest)[len-1] = 0;
169 break;
170
171 case STRRET_OFFSET:
172 if (pidl)
173 {
174 if (len && !MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->uOffset,
175 -1, dest, len ))
176 ((LPWSTR)dest)[len-1] = 0;
177 }
178 break;
179
180 default:
181 FIXME("unknown type!\n");
182 if (len)
183 { *(LPWSTR)dest = '\0';
184 }
185 return(FALSE);
186 }
187 return TRUE;
188}
189
190/*
191 * IShellBrowser
192 */
193
194/**************************************************************************
195* IShellBrowserImpl_Construct
196*/
198{
199 FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwndOwner);
201
202 sb = heap_alloc(sizeof(*sb));
203
204 /* Initialisation of the member variables */
205 sb->ref=1;
206 sb->hwndOwner = hwndOwner;
207
208 /* Initialisation of the vTables */
209 sb->IShellBrowser_iface.lpVtbl = &IShellBrowserImpl_Vtbl;
210 sb->ICommDlgBrowser_iface.lpVtbl = &IShellBrowserImpl_ICommDlgBrowser_Vtbl;
211 sb->IServiceProvider_iface.lpVtbl = &IShellBrowserImpl_IServiceProvider_Vtbl;
213 &fodInfos->ShellInfos.pidlAbsCurrent);
214
215 TRACE("%p\n", sb);
216
217 return &sb->IShellBrowser_iface;
218}
219
220/***************************************************************************
221* IShellBrowserImpl_QueryInterface
222*/
224{
226
227 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObj);
228
229 *ppvObj = NULL;
230
232 *ppvObj = &This->IShellBrowser_iface;
233 else if(IsEqualIID(riid, &IID_IOleWindow))
234 *ppvObj = &This->IShellBrowser_iface;
235 else if(IsEqualIID(riid, &IID_IShellBrowser))
236 *ppvObj = &This->IShellBrowser_iface;
237 else if(IsEqualIID(riid, &IID_ICommDlgBrowser))
238 *ppvObj = &This->ICommDlgBrowser_iface;
239 else if(IsEqualIID(riid, &IID_IServiceProvider))
240 *ppvObj = &This->IServiceProvider_iface;
241
242 if(*ppvObj) {
243 IUnknown_AddRef((IUnknown*)*ppvObj);
244 return S_OK;
245 }
246
247#ifdef __REACTOS__
248 TRACE("unsupported interface, %s\n", debugstr_guid(riid));
249#else
250 FIXME("unsupported interface, %s\n", debugstr_guid(riid));
251#endif
252 return E_NOINTERFACE;
253}
254
255/**************************************************************************
256* IShellBrowser::AddRef
257*/
259{
262
263 TRACE("(%p,%lu)\n", This, ref - 1);
264
265 return ref;
266}
267
268/**************************************************************************
269* IShellBrowserImpl_Release
270*/
272{
275
276 TRACE("(%p,%lu)\n", This, ref + 1);
277
278 if (!ref)
280
281 return ref;
282}
283
284/*
285 * IOleWindow
286 */
287
288/**************************************************************************
289* IShellBrowserImpl_GetWindow (IOleWindow)
290*
291* Inherited from IOleWindow::GetWindow
292*
293* See Windows documentation for more details
294*
295* Note : We will never be window less in the File Open dialog
296*
297*/
299 HWND * phwnd)
300{
302
303 TRACE("(%p)\n", This);
304
305 if(!This->hwndOwner)
306 return E_FAIL;
307
308 *phwnd = This->hwndOwner;
309
310 return (*phwnd) ? S_OK : E_UNEXPECTED;
311
312}
313
314/**************************************************************************
315* IShellBrowserImpl_ContextSensitiveHelp
316*/
318 BOOL fEnterMode)
319{
321
322 TRACE("(%p)\n", This);
323
324 /* Feature not implemented */
325 return E_NOTIMPL;
326}
327
328/*
329 * IShellBrowser
330 */
331
332/**************************************************************************
333* IShellBrowserImpl_BrowseObject
334*
335* See Windows documentation on IShellBrowser::BrowseObject for more details
336*
337* This function will override user specified flags and will always
338* use SBSP_DEFBROWSER and SBSP_DEFMODE.
339*/
341 LPCITEMIDLIST pidl,
342 UINT wFlags)
343{
344 HRESULT hRes;
346 IShellView *psvTmp;
347 FileOpenDlgInfos *fodInfos;
348 LPITEMIDLIST pidlTmp;
349 HWND hwndView;
350 HWND hDlgWnd;
351 BOOL bViewHasFocus;
352 RECT rectView;
353
355
356 TRACE("(%p)(pidl=%p,flags=0x%08x)\n", This, pidl, wFlags);
358
359 fodInfos = get_filedlg_infoptr(This->hwndOwner);
360
361 /* Format the pidl according to its parameter's category */
362 if(wFlags & SBSP_RELATIVE)
363 {
364
365 /* SBSP_RELATIVE A relative pidl (relative from the current folder) */
366 if (FAILED(hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder,
367 pidl, NULL, &IID_IShellFolder, (void **)&folder)))
368 {
369 ERR("bind to object failed\n");
370 return hRes;
371 }
372 /* create an absolute pidl */
373 pidlTmp = ILCombine(fodInfos->ShellInfos.pidlAbsCurrent, pidl);
374 }
375 else if(wFlags & SBSP_PARENT)
376 {
377 /* Browse the parent folder (ignores the pidl) */
378 pidlTmp = GetParentPidl(fodInfos->ShellInfos.pidlAbsCurrent);
380 }
381 else /* SBSP_ABSOLUTE is 0x0000 */
382 {
383 /* An absolute pidl (relative from the desktop) */
384 pidlTmp = ILClone(pidl);
386 }
387
388 if (!folder)
389 {
390 ERR("could not browse to folder\n");
391 ILFree(pidlTmp);
392 return E_FAIL;
393 }
394
395 /* If the pidl to browse to is equal to the actual pidl ...
396 do nothing and pretend you did it*/
397 if (ILIsEqual(pidlTmp, fodInfos->ShellInfos.pidlAbsCurrent))
398 {
399 IShellFolder_Release(folder);
400 ILFree(pidlTmp);
401 TRACE("keep current folder\n");
402 return S_OK;
403 }
404
405 /* Release the current DataObject */
406 if (fodInfos->Shell.FOIDataObject)
407 {
408 IDataObject_Release(fodInfos->Shell.FOIDataObject);
409 fodInfos->Shell.FOIDataObject = NULL;
410 }
411
412 /* Create the associated view */
413 TRACE("create view object\n");
414 if (FAILED(hRes = IShellFolder_CreateViewObject(folder, fodInfos->ShellInfos.hwndOwner,
415 &IID_IShellView, (void **)&psvTmp)))
416 {
417 IShellFolder_Release(folder);
418 ILFree(pidlTmp);
419 return hRes;
420 }
421
422 /* Check if listview has focus */
423 bViewHasFocus = IsChild(fodInfos->ShellInfos.hwndView,GetFocus());
424
425 /* Get the foldersettings from the old view */
426 if(fodInfos->Shell.FOIShellView)
427 IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, &fodInfos->ShellInfos.folderSettings);
428
429 /* Release the old fodInfos->Shell.FOIShellView and update its value.
430 We have to update this early since ShellView_CreateViewWindow of native
431 shell32 calls OnStateChange and needs the correct view here.*/
432 if(fodInfos->Shell.FOIShellView)
433 {
434 IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView);
435 IShellView_Release(fodInfos->Shell.FOIShellView);
436 }
437 fodInfos->Shell.FOIShellView = psvTmp;
438
439 /* Release old FOIShellFolder and update its value */
440 if (fodInfos->Shell.FOIShellFolder)
441 IShellFolder_Release(fodInfos->Shell.FOIShellFolder);
442 fodInfos->Shell.FOIShellFolder = folder;
443
444 /* Release old pidlAbsCurrent and update its value */
445 ILFree(fodInfos->ShellInfos.pidlAbsCurrent);
446 fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp;
447
449
450 GetWindowRect(GetDlgItem(This->hwndOwner, IDC_SHELLSTATIC), &rectView);
451 MapWindowPoints(0, This->hwndOwner, (LPPOINT)&rectView, 2);
452
453 /* Create the window */
454 TRACE("create view window\n");
455 if (FAILED(hRes = IShellView_CreateViewWindow(psvTmp, NULL,
456 &fodInfos->ShellInfos.folderSettings, fodInfos->Shell.FOIShellBrowser,
457 &rectView, &hwndView)))
458 {
459 WARN("Failed to create view window, hr %#lx.\n", hRes);
460 return hRes;
461 }
462
463 fodInfos->ShellInfos.hwndView = hwndView;
464
465 /* Set view window control id to 5002 */
466 SetWindowLongPtrW(hwndView, GWLP_ID, lst2);
467 SendMessageW( hwndView, WM_SETFONT, SendMessageW( GetParent(hwndView), WM_GETFONT, 0, 0 ), FALSE );
468
469 /* Select the new folder in the Look In combo box of the Open file dialog */
470 FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent);
471
472 /* changes the tab order of the ListView to reflect the window's File Dialog */
473 hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN);
474 SetWindowPos(hwndView, hDlgWnd, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
475
476 /* Since we destroyed the old view if it had focus set focus to the newly created view */
477 if (bViewHasFocus)
478 SetFocus(fodInfos->ShellInfos.hwndView);
479
480 return hRes;
481}
482
483/**************************************************************************
484* IShellBrowserImpl_EnableModelessSB
485*/
487 BOOL fEnable)
488
489{
491
492 TRACE("(%p)\n", This);
493
494 /* Feature not implemented */
495 return E_NOTIMPL;
496}
497
498/**************************************************************************
499* IShellBrowserImpl_GetControlWindow
500*/
502 UINT id,
503 HWND *lphwnd)
504
505{
507
508 TRACE("(%p)\n", This);
509
510 /* Feature not implemented */
511 return E_NOTIMPL;
512}
513
514/**************************************************************************
515* IShellBrowserImpl_GetViewStateStream
516*/
518 DWORD grfMode,
519 LPSTREAM *ppStrm)
520
521{
523
524 FIXME("(%p 0x%08lx %p)\n", This, grfMode, ppStrm);
525
526 /* Feature not implemented */
527 return E_NOTIMPL;
528}
529
530/**************************************************************************
531* IShellBrowserImpl_InsertMenusSB
532*/
534 HMENU hmenuShared,
535 LPOLEMENUGROUPWIDTHS lpMenuWidths)
536
537{
539
540 TRACE("(%p)\n", This);
541
542 /* Feature not implemented */
543 return E_NOTIMPL;
544}
545
546/**************************************************************************
547* IShellBrowserImpl_OnViewWindowActive
548*/
550 IShellView *ppshv)
551
552{
554
555 TRACE("(%p)\n", This);
556
557 /* Feature not implemented */
558 return E_NOTIMPL;
559}
560
561/**************************************************************************
562* IShellBrowserImpl_QueryActiveShellView
563*/
565 IShellView **ppshv)
566
567{
569
570 FileOpenDlgInfos *fodInfos;
571
572 TRACE("(%p)\n", This);
573
574 fodInfos = get_filedlg_infoptr(This->hwndOwner);
575
576 if(!(*ppshv = fodInfos->Shell.FOIShellView))
577 {
578 return E_FAIL;
579 }
580 IShellView_AddRef(fodInfos->Shell.FOIShellView);
581 return NOERROR;
582}
583
584/**************************************************************************
585* IShellBrowserImpl_RemoveMenusSB
586*/
588 HMENU hmenuShared)
589
590{
592
593 TRACE("(%p)\n", This);
594
595 /* Feature not implemented */
596 return E_NOTIMPL;
597}
598
599/**************************************************************************
600* IShellBrowserImpl_SendControlMsg
601*/
603 UINT id,
604 UINT uMsg,
607 LRESULT *pret)
608
609{
611 LRESULT lres;
612
613 TRACE("(%p)->(0x%08x 0x%08x 0x%08Ix 0x%08Ix %p)\n", This, id, uMsg, wParam, lParam, pret);
614
615 switch (id)
616 {
617 case FCW_TOOLBAR:
618 lres = SendDlgItemMessageA( This->hwndOwner, IDC_TOOLBAR, uMsg, wParam, lParam);
619 break;
620 default:
621#ifdef __REACTOS__
622 TRACE("ctrl id: %x\n", id);
623#else
624 FIXME("ctrl id: %x\n", id);
625#endif
626 return E_NOTIMPL;
627 }
628 if (pret) *pret = lres;
629 return S_OK;
630}
631
632/**************************************************************************
633* IShellBrowserImpl_SetMenuSB
634*/
636 HMENU hmenuShared,
637 HOLEMENU holemenuReserved,
638 HWND hwndActiveObject)
639
640{
642
643 TRACE("(%p)\n", This);
644
645 /* Feature not implemented */
646 return E_NOTIMPL;
647}
648
649/**************************************************************************
650* IShellBrowserImpl_SetStatusTextSB
651*/
653 LPCOLESTR lpszStatusText)
654
655{
657
658 TRACE("(%p)\n", This);
659
660 /* Feature not implemented */
661 return E_NOTIMPL;
662}
663
664/**************************************************************************
665* IShellBrowserImpl_SetToolbarItems
666*/
668 LPTBBUTTON lpButtons,
669 UINT nButtons,
670 UINT uFlags)
671
672{
674
675 TRACE("(%p)\n", This);
676
677 /* Feature not implemented */
678 return E_NOTIMPL;
679}
680
681/**************************************************************************
682* IShellBrowserImpl_TranslateAcceleratorSB
683*/
685 LPMSG lpmsg,
686 WORD wID)
687
688{
690
691 TRACE("(%p)\n", This);
692
693 /* Feature not implemented */
694 return E_NOTIMPL;
695}
696
697static const IShellBrowserVtbl IShellBrowserImpl_Vtbl =
698{
699 /* IUnknown */
703 /* IOleWindow */
706 /* IShellBrowser */
720};
721
722
723
724/*
725 * ICommDlgBrowser
726 */
727
728/***************************************************************************
729* IShellBrowserImpl_ICommDlgBrowser_QueryInterface
730*/
732 ICommDlgBrowser *iface,
733 REFIID riid,
734 LPVOID *ppvObj)
735{
737
738 TRACE("(%p)\n", This);
739
740 return IShellBrowserImpl_QueryInterface(&This->IShellBrowser_iface,riid,ppvObj);
741}
742
743/**************************************************************************
744* IShellBrowserImpl_ICommDlgBrowser_AddRef
745*/
747{
749
750 TRACE("(%p)\n", This);
751
752 return IShellBrowserImpl_AddRef(&This->IShellBrowser_iface);
753}
754
755/**************************************************************************
756* IShellBrowserImpl_ICommDlgBrowser_Release
757*/
759{
761
762 TRACE("(%p)\n", This);
763
764 return IShellBrowserImpl_Release(&This->IShellBrowser_iface);
765}
766
767/**************************************************************************
768* IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand
769*
770* Called when a user double-clicks in the view or presses the ENTER key
771*/
773 IShellView *ppshv)
774{
775 LPITEMIDLIST pidl;
776 FileOpenDlgInfos *fodInfos;
777
779
780 TRACE("(%p)\n", This);
781
782 fodInfos = get_filedlg_infoptr(This->hwndOwner);
783
784 /* If the selected object is not a folder, send an IDOK command to parent window */
785 if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1)))
786 {
787 HRESULT hRes;
788
789#ifdef __REACTOS__
790 ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR;
791#else
792 ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
793#endif
794 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, (LPCITEMIDLIST *)&pidl, &ulAttr);
795#ifdef __REACTOS__
796 if ((ulAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER)) && (ulAttr & SFGAO_FILESYSANCESTOR))
797#else
798 if (ulAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER) )
799#endif
800 {
801 hRes = IShellBrowser_BrowseObject(&This->IShellBrowser_iface,pidl,SBSP_RELATIVE);
802 if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
804 }
805 else
806 {
807 /* Tell the dialog that the user selected a file */
808 PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L);
809 hRes = S_OK;
810 }
811
812 ILFree(pidl);
813
814 return hRes;
815 }
816
817 return E_FAIL;
818}
819
820/**************************************************************************
821* IShellBrowserImpl_OnSelChange
822*/
824{
825 FileOpenDlgInfos *fodInfos;
826
827 fodInfos = get_filedlg_infoptr(This->hwndOwner);
828 TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView);
829
830 /* release old selections */
831 if (fodInfos->Shell.FOIDataObject)
832 IDataObject_Release(fodInfos->Shell.FOIDataObject);
833
834 /* get a new DataObject from the ShellView */
835 if(FAILED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, SVGIO_SELECTION,
836 &IID_IDataObject, (void**)&fodInfos->Shell.FOIDataObject)))
837 return E_FAIL;
838
840
841 if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
843 return S_OK;
844}
845
846/**************************************************************************
847* IShellBrowserImpl_ICommDlgBrowser_OnStateChange
848*/
850 IShellView *ppshv,
851 ULONG uChange)
852{
853
855
856 TRACE("(%p shv=%p)\n", This, ppshv);
857
858 switch (uChange)
859 {
860 case CDBOSC_SETFOCUS:
861 /* FIXME: Reset the default button.
862 This should be taken care of by defdlg. If control
863 other than button receives focus the default button
864 should be restored. */
865 SendMessageA(This->hwndOwner, DM_SETDEFID, IDOK, 0);
866
867 break;
868 case CDBOSC_KILLFOCUS:
869 {
870 FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(This->hwndOwner);
871 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
872 {
873 WCHAR szSave[16];
875 SetDlgItemTextW(fodInfos->ShellInfos.hwndOwner, IDOK, szSave);
876 }
877 }
878 break;
879 case CDBOSC_SELCHANGE:
880 return IShellBrowserImpl_OnSelChange(This, ppshv);
881 case CDBOSC_RENAME:
882 /* nothing to do */
883 break;
884 }
885
886 return NOERROR;
887}
888
889/* send_includeitem_notification
890 *
891 * Sends a CDN_INCLUDEITEM notification for "pidl" to hwndParentDlg
892 */
894{
895 LRESULT hook_result = 0;
896 FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwndParentDlg);
897
898 if(!fodInfos) return 0;
899
900 if(fodInfos->DlgInfos.hwndCustomDlg)
901 {
902 TRACE("call notify CDN_INCLUDEITEM for pidl=%p\n", pidl);
903 if(fodInfos->unicode)
904 {
905 OFNOTIFYEXW ofnNotify;
906 ofnNotify.psf = fodInfos->Shell.FOIShellFolder;
907 ofnNotify.pidl = (LPITEMIDLIST)pidl;
908 ofnNotify.hdr.hwndFrom = hwndParentDlg;
909 ofnNotify.hdr.idFrom = 0;
910 ofnNotify.hdr.code = CDN_INCLUDEITEM;
911 ofnNotify.lpOFN = fodInfos->ofnInfos;
912 hook_result = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
913 }
914 else
915 {
916 OFNOTIFYEXA ofnNotify;
917 ofnNotify.psf = fodInfos->Shell.FOIShellFolder;
918 ofnNotify.pidl = (LPITEMIDLIST)pidl;
919 ofnNotify.hdr.hwndFrom = hwndParentDlg;
920 ofnNotify.hdr.idFrom = 0;
921 ofnNotify.hdr.code = CDN_INCLUDEITEM;
922 ofnNotify.lpOFN = (LPOPENFILENAMEA)fodInfos->ofnInfos;
923 hook_result = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
924 }
925 }
926 TRACE("Retval: 0x%08Ix\n", hook_result);
927 return hook_result;
928}
929
930/**************************************************************************
931* IShellBrowserImpl_ICommDlgBrowser_IncludeObject
932*/
934 IShellView * ppshv,
935 LPCITEMIDLIST pidl)
936{
937 FileOpenDlgInfos *fodInfos;
938 ULONG ulAttr;
939 STRRET str;
940 WCHAR szPathW[MAX_PATH];
941
943
944 TRACE("(%p)\n", This);
945
946 fodInfos = get_filedlg_infoptr(This->hwndOwner);
947
948 ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK;
949 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
950
951 if( (ulAttr & SFGAO_HIDDEN) || /* hidden */
952 !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */
953 return S_FALSE;
954
955 /* always include directories and links */
956 if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK))
957 return S_OK;
958
959 /* if the application takes care of including the item we are done */
960 if(fodInfos->ofnInfos->Flags & OFN_ENABLEINCLUDENOTIFY &&
961 send_includeitem_notification(This->hwndOwner, pidl))
962 return S_OK;
963
964 /* Check if there is a mask to apply if not */
965 if(!fodInfos->ShellInfos.lpstrCurrentFilter || !fodInfos->ShellInfos.lpstrCurrentFilter[0])
966 return S_OK;
967
968 if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER | SHGDN_FORPARSING, &str)))
969 {
970 if (COMDLG32_StrRetToStrNW(szPathW, MAX_PATH, &str, pidl))
971 {
972 if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
973 return S_OK;
974 }
975 }
976 return S_FALSE;
977
978}
979
980static const ICommDlgBrowserVtbl IShellBrowserImpl_ICommDlgBrowser_Vtbl =
981{
982 /* IUnknown */
986 /* ICommDlgBrowser */
990};
991
992
993
994
995/*
996 * IServiceProvider
997 */
998
999/***************************************************************************
1000* IShellBrowserImpl_IServiceProvider_QueryInterface
1001*/
1003 IServiceProvider *iface,
1004 REFIID riid,
1005 LPVOID *ppvObj)
1006{
1008
1009 FIXME("(%p)\n", This);
1010
1011 return IShellBrowserImpl_QueryInterface(&This->IShellBrowser_iface,riid,ppvObj);
1012}
1013
1014/**************************************************************************
1015* IShellBrowserImpl_IServiceProvider_AddRef
1016*/
1018{
1020
1021 FIXME("(%p)\n", This);
1022
1023 return IShellBrowserImpl_AddRef(&This->IShellBrowser_iface);
1024}
1025
1026/**************************************************************************
1027* IShellBrowserImpl_IServiceProvider_Release
1028*/
1030{
1032
1033 FIXME("(%p)\n", This);
1034
1035 return IShellBrowserImpl_Release(&This->IShellBrowser_iface);
1036}
1037
1038/**************************************************************************
1039* IShellBrowserImpl_IServiceProvider_Release
1040*
1041* NOTES
1042* the w2k shellview asks for (guidService = SID_STopLevelBrowser,
1043* riid = IShellBrowser) to call SendControlMsg ().
1044*
1045* FIXME
1046* this is a hack!
1047*/
1048
1050 IServiceProvider * iface,
1051 REFGUID guidService,
1052 REFIID riid,
1053 void** ppv)
1054{
1056
1057 FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
1058
1059 *ppv = NULL;
1060 if(guidService && IsEqualIID(guidService, &SID_STopLevelBrowser))
1061 return IShellBrowserImpl_QueryInterface(&This->IShellBrowser_iface,riid,ppv);
1062
1063 FIXME("(%p) unknown interface requested\n", This);
1064 return E_NOINTERFACE;
1065
1066}
1067
1068static const IServiceProviderVtbl IShellBrowserImpl_IServiceProvider_Vtbl =
1069{
1070 /* IUnknown */
1074 /* IServiceProvider */
1076};
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define EXTERN_C
Definition: basetyps.h:12
const GUID IID_IUnknown
HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42
#define IDS_SAVE_BUTTON
Definition: cdlg.h:156
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
EXTERN_C HRESULT DoUpdateAutoCompleteWithCWD(const FileOpenDlgInfos *info, LPCITEMIDLIST pidl)
Definition: autocomp.cpp:63
#define OFN_EXPLORER
Definition: commdlg.h:104
#define CDN_SELCHANGE
Definition: commdlg.h:34
struct tagOFNA * LPOPENFILENAMEA
#define OFN_ENABLEINCLUDENOTIFY
Definition: commdlg.h:100
#define CDN_INCLUDEITEM
Definition: commdlg.h:40
#define CDN_FOLDERCHANGE
Definition: commdlg.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define lst2
Definition: dlgs.h:101
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT uFlags
Definition: api.c:59
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl)
Definition: filedlg.c:4600
void FILEDLG95_FILENAME_FillFromSelection(HWND hwnd)
Definition: filedlg.c:4319
FileOpenDlgInfos * get_filedlg_infoptr(HWND hwnd)
Definition: filedlg.c:218
IShellFolder * GetShellFolderFromPidl(LPITEMIDLIST pidlAbs)
Definition: filedlg.c:4572
LRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode)
Definition: filedlg.c:1074
LPITEMIDLIST GetPidlFromDataObject(IDataObject *doSelected, UINT nPidlIndex)
Definition: filedlg.c:4477
int FILEDLG95_LOOKIN_SelectItem(HWND hwnd, LPITEMIDLIST pidl)
Definition: filedlg.c:4165
#define CP_ACP
Definition: compat.h:109
#define TRACE_ON(x)
Definition: compat.h:75
#define MAX_PATH
Definition: compat.h:34
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrcpynW
Definition: compat.h:738
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2168
BOOL WINAPI PathMatchSpecW(const WCHAR *path, const WCHAR *mask)
Definition: path.c:2497
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3385
HRESULT WINAPI StrRetToBufW(LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
Definition: string.c:248
#define IShellFolder_GetDisplayNameOf
Definition: utils.cpp:13
#define L(x)
Definition: resources.c:13
superblock * sb
Definition: btrfs.c:4261
static HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface, LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags)
static const ICommDlgBrowserVtbl IShellBrowserImpl_ICommDlgBrowser_Vtbl
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowser *iface, IShellView *ppshv)
static const IShellBrowserVtbl IShellBrowserImpl_Vtbl
static LRESULT send_includeitem_notification(HWND hwndParentDlg, LPCITEMIDLIST pidl)
static HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface, UINT id, HWND *lphwnd)
static ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser *iface)
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser *iface)
static HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface, REFIID riid, void **ppvObj)
static HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret)
static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider *iface)
static HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser *iface, BOOL fEnterMode)
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider *iface)
static HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface, BOOL fEnable)
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, IShellView *ppshv, LPCITEMIDLIST pidl)
static BOOL COMDLG32_StrRetToStrNW(LPVOID dest, DWORD len, LPSTRRET src, LPCITEMIDLIST pidl)
static HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface, HMENU hmenuShared)
static HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, LPCITEMIDLIST pidl, UINT wFlags)
static HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser *iface)
static void COMDLG32_UpdateCurrentDir(const FileOpenDlgInfos *fodInfos)
#define FE(x)
static HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface, HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject)
static HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface, IShellView *ppshv)
static IShellBrowserImpl * impl_from_ICommDlgBrowser(ICommDlgBrowser *iface)
static HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface, DWORD grfMode, LPSTREAM *ppStrm)
static IShellBrowserImpl * impl_from_IShellBrowser(IShellBrowser *iface)
static ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser *iface)
static HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface, LPCOLESTR lpszStatusText)
static HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface, IShellView **ppshv)
static const IServiceProviderVtbl IShellBrowserImpl_IServiceProvider_Vtbl
static HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser *iface, HWND *phwnd)
static HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface, LPMSG lpmsg, WORD wID)
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(ICommDlgBrowser *iface, REFIID riid, LPVOID *ppvObj)
static IShellBrowserImpl * impl_from_IServiceProvider(IServiceProvider *iface)
static HRESULT IShellBrowserImpl_OnSelChange(IShellBrowserImpl *This, const IShellView *ppshv)
static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *iface, IShellView *ppshv, ULONG uChange)
static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, LPVOID *ppvObj)
static void COMDLG32_DumpSBSPFlags(UINT uflags)
#define FODPROP_SAVEDLG
#define IDC_SHELLSTATIC
#define IDC_LOOKIN
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
GLenum src
Definition: glext.h:6340
GLenum GLint GLuint mask
Definition: glext.h:6028
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
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
unsigned int UINT
Definition: sysinfo.c:13
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
UINT_PTR WPARAM
Definition: minwindef.h:174
static char * dest
Definition: rtl.c:149
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
interface IStream * LPSTREAM
Definition: objfwd.h:10
const GUID IID_IOleWindow
const GUID IID_IDataObject
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:238
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1051
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:817
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:583
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define WM_NOTIFY
Definition: richedit.h:61
const WCHAR * str
#define LoadStringW
Definition: utils.h:64
#define CSIDL_DESKTOP
Definition: shlobj.h:2191
static IShellBrowser * IShellBrowserImpl_Construct(void)
Definition: shlview.c:278
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
@ STRRET_CSTR
Definition: shtypes.idl:87
@ STRRET_OFFSET
Definition: shtypes.idl:86
@ STRRET_WSTR
Definition: shtypes.idl:85
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define TRACE(s)
Definition: solgame.cpp:4
struct FileOpenDlgInfos::@347 DlgInfos
struct FileOpenDlgInfos::@346 ShellInfos
LPOPENFILENAMEW ofnInfos
struct FileOpenDlgInfos::@345 Shell
IServiceProvider IServiceProvider_iface
ICommDlgBrowser ICommDlgBrowser_iface
IShellBrowser IShellBrowser_iface
Definition: scsiwmi.h:51
LPVOID psf
Definition: commdlg.h:420
NMHDR hdr
Definition: commdlg.h:418
LPVOID pidl
Definition: commdlg.h:421
LPOPENFILENAMEA lpOFN
Definition: commdlg.h:419
LPVOID pidl
Definition: commdlg.h:429
LPVOID psf
Definition: commdlg.h:428
LPOPENFILENAMEW lpOFN
Definition: commdlg.h:427
NMHDR hdr
Definition: commdlg.h:426
Definition: fci.c:112
Definition: name.c:39
Definition: send.c:48
UINT_PTR idFrom
Definition: winuser.h:3266
UINT code
Definition: winuser.h:3267
HWND hwndFrom
Definition: winuser.h:3265
DWORD Flags
Definition: commdlg.h:373
const char * LPCSTR
Definition: typedefs.h:52
uint16_t * LPWSTR
Definition: typedefs.h:56
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
#define NOERROR
Definition: winerror.h:3448
#define E_UNEXPECTED
Definition: winerror.h:3528
HWND WINAPI GetFocus(void)
Definition: window.c:1887
#define DM_SETDEFID
Definition: winuser.h:2135
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1255
#define WM_COMMAND
Definition: winuser.h:1768
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define SWP_NOSIZE
Definition: winuser.h:1256
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define WM_GETFONT
Definition: winuser.h:1679
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1678
HWND WINAPI GetParent(_In_ HWND)
#define GWLP_ID
Definition: winuser.h:871
#define SetWindowLongPtrW
Definition: winuser.h:5512
LRESULT WINAPI SendDlgItemMessageA(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_TOOLBAR
Definition: wordpad.h:157