⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shell.odl

📁 The code for this article was written for version 1.0 of the Active Template Library (ATL). The cu
💻 ODL
📖 第 1 页 / 共 2 页
字号:

[
uuid(54674052-3A82-101B-8181-00AA003743D3),
helpstring("Shell"),
#if WIN32
dllname("SHELL32.DLL")
#else
dllname("SHELL.DLL")
#endif
]
module Shell {

    // Shell functions, types, and definitions
    /*
    UINT WINAPI DragQueryFileA(HDROP,UINT,LPSTR,UINT);

    BOOL WINAPI DragQueryPoint(HDROP,LPPOINT);

    VOID WINAPI DragFinish(HDROP);

    VOID WINAPI DragAcceptFiles(HWND,BOOL);
    */

    /*
    typedef struct _DRAGINFOA {
        UINT uSize;                 // Init with sizeof(DRAGINFO)
        POINT pt;
        BOOL fNC;
        LPSTR   lpFileList;
        DWORD grfKeyState;
    } DRAGINFOA, FAR* LPDRAGINFOA;
    typedef DRAGINFOA DRAGINFO;
    typedef LPDRAGINFOA LPDRAGINFO;
    */

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("ShellExecuteA"),
    #else
    entry("ShellExecute"),
    #endif
    helpstring("Opens or prints specified executable or document file"),
    ]
    HINSTANCE WINAPI ShellExecute([in] HWND hwnd,
                                  [in] LPCSTR lpOperation,
                                  [in] LPCSTR lpFile,
                                  [in] LPCSTR lpParameters,
                                  [in] LPCSTR lpDirectory,
                                  [in] INT nShowCmd);
    [
    #ifdef WIN32
    usesgetlasterror,
    entry("FindExecutableA"),
    #else
    entry("FindExecutable"),
    #endif
    helpstring("Retrieves name and handle of executable file associated with the specified filename"),
    ]
    HINSTANCE WINAPI FindExecutable([in] LPCSTR lpFile,
                                    [in] LPCSTR lpDirectory,
                                    [in, out] LPSTR lpResult);

    // LPWSTR * WINAPI CommandLineToArgvW(LPCWSTR lpCmdLine, int*pNumArgs);

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("ShellAboutA"),
    #else
    entry("ShellAbout"),
    #endif
    helpstring("Displays an About Box"),
    ]
    INT WINAPI ShellAbout([in] HWND hWnd, [in] LPCSTR szApp,
                          [in] LPCSTR szOtherStuff,
                          [in] HICON hIcon);

    // HICON      WINAPI DuplicateIcon(HINSTANCE hInst, HICON hIcon);

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("ExtractAssociatedIconA"),
    #else
    entry("ExtractAssociatedIcon"),
    #endif
    helpstring("Returns handle of indexed icon found in a file or in an associated executable file"),
    ]
    HICON     WINAPI ExtractAssociatedIcon([in] HINSTANCE hInst,
                                           [in] LPSTR lpIconPath,
                                           [in,out] WORD FAR * lpiIcon);

    [
    #ifdef WIN32
    usesgetlasterror,
    entry("ExtractIconA"),
    #else
    entry("ExtractIcon"),
    #endif
    helpstring("Retrieves handle of an icon from given executable file, DLL, or icon file"),
    ]
    HICON     WINAPI ExtractIcon([in] HINSTANCE hInst,
                                 [in] LPCSTR lpszExeFileName,
                                 [in] UINT nIconIndex);


    // AppBar stuff
    /*
    const DWORD ABM_NEW             = 0x00000000;
    const DWORD ABM_REMOVE          = 0x00000001;
    const DWORD ABM_QUERYPOS        = 0x00000002;
    const DWORD ABM_SETPOS          = 0x00000003;
    const DWORD ABM_GETSTATE        = 0x00000004;
    const DWORD ABM_GETTASKBARPOS   = 0x00000005;
    const DWORD ABM_ACTIVATE        = 0x00000006;  // lParam == TRUE/FALSE means activate/deactivate
    const DWORD ABM_GETAUTOHIDEBAR  = 0x00000007;
    const DWORD ABM_SETAUTOHIDEBAR  = 0x00000008;  // This can fail at any time.
                                                   // MUST check the result
                                                   // lParam = TRUE/FALSE  Set/Unset
                                                   // uEdge = what edge
    const DWORD ABM_WINDOWPOSCHANGED = 0x0000009;


    // these are put in the wparam of callback messages
    const DWORD ABN_STATECHANGE    = 0x0000000;
    const DWORD ABN_POSCHANGED     = 0x0000001;
    const DWORD ABN_FULLSCREENAPP  = 0x0000002;
    const DWORD ABN_WINDOWARRANGE  = 0x0000003; // lParam == TRUE means hide

    // flags for get state
    const DWORD ABS_AUTOHIDE       = 0x0000001;
    const DWORD ABS_ALWAYSONTO     = 0x0000002;

    const int ABE_LEFT    = 0;
    const int ABE_TOP     = 1;
    const int ABE_RIGHT   = 2;
    const int ABE_BOTTOM  = 3;
    */

    /*
    typedef struct _AppBarData
    {
        DWORD cbSize;
        HWND hWnd;
        UINT uCallbackMessage;
        UINT uEdge;
        RECT rc;
        LPARAM lParam; // message specific
    } APPBARDATA, *PAPPBARDATA;
    */

    // UINT WINAPI SHAppBarMessage(DWORD dwMessage, PAPPBARDATA pData);

    //  EndAppBar

    // DWORD WINAPI DoEnvironmentSubstA(LPSTR szString, UINT cbString);

    // LPSTR WINAPI FindEnvironmentStringA(LPSTR szEnvVar);

    //        #define EIRESID(x) (-1 * (int)(x))

    /*
    UINT WINAPI ExtractIconExA(LPCSTR lpszFile, int nIconIndex,
                               HICON FAR *phiconLarge,
                               HICON FAR *phiconSmall, UINT nIcons);
    */

    #ifdef WIN32
    //
    // SHAddToRecentDocs
    //
    [ helpstring("SHAddToRecentDocs: Add item identifier list") ]
    const long SHARD_PIDL   = 0x00000001;
    [ helpstring("SHAddToRecentDocs: Add path string") ]
    const long SHARD_PATH   = 0x00000002;

    [
    usesgetlasterror,
    entry("SHAddToRecentDocs"),
    helpstring("Adds a file to shell list of recently used documents, or clears documents from the list"),
    ]
    void WINAPI SHAddToRecentDocs([in] UINT uFlags, [in] LPSTR pv);

    [
    usesgetlasterror,
    entry("SHAddToRecentDocs"),
    helpstring("Adds an item ID list to shell list of recently used documents, or clears documents from the list"),
    ]
    void WINAPI SHAddToRecentDocsItem([in] UINT uFlags, [in] DWORD pv);


    //----------
    //
    // SHGetPathFromIDList
    //
    //  This function assumes the size of the buffer (MAX_PATH). The pidl
    // should point to a file system object.
    //
    //----------

    [
    usesgetlasterror,
    entry("SHGetPathFromIDList"),
    helpstring("Converts an item ID list pointer to a file system path (cMaxPath buffer expected)"),
    ]
    BOOL WINAPI SHGetPathFromIDList([in] DWORD pidl, [in] LPSTR pszPath);

    //// Shell File Operations

    //         #ifndef FO_MOVE //these need to be kept in sync with the ones in shlobj.h
    /*
    const WORD FO_MOVE         = 0x0001;
    const WORD FO_COPY         = 0x0002;
    const WORD FO_DELETE       = 0x0003;
    const WORD FO_RENAME       = 0x0004;

    const WORD FOF_MULTIDESTFILES       = 0x0001;
    const WORD FOF_CONFIRMMOUSE         = 0x0002;
    const WORD FOF_SILENT               = 0x0004; // don't create progress/report
    const WORD FOF_RENAMEONCOLLISION    = 0x0008;
    const WORD FOF_NOCONFIRMATION       = 0x0010; // Don't prompt the user.
    const WORD FOF_WANTMAPPINGHANDLE    = 0x0020; // Fill in SHFILEOPSTRUCT.hNameMappings
                                                  // Must be freed using SHFreeNameMappings
    const WORD FOF_ALLOWUNDO            = 0x0040;
    const WORD FOF_FILESONLY            = 0x0080; // on *.*, do only files
    const WORD FOF_SIMPLEPROGRESS       = 0x0100; // means don't show names of files
    const WORD FOF_NOCONFIRMMKDIR       = 0x0200; // don't confirm making any needed dirs

    //typedef WORD FILEOP_FLAGS;

    const WORD PO_DELETE     = 0x0013;  // printer is being deleted
    const WORD PO_RENAME     = 0x0014;  // printer is being renamed
    const WORD PO_PORTCHANGE = 0x0020;  // port this printer connected to is being changed
                                        // if this id is set, the strings received by
                                        // the copyhook are a doubly-null terminated
                                        // list of strings.  The first is the printer
                                        // name and the second is the printer port.
    const WORD PO_REN_PORT   = 0x0034;  // PO_RENAME and PO_PORTCHANGE at same time.

    // no POF_ flags currently defined

    // typedef WORD PRINTEROP_FLAGS;
    */

    // implicit parameters are:
    //      if pFrom or pTo are unqualified names the current directories are
    //      taken from the global current drive/directory settings managed
    //      by Get/SetCurrentDrive/Directory
    //
    //      the global confirmation settings

    /*
    typedef struct _SHFILEOPSTRUCTA
    {
            HWND            hwnd;
            UINT            wFunc;
            LPCSTR          pFrom;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -