Repository navigation
Expand file tree
/
Copy pathshellsdk.h
More file actions
714 lines (562 loc) · 14.9 KB
/
Copy pathshellsdk.h
File metadata and controls
714 lines (562 loc) · 14.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
// @CESYSGEN IF SHELLSDK_MODULES_AYGSHELL
#ifndef _SHELLSDK_H_
#define _SHELLSDK_H_
// shellsdk.h - exported functions from aygshell.dll
#include <windows.h>
#include <sipapi.h>
#include <prsht.h>
#include <shsdkstc.h>
//
// Define API decoration for direct importing of DLL references.
//
//#ifndef WINSHELLAPI
//#if !defined(_SHELL32_)
//#define WINSHELLAPI DECLSPEC_IMPORT
//#else
#undef WINSHELLAPI
#define WINSHELLAPI
//#endif
//#endif // WINSHELLAPI
#ifdef __cplusplus
extern "C" {
#endif
//++++++
//
// SHCloseApps
//
BOOL WINAPI SHCloseApps( DWORD dwMemSought );
//
// End SHCloseApps
//
//------
//++++++
//
// SHCreateMenuBar
//
//++++++
//
// Shell Menubar support
//
#define NOMENU 0xFFFF
#define IDC_COMMANDBANDS 100
// These defines MUST be < 100. This is so apps can use these defines
// to get strings from the shell.
#define IDS_SHNEW 1
#define IDS_SHEDIT 2
#define IDS_SHTOOLS 3
#define IDS_SHVIEW 4
#define IDS_SHFILE 5
#define IDS_SHGO 6
#define IDS_SHFAVORITES 7
#define IDS_SHOPEN 8
//
// Shared New menu support
//
#define IDM_SHAREDNEW 10
#define IDM_SHAREDNEWDEFAULT 11
//
// Valid dwFlags
//
#define SHCMBF_EMPTYBAR 0x0001
#define SHCMBF_HIDDEN 0x0002 // create it hidden
#define SHCMBF_HIDESIPBUTTON 0x0004
#define SHCMBF_COLORBK 0x0008
#define SHCMBF_HMENU 0x0010 // specify an hmenu for resource rather than toolbar info
// HPC ONLY
#define IDC_MENUBAND 1000
#define IDC_TOOLBARBAND 1001
typedef struct tagSHMENUBARINFO
{
DWORD cbSize; // IN - Indicates which members of struct are valid
HWND hwndParent; // IN
DWORD dwFlags; // IN - Some features we want
UINT nToolBarId; // IN - Which toolbar are we using
HINSTANCE hInstRes; // IN - Instance that owns the resources
int nBmpId;
int cBmpImages; // IN - Count of bitmap images
HWND hwndMB; // OUT
COLORREF clrBk; // IN - background color of the menu bar (excluding sip)
} SHMENUBARINFO, *PSHMENUBARINFO;
WINSHELLAPI BOOL SHCreateMenuBar(SHMENUBARINFO *pmbi);
#define SHCMBM_SETSUBMENU (WM_USER + 400) // wparam == id of button, lParam == hmenu, return is old hmenu
#define SHCMBM_GETSUBMENU (WM_USER + 401) // lParam == ID
#define SHCMBM_GETMENU (WM_USER + 402) // get the owning hmenu (as specified in the load resource)
// Convenience Macros
#define SHGetMenu(hWndMB) (HMENU)SendMessage((hWndMB), SHCMBM_GETMENU, (WPARAM)0, (LPARAM)0);
#define SHGetSubMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_GETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU);
#define SHSetSubMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_SETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU);
//Alternate definition
#define SHMenuBar_GetMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_GETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU);
//
// End SHCreateMenuBar
//
//------
//++++++
//
// SHCreateNewItem
//
// Creates a New item, as if an item were chosen from the
// global New menu dropdown.
HRESULT SHCreateNewItem (HWND hwndOwner, REFCLSID clsid);
//
// End SHCreateNewItem
//
//------
//++++++
//
// SHDoneButton
//
BOOL SHDoneButton(HWND hwndRequester, DWORD dwState);
//
// Valid states
//
#define SHDB_SHOW 0x0001
#define SHDB_HIDE 0x0002
//
// End SHDoneButton
//
//------
//++++++
//
// SHFindMenuBar
//
// Returns menubar owned by a window
//
HWND WINAPI SHFindMenuBar(HWND hwnd);
//
// End SHFindMenuBar
//
//------
//++++++
//
// SHFreeContextMenuExtensions
//
// Releases memory allocated for context menu processing.
BOOL SHFreeContextMenuExtensions(HANDLE hCMExtensions);
//
// End SHFreeContextMenuExtensions
//
//------
//++++++
//
// SHFullScreen
//
BOOL SHFullScreen(HWND hwndRequester, DWORD dwState);
//
// Valid states
//
#define SHFS_SHOWTASKBAR 0x0001
#define SHFS_HIDETASKBAR 0x0002
#define SHFS_SHOWSIPBUTTON 0x0004
#define SHFS_HIDESIPBUTTON 0x0008
#define SHFS_SHOWSTARTICON 0x0010
#define SHFS_HIDESTARTICON 0x0020
//
// End SHFullScreen
//
//------
//++++++
//
// SHGetAppKeyAssoc
//
// Gets which key (VK_APP1-6) is assigned to this app.
BYTE WINAPI SHGetAppKeyAssoc(LPCTSTR ptszApp);
//
// End SHGetAppKeyAssoc
//
//------
//++++++
//
// SHGetAutoRunPath
// pAutoRunPath must be at least MAX_PATH long
BOOL SHGetAutoRunPath( LPTSTR pAutoRunPath );
//
// End SHGetAutoRunPath
//
//------
//++++++
//
// SHGetEmergencyCallList
//
// Gets a list of emergency calls
HRESULT SHGetEmergencyCallList(TCHAR *pwszBuffer, UINT uLenBuf);
//
// End SHGetEmergencyCallList
//
//------
//++++++
//
// SHHandleWMActivate
//
typedef struct
{
DWORD cbSize;
HWND hwndLastFocus;
UINT fSipUp :1;
UINT fSipOnDeactivation :1;
UINT fActive :1;
UINT fReserved :29;
} SHACTIVATEINFO, *PSHACTIVATEINFO;
#define SHA_INPUTDIALOG 0x00000001
WINSHELLAPI BOOL SHHandleWMActivate(HWND hwnd, WPARAM wParam, LPARAM lParam, SHACTIVATEINFO* psai, DWORD dwFlags);
WINSHELLAPI BOOL SHHandleWMSettingChange(HWND hwnd, WPARAM wParam, LPARAM lParam, SHACTIVATEINFO* psai);
//
// End SHHandleWMActivate
//
//------
//++++++
//
// SHInitDialog
//
typedef struct tagSHINITDLGINFO
{
DWORD dwMask;
HWND hDlg;
DWORD dwFlags;
} SHINITDLGINFO, *PSHINITDLGINFO;
//
// The functions
//
BOOL SHInitDialog(PSHINITDLGINFO pshidi);
//
// Valid mask values
//
#define SHIDIM_FLAGS 0x0001
//
// Valid flags
//
#define SHIDIF_DONEBUTTON 0x0001
#define SHIDIF_SIZEDLG 0x0002
#define SHIDIF_SIZEDLGFULLSCREEN 0x0004
#define SHIDIF_SIPDOWN 0x0008
#define SHIDIF_FULLSCREENNOMENUBAR 0x0010
#define SHIDIF_EMPTYMENU 0x0020
//
// End SHInitDialog
//
//------
//++++++
//
// SHInitExtraControls
//
#define WC_SIPPREF L"SIPPREF"
BOOL SHInitExtraControls(void);
//
// End SHInitExtraControls
//
//------
//++++++
//
// SHInputDialog
//
void SHInputDialog(HWND hwnd, UINT uMsg, WPARAM wParam);
//
// End SHInputDialog
//
//------
//++++++
//
// SHInvokeContextMenuCommand
//
// Invokes a command from a context menu. Issues the command in the
// extension that added it to the menu.
BOOL SHInvokeContextMenuCommand(HWND hwndOwner, UINT idCmd,
HANDLE hCMExtensions);
//
// End SHInvokeContextMenuCommand
//
//------
//++++++
//
// SHLoadContextMenuExtensions
//
// Loads context menu extensions from handlers listed in the registry for
// the context/class pair specified. Menu items are added to hmenu in the
// range [idCmdFirst, idCmdLast]. A handle to the context menu extensions
// abstraction object is returned in *phCMExtensions. It must be freed by
// a call to SHFreeContextMenuExtensions.
BOOL SHLoadContextMenuExtensions(IUnknown *punkOwner, LPCTSTR pszContext,
LPCTSTR pszClass, HMENU hmenu, UINT idCmdFirst, UINT idCmdLast,
HANDLE *phCMExtensions);
//
// End SHLoadContextMenuExtensions
//
//------
//++++++
//
// SHNavigateBack APIs
//
void WINAPI SHNavigateBack();
void WINAPI SHSetBack(int, HWND);
//
// End SHNavigateBack APIs
//
//------
//////////////////////////////////////////////////////////////////////////////
//
// SHNAPI - Shell Notification API
//
//
// notification update mask
//#define SHN_FIRST (0U-1000U) // Shell reserved
#define SHNN_FIRST (0U-1000U) // Shell Notifications
#define SHNN_LAST (0U-1020U) // Shell Notifications
//#define SHN_LAST (0U-11000U)
#define SHNUM_PRIORITY 0x0001
#define SHNUM_DURATION 0x0002
#define SHNUM_ICON 0x0004
#define SHNUM_HTML 0x0008
#define SHNUM_TITLE 0x0010
// Flags
// For SHNP_INFORM priority and above, don't display the notification bubble
// when it's initially added; the icon will display for the duration then it
// will go straight into the tray. The user can view the icon / see the
// bubble by opening the tray.
#define SHNF_STRAIGHTTOTRAY 0x00000001
// Critical information - highlights the border and title of the bubble.
#define SHNF_CRITICAL 0x00000002
// Force the message (bubble) to display even if settings says not to.
#define SHNF_FORCEMESSAGE 0x00000008
// Force the display to turn on for notification.
#define SHNF_DISPLAYON 0x00000010
// notification message and codes for window-based notification
// the notification's dwID is in hdr.idFrom
typedef struct _NMSHN
{
NMHDR hdr;
LPARAM lParam;
DWORD dwReturn;
union
{
LPCTSTR pszLink;
BOOL fTimeout;
POINT pt;
};
} NMSHN;
#define SHNN_LINKSEL (SHNN_FIRST-0)
// nmshn.pszLink contains the link text of the choice that was selected
#define SHNN_DISMISS (SHNN_FIRST-1)
// nmshn.fTimeout is TRUE if duration expired, FALSE if user tapped away
#define SHNN_SHOW (SHNN_FIRST-2)
// nmshn.pt contains the point to which the bubble points, under HPC
// the point is zero
//===========================================================================
//
// Interface: IShellNotificationCallback
//
// The IShellNotificationCallback interface is used by the Shell to advise
// the notification owner of actions taken on the notification.
//
// [Member functions]
//
// IShellNotificationCallback::OnShow
//
// Reserved. Return E_NOTIMPL.
//
// IShellNotificationCallback::OnCommandSelected
//
// This member function is called when the user selects a link of the form
// <A HREF="cmd:#">link</A>.
//
// Parameters:
// dwID -- the identifier of the notification
// wCmdID -- this is the # in the link
//
// IShellNotificationCallback::OnLinkSelected
//
// This member function is called when the user selects one of the action
// choice links in the notification bubble window.
//
// Parameters:
// dwID -- the identifier of the notification
// pszLink -- the link content that was selected
// lParam -- the lParam of the notification
//
// IShellNotificationCallback::OnDismiss
//
// This member function is called when the user taps away from the bubble
// window or if a SHNP_INFORM priority notification's duration expires.
//
// Parameters:
// dwID -- the identifier of the notification
// fTimeout -- the notification timed out (SHNP_INFORM only)
// lParam -- the lParam of the notification
//
//===========================================================================
#undef INTERFACE
#define INTERFACE IShellNotificationCallback
DECLARE_INTERFACE_(IShellNotificationCallback, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IShellNotificationCallback methods ***
STDMETHOD(OnShow)(THIS_ DWORD dwID, POINT pt, LPARAM lParam) PURE;
STDMETHOD(OnCommandSelected)(THIS_ DWORD dwID, WORD wCmdID)
PURE;
STDMETHOD(OnLinkSelected)(THIS_ DWORD dwID, LPCTSTR pszLink, LPARAM lParam)
PURE;
STDMETHOD(OnDismiss)(THIS_ DWORD dwID, BOOL fTimeout, LPARAM lParam) PURE;
};
//++++++
//
// SHNotificationAdd
//
// Add a notification.
LRESULT SHNotificationAdd(SHNOTIFICATIONDATA *pndAdd);
//
// End SHNotificationAdd
//
//------
//++++++
//
// SHNotificationGetData
//
// Get the data for a notification. Used by a handler to get information
// stored in the notification by the poster.
LRESULT SHNotificationGetData(const CLSID *pclsid, DWORD dwID,
SHNOTIFICATIONDATA *pndBuffer);
//
// End SHNotificationGetData
//
//------
//++++++
//
// SHNotificationRemove
//
// Remove a notification. This is usually in reponse to some
// action taken on the data outside of the notification system - for example
// if a message is read or deleted.
LRESULT SHNotificationRemove(const CLSID *pclsid, DWORD dwID);
//
// End SHNotificationRemove
//
//------
//++++++
//
// SHNotificationUpdate
//
// Update aspects of a pending notification.
LRESULT SHNotificationUpdate(DWORD grnumUpdateMask, SHNOTIFICATIONDATA *pndNew);
//
// End SHNotificationUpdate
//
//------
// }
//
// end SHNAPI
//
//////////////////////////////////////////////////////////////////////////////
//++++++
//
// SHRecognizeGesture structs
//
typedef struct tagSHRGI {
DWORD cbSize;
HWND hwndClient;
POINT ptDown;
DWORD dwFlags;
} SHRGINFO, *PSHRGINFO;
//
// Gesture notifications
//
#define GN_CONTEXTMENU 1000
//
// Gesture flags
//
#define SHRG_RETURNCMD 0x00000001
#define SHRG_NOTIFYPARENT 0x00000002
// use the longer (mixed ink) delay timer
// useful for cases where you might click down first, verify you're
// got the right spot, then start dragging... and it's not clear
// you wanted a context menu
#define SHRG_LONGDELAY 0x00000008
#define SHRG_NOANIMATION 0x00000010
//
// Struct sent through WM_NOTIFY when SHRG_NOTIFYPARENT is used
//
typedef struct tagNMRGINFO
{
NMHDR hdr;
POINT ptAction;
DWORD dwItemSpec;
} NMRGINFO, *PNMRGINFO;
WINSHELLAPI DWORD SHRecognizeGesture(SHRGINFO *shrg);
//
// End SHRecognizeGesture
//
//------
//++++++
//
// SHSetAppKeyWndAssoc
//
BOOL WINAPI SHSetAppKeyWndAssoc(BYTE bVk, HWND hwnd);
//
// End SHSetAppKeyWndAssoc
//
//------
//++++++
//
// SHSetNavBarText
//
BOOL WINAPI SHSetNavBarText( HWND hwnd, LPCTSTR pszText );
//
// End SHSetNavBarText
//
//------
//++++++
//
// SHSipInfo
//
//
// Supported system parameters not defined in sipapi.h
//
#define SPI_APPBUTTONCHANGE 228
#define SPI_RESERVED 229
#define SPI_SYNCSETTINGSCHANGE 230
WINSHELLAPI BOOL SHSipInfo( UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni );
//
// End SHSipInfo
//
//------
//++++++
//
// SHSipPreference
//
BOOL WINAPI SHSipPreference(HWND hwnd, SIPSTATE st);
//
// End SHSipPreference
//
//------
//====== File System Notification APIs ===============================
//
//
// File System Notification flags
//
// see shlobj.h for other SHCNE and SHCNF defines
#define SHCNE_RENAME 0x00000001L // GOING AWAY
#define WM_FILECHANGEINFO (WM_APP + 0x101)
//
// APIs
//
BOOL WINAPI SHChangeNotifyRegister( HWND hwnd, SHCHANGENOTIFYENTRY *pshcne );
BOOL WINAPI SHChangeNotifyDeregister( HWND hwnd );
void WINAPI SHChangeNotifyFree( FILECHANGENOTIFY *pfcn );
#ifdef __cplusplus
}
#endif
#endif // _SHELLSDK_H_
// @CESYSGEN ENDIF SHELLSDK_MODULES_AYGSHELL