1*9eab2a37SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9eab2a37SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9eab2a37SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9eab2a37SAndrew Rist * distributed with this work for additional information 6*9eab2a37SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9eab2a37SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9eab2a37SAndrew Rist * "License"); you may not use this file except in compliance 9*9eab2a37SAndrew Rist * with the License. You may obtain a copy of the License at 10*9eab2a37SAndrew Rist * 11*9eab2a37SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9eab2a37SAndrew Rist * 13*9eab2a37SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9eab2a37SAndrew Rist * software distributed under the License is distributed on an 15*9eab2a37SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9eab2a37SAndrew Rist * KIND, either express or implied. See the License for the 17*9eab2a37SAndrew Rist * specific language governing permissions and limitations 18*9eab2a37SAndrew Rist * under the License. 19*9eab2a37SAndrew Rist * 20*9eab2a37SAndrew Rist *************************************************************/ 21*9eab2a37SAndrew Rist 22*9eab2a37SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #pragma once 25cdf0e10cSrcweir 26cdf0e10cSrcweir #ifndef _SHELL9X_H_ 27cdf0e10cSrcweir #define _SHELL9X_H_ 28cdf0e10cSrcweir 29cdf0e10cSrcweir #ifndef _WINDOWS_ 30cdf0e10cSrcweir #include <windows.h> 31cdf0e10cSrcweir #endif 32cdf0e10cSrcweir 33cdf0e10cSrcweir #ifndef _SHLOBJ_H_ 34cdf0e10cSrcweir #include <shlobj.h> 35cdf0e10cSrcweir #endif 36cdf0e10cSrcweir 37cdf0e10cSrcweir #include <shellapi.h> 38cdf0e10cSrcweir 39cdf0e10cSrcweir #ifdef __cplusplus 40cdf0e10cSrcweir extern "C"{ 41cdf0e10cSrcweir #endif 42cdf0e10cSrcweir 43cdf0e10cSrcweir //------------------------------------------------------------------------ 44cdf0e10cSrcweir // undefine the macros defined in the shlobj.h file in order to avoid 45cdf0e10cSrcweir // warnings because of multiple defines 46cdf0e10cSrcweir //------------------------------------------------------------------------ 47cdf0e10cSrcweir 48cdf0e10cSrcweir #ifdef CommandLineToArgvW 49cdf0e10cSrcweir #undef CommandLineToArgvW 50cdf0e10cSrcweir #endif 51cdf0e10cSrcweir 52cdf0e10cSrcweir #ifdef SHBrowseForFolderW 53cdf0e10cSrcweir #undef SHBrowseForFolderW 54cdf0e10cSrcweir #endif 55cdf0e10cSrcweir 56cdf0e10cSrcweir #ifdef SHGetPathFromIDListW 57cdf0e10cSrcweir #undef SHGetPathFromIDListW 58cdf0e10cSrcweir #endif 59cdf0e10cSrcweir 60cdf0e10cSrcweir #ifdef ShellExecuteExW 61cdf0e10cSrcweir #undef ShellExecuteExW 62cdf0e10cSrcweir #endif 63cdf0e10cSrcweir 64cdf0e10cSrcweir //------------------------------------------------------------------------ 65cdf0e10cSrcweir // set the compiler directives for the function pointer we declare below 66cdf0e10cSrcweir // if we build sal or sal will be used as static library we define extern 67cdf0e10cSrcweir // else sal exports the function pointers from a dll and we use __declspec 68cdf0e10cSrcweir //------------------------------------------------------------------------ 69cdf0e10cSrcweir 70cdf0e10cSrcweir #define SHELL9X_API extern 71cdf0e10cSrcweir 72cdf0e10cSrcweir //------------------------------------------------------------------------ 73cdf0e10cSrcweir // declare function pointers to the appropriate shell functions 74cdf0e10cSrcweir //------------------------------------------------------------------------ 75cdf0e10cSrcweir 76cdf0e10cSrcweir SHELL9X_API LPWSTR * ( WINAPI * lpfnCommandLineToArgvW ) ( LPCWSTR lpCmdLine, int *pNumArgs ); 77cdf0e10cSrcweir SHELL9X_API LPITEMIDLIST ( WINAPI * lpfnSHBrowseForFolderW ) ( LPBROWSEINFOW lpbi ); 78cdf0e10cSrcweir SHELL9X_API BOOL ( WINAPI * lpfnSHGetPathFromIDListW ) ( LPCITEMIDLIST pidl, LPWSTR pszPath ); 79cdf0e10cSrcweir 80cdf0e10cSrcweir SHELL9X_API BOOL ( WINAPI * lpfnShellExecuteExW ) ( LPSHELLEXECUTEINFOW lpExecInfo ); 81cdf0e10cSrcweir 82cdf0e10cSrcweir //------------------------------------------------------------------------ 83cdf0e10cSrcweir // redefine the above undefined macros so that the preprocessor replaces 84cdf0e10cSrcweir // all occurrences of this macros with our function pointer 85cdf0e10cSrcweir //------------------------------------------------------------------------ 86cdf0e10cSrcweir 87cdf0e10cSrcweir #define CommandLineToArgvW lpfnCommandLineToArgvW 88cdf0e10cSrcweir #define SHBrowseForFolderW lpfnSHBrowseForFolderW 89cdf0e10cSrcweir #define SHGetPathFromIDListW lpfnSHGetPathFromIDListW 90cdf0e10cSrcweir 91cdf0e10cSrcweir #define ShellExecuteExW lpfnShellExecuteExW 92cdf0e10cSrcweir 93cdf0e10cSrcweir #ifdef __cplusplus 94cdf0e10cSrcweir } 95cdf0e10cSrcweir #endif 96cdf0e10cSrcweir 97cdf0e10cSrcweir #endif 98