Mercurial > vim
annotate src/GvimExt/gvimext.h @ 28507:73f235d0b6c8 v8.2.4778
patch 8.2.4778: pacman files use dosini filetype
Commit: https://github.com/vim/vim/commit/35cff32dd82e5e2b72453b9f27d0655fc5b8a639
Author: Chaoren Lin <aoe@google.com>
Date: Sun Apr 17 21:15:48 2022 +0100
patch 8.2.4778: pacman files use dosini filetype
Problem: Pacman files use dosini filetype.
Solution: Use conf instead. (Chaoren Lin, closes https://github.com/vim/vim/issues/10213)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 17 Apr 2022 22:30:03 +0200 |
parents | 41a940219183 |
children | 32c9b7396a75 |
rev | line source |
---|---|
10 | 1 /* vi:set ts=8 sts=4 sw=4: |
2 * | |
3 * VIM - Vi IMproved gvimext by Tianmiao Hu | |
4 * | |
5 * Do ":help uganda" in Vim to read copying and usage conditions. | |
6 * Do ":help credits" in Vim to see a list of people who contributed. | |
7 */ | |
8 | |
9 /* | |
10 * If you have any questions or any suggestions concerning gvimext, please | |
11 * contact Tianmiao Hu: tianmiao@acm.org. | |
12 */ | |
13 | |
14 #if !defined(AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_) | |
15 #define AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_ | |
16 | |
2080
fa7e62dd58d7
updated for version 7.2.364
Bram Moolenaar <bram@zimbu.org>
parents:
842
diff
changeset
|
17 #if defined(_MSC_VER) && _MSC_VER > 1000 |
10 | 18 #pragma once |
2080
fa7e62dd58d7
updated for version 7.2.364
Bram Moolenaar <bram@zimbu.org>
parents:
842
diff
changeset
|
19 #endif |
10 | 20 |
21 // Insert your headers here | |
22 // #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers | |
23 | |
24 //-------------------------------------------------------------- | |
25 // common user interface routines | |
26 // | |
27 // | |
28 //-------------------------------------------------------------- | |
29 | |
30 #ifndef STRICT | |
842 | 31 # define STRICT |
10 | 32 #endif |
33 | |
15868
7fad90423bd2
patch 8.1.0941: macros for MS-Windows are inconsistent
Bram Moolenaar <Bram@vim.org>
parents:
8180
diff
changeset
|
34 #define INC_OLE2 // MS-Windows, get ole2 from windows.h |
10 | 35 |
714 | 36 /* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */ |
2080
fa7e62dd58d7
updated for version 7.2.364
Bram Moolenaar <bram@zimbu.org>
parents:
842
diff
changeset
|
37 #if defined(_MSC_VER) && _MSC_VER >= 1400 |
714 | 38 # define _CRT_SECURE_NO_DEPRECATE |
39 # define _CRT_NONSTDC_NO_DEPRECATE | |
40 #endif | |
41 | |
10 | 42 #include <windows.h> |
43 #include <windowsx.h> | |
44 #include <shlobj.h> | |
8180
1e48ffa2d697
commit https://github.com/vim/vim/commit/271273c39f2150ecdaa67fe1a2a8e9cdc63db545
Christian Brabandt <cb@256bit.org>
parents:
6805
diff
changeset
|
45 #include <wchar.h> |
10 | 46 |
47 #define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i))) | |
48 | |
49 // Initialize GUIDs (should be done only and at-least once per DLL/EXE) | |
50 // | |
51 #pragma data_seg(".text") | |
52 #define INITGUID | |
53 #include <initguid.h> | |
54 | |
55 // | |
56 // The class ID of this Shell extension class. | |
57 // | |
58 // class id: {51EEE242-AD87-11d3-9C1E-0090278BBD99} | |
59 // | |
60 // | |
61 // NOTE!!! If you use this shell extension as a starting point, | |
62 // you MUST change the GUID below. Simply run UUIDGEN.EXE | |
63 // to generate a new GUID. | |
64 // | |
65 | |
66 // {51EEE242-AD87-11d3-9C1E-0090278BBD99} | |
67 // static const GUID <<name>> = | |
68 // { 0x51eee242, 0xad87, 0x11d3, { 0x9c, 0x1e, 0x0, 0x90, 0x27, 0x8b, 0xbd, 0x99 } }; | |
69 // | |
70 // | |
71 | |
72 // {51EEE242-AD87-11d3-9C1E-0090278BBD99} | |
73 // IMPLEMENT_OLECREATE(<<class>>, <<external_name>>, | |
74 // 0x51eee242, 0xad87, 0x11d3, 0x9c, 0x1e, 0x0, 0x90, 0x27, 0x8b, 0xbd, 0x99); | |
75 // | |
76 | |
77 // {51EEE242-AD87-11d3-9C1E-0090278BBD99} -- this is the registry format | |
78 DEFINE_GUID(CLSID_ShellExtension, 0x51eee242, 0xad87, 0x11d3, 0x9c, 0x1e, 0x0, 0x90, 0x27, 0x8b, 0xbd, 0x99); | |
79 | |
80 // this class factory object creates context menu handlers for windows 32 shell | |
81 class CShellExtClassFactory : public IClassFactory | |
82 { | |
83 protected: | |
84 ULONG m_cRef; | |
85 | |
86 public: | |
87 CShellExtClassFactory(); | |
88 ~CShellExtClassFactory(); | |
89 | |
90 //IUnknown members | |
91 STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *); | |
92 STDMETHODIMP_(ULONG) AddRef(); | |
93 STDMETHODIMP_(ULONG) Release(); | |
94 | |
95 //IClassFactory members | |
96 STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *); | |
97 STDMETHODIMP LockServer(BOOL); | |
98 | |
99 }; | |
100 typedef CShellExtClassFactory *LPCSHELLEXTCLASSFACTORY; | |
101 #define MAX_HWND 100 | |
102 | |
103 // this is the actual OLE Shell context menu handler | |
104 class CShellExt : public IContextMenu, | |
105 IShellExtInit | |
106 { | |
6805 | 107 private: |
108 BOOL LoadMenuIcon(); | |
109 | |
10 | 110 protected: |
111 ULONG m_cRef; | |
112 LPDATAOBJECT m_pDataObj; | |
113 UINT m_edit_existing_off; | |
6805 | 114 HBITMAP m_hVimIconBitmap; |
10 | 115 |
116 // For some reason, this callback must be static | |
117 static BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam); | |
118 | |
119 STDMETHODIMP PushToWindow(HWND hParent, | |
120 LPCSTR pszWorkingDir, | |
121 LPCSTR pszCmd, | |
122 LPCSTR pszParam, | |
123 int iShowCmd, | |
124 int idHWnd); | |
125 | |
126 STDMETHODIMP InvokeSingleGvim(HWND hParent, | |
26682
64dac9ff015e
patch 8.2.3870: MS-Windows: wrong dir when using right-click context menu
Bram Moolenaar <Bram@vim.org>
parents:
25413
diff
changeset
|
127 LPCWSTR workingDir, |
10 | 128 LPCSTR pszCmd, |
129 LPCSTR pszParam, | |
130 int iShowCmd, | |
25413
ee2808fb1be9
patch 8.2.3243: MS-Windows: "edit with multiple Vim" choice is less useful
Bram Moolenaar <Bram@vim.org>
parents:
18060
diff
changeset
|
131 int gvimExtraOptions); |
10 | 132 |
133 public: | |
134 int m_cntOfHWnd; | |
135 HWND m_hWnd[MAX_HWND]; | |
136 CShellExt(); | |
137 ~CShellExt(); | |
138 | |
139 //IUnknown members | |
140 STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *); | |
141 STDMETHODIMP_(ULONG) AddRef(); | |
142 STDMETHODIMP_(ULONG) Release(); | |
143 | |
144 //IShell members | |
145 STDMETHODIMP QueryContextMenu(HMENU hMenu, | |
146 UINT indexMenu, | |
147 UINT idCmdFirst, | |
148 UINT idCmdLast, | |
149 UINT uFlags); | |
150 | |
151 STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi); | |
152 | |
835 | 153 STDMETHODIMP GetCommandString(UINT_PTR idCmd, |
10 | 154 UINT uFlags, |
155 UINT FAR *reserved, | |
156 LPSTR pszName, | |
157 UINT cchMax); | |
158 | |
159 //IShellExtInit methods | |
160 STDMETHODIMP Initialize(LPCITEMIDLIST pIDFolder, | |
161 LPDATAOBJECT pDataObj, | |
162 HKEY hKeyID); | |
163 }; | |
164 | |
165 typedef CShellExt *LPCSHELLEXT; | |
166 #pragma data_seg() | |
167 | |
168 #endif |