update dev300-m57
[ooovba.git] / tools / win / inc / shellex.h
blobfe81bb07ecef45e7fe754ca4fc7023b345cb8ea3
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: shellex.h,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SHELLEX_H_
31 #define _SHELLEX_H_
33 #ifndef _SHLOBJ_H_
34 #include <shlobj.h>
35 #endif
37 #ifdef __cplusplus
38 extern "C" {
39 #define WINSHELLCALL inline
40 #else
41 #define WINSHELLCALL static
42 #endif
44 #define SHChangeNotifyRegister_PROC_STR MAKEINTRESOURCE(2)
45 #define SHChangeNotifyDeregister_PROC_STR MAKEINTRESOURCE(4)
47 #define SHCNF_ACCEPT_INTERRUPTS 0x0001
48 #define SHCNF_ACCEPT_NON_INTERRUPTS 0x0002
49 #define SHCNF_NO_PROXY 0x8000
51 #define SHCNF_ACCEPT_ALL (SHCNF_ACCEPT_INTERRUPTS | SHCNF_ACCEPT_NON_INTERRUPTS)
53 typedef struct tagNOTIFYREGISTER {
54 LPCITEMIDLIST pidlPath;
55 BOOL bWatchSubtree;
56 } NOTIFYREGISTER;
58 typedef NOTIFYREGISTER *LPNOTIFYREGISTER;
59 typedef NOTIFYREGISTER const *LPCNOTIFYREGISTER;
61 typedef HANDLE (WINAPI *SHChangeNotifyRegister_PROC)(
62 HWND hWnd,
63 DWORD dwFlags,
64 LONG wEventMask,
65 UINT uMsg,
66 ULONG cItems,
67 LPCNOTIFYREGISTER lpItems);
70 WINSHELLCALL HANDLE WINAPI SHChangeNotifyRegister(
71 HWND hWnd,
72 DWORD dwFlags,
73 LONG wEventMask,
74 UINT uMsg,
75 ULONG cItems,
76 LPCNOTIFYREGISTER lpItems)
79 HMODULE hModule = GetModuleHandle( "SHELL32" );
80 HANDLE hNotify = NULL;
82 if ( hModule )
84 SHChangeNotifyRegister_PROC lpfnSHChangeNotifyRegister = (SHChangeNotifyRegister_PROC)GetProcAddress( hModule, SHChangeNotifyRegister_PROC_STR );
85 if ( lpfnSHChangeNotifyRegister )
86 hNotify = lpfnSHChangeNotifyRegister( hWnd, dwFlags, wEventMask, uMsg, cItems, lpItems );
89 return hNotify;
94 typedef BOOL (WINAPI *SHChangeNotifyDeregister_PROC)(
95 HANDLE hNotify);
97 WINSHELLCALL BOOL WINAPI SHChangeNotifyDeregister( HANDLE hNotify )
99 HMODULE hModule = GetModuleHandle( "SHELL32" );
100 BOOL fSuccess = FALSE;
102 if ( hModule )
104 SHChangeNotifyDeregister_PROC lpfnSHChangeNotifyDeregister = (SHChangeNotifyDeregister_PROC)GetProcAddress( hModule, SHChangeNotifyDeregister_PROC_STR );
105 if ( lpfnSHChangeNotifyDeregister )
106 fSuccess = lpfnSHChangeNotifyDeregister( hNotify );
109 return fSuccess;
113 #ifdef __cplusplus
115 #endif
117 #endif