[SHELL32]
[reactos.git] / reactos / dll / win32 / shell32 / undocshell.h
1 /*
2 * Copyright 1999, 2000 Juergen Schmied
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #ifndef __WINE_UNDOCSHELL_H
20 #define __WINE_UNDOCSHELL_H
21
22 #include <stdarg.h>
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "commctrl.h"
28 #include "shlobj.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* defined(__cplusplus) */
33
34 /****************************************************************************
35 * IDList Functions
36 */
37 BOOL WINAPI ILGetDisplayName(
38 LPCITEMIDLIST pidl,
39 LPVOID path);
40
41 /* type parameter for ILGetDisplayNameEx() */
42 #define ILGDN_FORPARSING 0
43 #define ILGDN_NORMAL 1
44 #define ILGDN_INFOLDER 2
45
46 BOOL WINAPI ILGetDisplayNameEx(
47 LPSHELLFOLDER psf,
48 LPCITEMIDLIST pidl,
49 LPVOID path,
50 DWORD type);
51
52 LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl);
53 void WINAPI ILGlobalFree(LPITEMIDLIST pidl);
54 LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); //FIXME
55 LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath);
56
57 HRESULT WINAPI SHILCreateFromPathA (
58 LPCSTR path,
59 LPITEMIDLIST * ppidl,
60 DWORD *attributes);
61
62 HRESULT WINAPI SHILCreateFromPathW (
63 LPCWSTR path,
64 LPITEMIDLIST * ppidl,
65 DWORD *attributes);
66
67 /*
68 string functions
69 */
70 BOOL WINAPI StrRetToStrNA(LPSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
71 BOOL WINAPI StrRetToStrNW(LPWSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
72
73
74 /****************************************************************************
75 * SHChangeNotifyRegister API
76 */
77 #define SHCNRF_InterruptLevel 0x0001
78 #define SHCNRF_ShellLevel 0x0002
79 #define SHCNRF_RecursiveInterrupt 0x1000 /* Must be combined with SHCNRF_InterruptLevel */
80 #define SHCNRF_NewDelivery 0x8000 /* Messages use shared memory */
81
82
83 /****************************************************************************
84 * Shell Common Dialogs
85 */
86
87 /* RunFileDlg flags */
88 #define RFF_NOBROWSE 0x01
89 #define RFF_NODEFAULT 0x02
90 #define RFF_CALCDIRECTORY 0x04
91 #define RFF_NOLABEL 0x08
92 #define RFF_NOSEPARATEMEM 0x20 /* NT only */
93
94 #define DE_SAMEFILE 0x71
95
96 /* RunFileFlg notification structure */
97 typedef struct
98 {
99 NMHDR hdr;
100 LPCSTR lpFile;
101 LPCSTR lpDirectory;
102 int nShow;
103 } NM_RUNFILEDLG, * LPNM_RUNFILEDLG;
104
105 /* RunFileDlg notification return values */
106 #define RF_OK 0x00
107 #define RF_CANCEL 0x01
108 #define RF_RETRY 0x02
109
110 void WINAPI RunFileDlg(
111 HWND hwndOwner,
112 HICON hIcon,
113 LPCWSTR lpstrDirectory,
114 LPCWSTR lpstrTitle,
115 LPCWSTR lpstrDescription,
116 UINT uFlags);
117
118 void WINAPI ExitWindowsDialog(HWND hwndOwner);
119
120 BOOL WINAPI SHFindComputer(
121 LPCITEMIDLIST pidlRoot,
122 LPCITEMIDLIST pidlSavedSearch);
123
124 void WINAPI SHHandleDiskFull(HWND hwndOwner,
125 UINT uDrive);
126
127 int WINAPI SHOutOfMemoryMessageBox(
128 HWND hwndOwner,
129 LPCSTR lpCaption,
130 UINT uType);
131
132 DWORD WINAPI SHNetConnectionDialog(
133 HWND hwndOwner,
134 LPCWSTR lpstrRemoteName,
135 DWORD dwType);
136
137 /****************************************************************************
138 * Cabinet Window Messages
139 */
140
141 #define CWM_SETPATH (WM_USER + 2)
142 #define CWM_WANTIDLE (WM_USER + 3)
143 #define CWM_GETSETCURRENTINFO (WM_USER + 4)
144 #define CWM_SELECTITEM (WM_USER + 5)
145 #define CWM_SELECTITEMSTR (WM_USER + 6)
146 #define CWM_GETISHELLBROWSER (WM_USER + 7)
147 #define CWM_TESTPATH (WM_USER + 9)
148 #define CWM_STATECHANGE (WM_USER + 10)
149 #define CWM_GETPATH (WM_USER + 12)
150
151 /* CWM_TESTPATH types */
152 #define CWTP_ISEQUAL 0
153 #define CWTP_ISCHILD 1
154
155 /* CWM_TESTPATH structure */
156 typedef struct
157 {
158 DWORD dwType;
159 ITEMIDLIST idl;
160 } CWTESTPATHSTRUCT,* LPCWTESTPATHSTRUCT;
161
162 /****************************************************************************
163 * System Imagelist Routines
164 */
165
166 int WINAPI Shell_GetCachedImageIndexA(
167 LPCSTR lpszFileName,
168 int nIconIndex,
169 UINT bSimulateDoc);
170
171 BOOL WINAPI Shell_GetImageLists(
172 HIMAGELIST *lphimlLarge,
173 HIMAGELIST *lphimlSmall);
174
175 HICON WINAPI SHGetFileIcon(
176 DWORD dwReserved,
177 LPCSTR lpszPath,
178 DWORD dwFileAttributes,
179 UINT uFlags);
180
181 BOOL WINAPI FileIconInit(BOOL bFullInit);
182
183 /****************************************************************************
184 * File Menu Routines
185 */
186 /* FileMenu_Create nSelHeight constants */
187 #define FM_DEFAULT_SELHEIGHT -1
188 #define FM_FULL_SELHEIGHT 0
189
190 /* FileMenu_Create flags */
191 #define FMF_SMALL_ICONS 0x00
192 #define FMF_LARGE_ICONS 0x08
193 #define FMF_NO_COLUMN_BREAK 0x10
194
195 HMENU WINAPI FileMenu_Create(
196 COLORREF crBorderColor,
197 int nBorderWidth,
198 HBITMAP hBorderBmp,
199 int nSelHeight,
200 UINT uFlags);
201
202 void WINAPI FileMenu_Destroy(HMENU hMenu);
203
204 /* FileMenu_AppendItem constants */
205 #define FM_SEPARATOR (LPCSTR)1
206 #define FM_BLANK_ICON -1
207 #define FM_DEFAULT_HEIGHT 0
208
209 BOOL WINAPI FileMenu_AppendItem(
210 HMENU hMenu,
211 LPCSTR lpszText,
212 UINT uID,
213 int iIcon,
214 HMENU hMenuPopup,
215 int nItemHeight);
216
217 /* FileMenu_InsertUsingPidl flags */
218 #define FMF_NO_EMPTY_ITEM 0x01
219 #define FMF_NO_PROGRAM_GROUPS 0x04
220
221 /* FileMenu_InsertUsingPidl callback function */
222 typedef void (CALLBACK *LPFNFMCALLBACK)(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlFile);
223
224 int WINAPI FileMenu_InsertUsingPidl(
225 HMENU hMenu,
226 UINT uID,
227 LPCITEMIDLIST pidl,
228 UINT uFlags,
229 UINT uEnumFlags,
230 LPFNFMCALLBACK lpfnCallback);
231
232 int WINAPI FileMenu_ReplaceUsingPidl(
233 HMENU hMenu,
234 UINT uID,
235 LPCITEMIDLIST pidl,
236 UINT uEnumFlags,
237 LPFNFMCALLBACK lpfnCallback);
238
239 void WINAPI FileMenu_Invalidate(HMENU hMenu);
240
241 HMENU WINAPI FileMenu_FindSubMenuByPidl(
242 HMENU hMenu,
243 LPCITEMIDLIST pidl);
244
245 BOOL WINAPI FileMenu_TrackPopupMenuEx(
246 HMENU hMenu,
247 UINT uFlags,
248 int x,
249 int y,
250 HWND hWnd,
251 LPTPMPARAMS lptpm);
252
253 BOOL WINAPI FileMenu_GetLastSelectedItemPidls(
254 UINT uReserved,
255 LPCITEMIDLIST *ppidlFolder,
256 LPCITEMIDLIST *ppidlItem);
257
258 LRESULT WINAPI FileMenu_MeasureItem(
259 HWND hWnd,
260 LPMEASUREITEMSTRUCT lpmis);
261
262 LRESULT WINAPI FileMenu_DrawItem(
263 HWND hWnd,
264 LPDRAWITEMSTRUCT lpdis);
265
266 BOOL WINAPI FileMenu_InitMenuPopup(HMENU hMenu);
267
268 void WINAPI FileMenu_AbortInitMenu(void);
269
270 LRESULT WINAPI FileMenu_HandleMenuChar(
271 HMENU hMenu,
272 WPARAM wParam);
273
274 BOOL WINAPI FileMenu_DeleteAllItems(HMENU hMenu);
275
276 BOOL WINAPI FileMenu_DeleteItemByCmd(
277 HMENU hMenu,
278 UINT uID);
279
280 BOOL WINAPI FileMenu_DeleteItemByIndex(
281 HMENU hMenu,
282 UINT uPos);
283
284 BOOL WINAPI FileMenu_DeleteMenuItemByFirstID(
285 HMENU hMenu,
286 UINT uID);
287
288 BOOL WINAPI FileMenu_DeleteSeparator(HMENU hMenu);
289
290 BOOL WINAPI FileMenu_EnableItemByCmd(
291 HMENU hMenu,
292 UINT uID,
293 BOOL bEnable);
294
295 DWORD WINAPI FileMenu_GetItemExtent(
296 HMENU hMenu,
297 UINT uPos);
298
299 int WINAPI FileMenu_AppendFilesForPidl(
300 HMENU hMenu,
301 LPCITEMIDLIST pidl,
302 BOOL bAddSeparator);
303
304 int WINAPI FileMenu_AddFilesForPidl(
305 HMENU hMenu,
306 UINT uReserved,
307 UINT uID,
308 LPCITEMIDLIST pidl,
309 UINT uFlags,
310 UINT uEnumFlags,
311 LPFNFMCALLBACK lpfnCallback);
312
313 /****************************************************************************
314 * Drag And Drop Routines
315 */
316
317 HRESULT WINAPI SHRegisterDragDrop(
318 HWND hWnd,
319 LPDROPTARGET lpDropTarget);
320
321 HRESULT WINAPI SHRevokeDragDrop(HWND hWnd);
322
323 BOOL WINAPI DAD_DragEnter(HWND hWnd);
324
325 BOOL WINAPI DAD_SetDragImageFromListView(
326 HWND hWnd,
327 POINT pt);
328
329 BOOL WINAPI DAD_ShowDragImage(BOOL bShow);
330
331 /****************************************************************************
332 * Path Manipulation Routines
333 */
334
335 BOOL WINAPI PathAppendAW(LPVOID lpszPath1, LPCVOID lpszPath2);
336
337 LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile);
338
339 LPVOID WINAPI PathAddBackslashAW(LPVOID path);
340
341 LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive);
342
343 LPVOID WINAPI PathFindExtensionAW(LPCVOID path);
344
345 LPVOID WINAPI PathFindFileNameAW(LPCVOID path);
346
347 LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath, DWORD void1, DWORD void2);
348
349 LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath);
350
351 BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath);
352
353 void WINAPI PathRemoveBlanksAW(LPVOID lpszPath);
354
355 VOID WINAPI PathQuoteSpacesAW(LPVOID path);
356
357 void WINAPI PathUnquoteSpacesAW(LPVOID lpszPath);
358
359 BOOL WINAPI PathIsUNCAW(LPCVOID lpszPath);
360
361 BOOL WINAPI PathIsRelativeAW(LPCVOID lpszPath);
362
363 BOOL WINAPI PathIsRootAW(LPCVOID x);
364
365 BOOL WINAPI PathIsExeAW(LPCVOID lpszPath);
366
367 BOOL WINAPI PathIsDirectoryAW(LPCVOID lpszPath);
368
369 BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath);
370
371 BOOL WINAPI PathMatchSpecAW(LPVOID lpszPath, LPVOID lpszSpec);
372
373 BOOL WINAPI PathMakeUniqueNameAW(
374 LPVOID lpszBuffer,
375 DWORD dwBuffSize,
376 LPCVOID lpszShortName,
377 LPCVOID lpszLongName,
378 LPCVOID lpszPathName);
379
380 BOOL WINAPI PathYetAnotherMakeUniqueName(
381 LPWSTR lpszBuffer,
382 LPCWSTR lpszPathName,
383 LPCWSTR lpszShortName,
384 LPCWSTR lpszLongName);
385
386 BOOL WINAPI PathQualifyA(LPCSTR path);
387 BOOL WINAPI PathQualifyW(LPCWSTR path);
388 #define PathQualify WINELIB_NAME_AW(PathQualify)
389 BOOL WINAPI PathQualifyAW(LPCVOID path);
390
391
392 /* PathResolve flags */
393 #define PRF_CHECKEXISTANCE 0x01
394 #define PRF_EXECUTABLE 0x02
395 #define PRF_QUALIFYONPATH 0x04
396 #define PRF_WINDOWS31 0x08
397
398 BOOL WINAPI PathResolveAW(LPVOID lpszPath, LPCVOID *alpszPaths, DWORD dwFlags);
399
400 VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath);
401
402 /* PathProcessCommand flags */
403 #define PPCF_QUOTEPATH 0x01 /* implies PPCF_INCLUDEARGS */
404 #define PPCF_INCLUDEARGS 0x02
405 //#define PPCF_NODIRECTORIES 0x10 move to shlobj
406 #define PPCF_DONTRESOLVE 0x20
407 #define PPCF_PATHISRELATIVE 0x40
408
409 HRESULT WINAPI PathProcessCommandAW(LPCVOID lpszPath, LPVOID lpszBuff,
410 DWORD dwBuffSize, DWORD dwFlags);
411
412 void WINAPI PathStripPathAW(LPVOID lpszPath);
413
414 BOOL WINAPI PathStripToRootAW(LPVOID lpszPath);
415
416 void WINAPI PathRemoveArgsAW(LPVOID lpszPath);
417
418 void WINAPI PathRemoveExtensionAW(LPVOID lpszPath);
419
420 int WINAPI PathParseIconLocationAW(LPVOID lpszPath);
421
422 BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2);
423
424 BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID *sOtherDirs);
425
426 /****************************************************************************
427 * Shell Namespace Routines
428 */
429
430 /* Generic structure used by several messages */
431 typedef struct
432 {
433 DWORD dwReserved;
434 DWORD dwReserved2;
435 LPCITEMIDLIST pidl;
436 LPDWORD lpdwUser;
437 } SFVCBINFO, * LPSFVCBINFO;
438 typedef const SFVCBINFO * LPCSFVCBINFO;
439
440 /* SFVCB_SELECTIONCHANGED structure */
441 typedef struct
442 {
443 UINT uOldState;
444 UINT uNewState;
445 LPCITEMIDLIST pidl;
446 LPDWORD lpdwUser;
447 } SFVSELECTSTATE, * LPSFVSELECTSTATE;
448 typedef const SFVSELECTSTATE * LPCSFVSELECTSTATE;
449
450 /* SFVCB_COPYHOOKCALLBACK structure */
451 typedef struct
452 {
453 HWND hwnd;
454 UINT wFunc;
455 UINT wFlags;
456 LPCSTR pszSrcFile;
457 DWORD dwSrcAttribs;
458 LPCSTR pszDestFile;
459 DWORD dwDestAttribs;
460 } SFVCOPYHOOKINFO, * LPSFVCOPYHOOKINFO;
461 typedef const SFVCOPYHOOKINFO * LPCSFVCOPYHOOKINFO;
462
463 /* SFVCB_GETDETAILSOF structure */
464 typedef struct
465 {
466 LPCITEMIDLIST pidl;
467 int fmt;
468 int cx;
469 STRRET lpText;
470 } SFVCOLUMNINFO, * LPSFVCOLUMNINFO;
471
472 /****************************************************************************
473 * Misc Stuff
474 */
475
476 /* SHWaitForFileToOpen flags */
477 #define SHWFF_ADD 0x01
478 #define SHWFF_REMOVE 0x02
479 #define SHWFF_WAIT 0x04
480
481 BOOL WINAPI SHWaitForFileToOpen(
482 LPCITEMIDLIST pidl,
483 DWORD dwFlags,
484 DWORD dwTimeout);
485
486 WORD WINAPI ArrangeWindows(
487 HWND hwndParent,
488 DWORD dwReserved,
489 LPCRECT lpRect,
490 WORD cKids,
491 CONST HWND * lpKids);
492
493 /* RegisterShellHook types */
494 #define RSH_DEREGISTER 0
495 #define RSH_REGISTER 1
496 #define RSH_REGISTER_PROGMAN 2
497 #define RSH_REGISTER_TASKMAN 3
498
499 BOOL WINAPI RegisterShellHook(
500 HWND hWnd,
501 DWORD dwType);
502
503 /* SHCreateDefClassObject callback function */
504 typedef HRESULT (CALLBACK *LPFNCDCOCALLBACK)(
505 LPUNKNOWN pUnkOuter,
506 REFIID riidObject,
507 LPVOID *ppvObject);
508
509 HRESULT WINAPI SHCreateDefClassObject(
510 REFIID riidFactory,
511 LPVOID *ppvFactory,
512 LPFNCDCOCALLBACK lpfnCallback,
513 LPDWORD lpdwUsage,
514 REFIID riidObject);
515
516 void WINAPI SHFreeUnusedLibraries(void);
517
518 /* SHCreateLinks flags */
519 #define SHCLF_PREFIXNAME 0x01
520 #define SHCLF_CREATEONDESKTOP 0x02
521
522 HRESULT WINAPI SHCreateLinks(
523 HWND hWnd,
524 LPCSTR lpszDir,
525 LPDATAOBJECT lpDataObject,
526 UINT uFlags,
527 LPITEMIDLIST *lppidlLinks);
528
529 DWORD WINAPI CheckEscapesA(LPSTR string, DWORD len);
530 DWORD WINAPI CheckEscapesW(LPWSTR string, DWORD len);
531
532 /* policy functions */
533 BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey);
534
535 /* Shell Desktop functions */
536
537 #define WM_GETISHELLBROWSER (WM_USER+7)
538
539 BOOL WINAPI SHDesktopMessageLoop(HANDLE);
540
541 #define CSIDL_FOLDER_MASK 0x00ff
542
543 #ifdef __cplusplus
544 } /* extern "C" */
545 #endif /* defined(__cplusplus) */
546
547 #endif /* __WINE_UNDOCSHELL_H */