1 /***********************************************************************\
2 *                               intshcut.d                              *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                           by Stewart Gordon                           *
8 *                                                                       *
9 *                       Placed into public domain                       *
10 \***********************************************************************/
11 module win32.intshcut;
12 
13 private import win32.unknwn, win32.windef;
14 
15 enum : SCODE {
16 	E_FLAGS                     = 0x80041000,
17 	  // = MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x1000)
18 	URL_E_INVALID_SYNTAX        = 0x80041001,
19 	  // = MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x1001)
20 	URL_E_UNREGISTERED_PROTOCOL = 0x80041002, // etc.
21 	IS_E_EXEC_FAILED            = 0x80042002
22 }
23 
24 enum IURL_SETURL_FLAGS {
25 	IURL_SETURL_FL_GUESS_PROTOCOL = 1,
26 	IURL_SETURL_FL_USE_DEFAULT_PROTOCOL,
27 	ALL_IURL_SETURL_FLAGS
28 }
29 
30 enum IURL_INVOKECOMMAND_FLAGS {
31 	IURL_INVOKECOMMAND_FL_ALLOW_UI = 1,
32 	IURL_INVOKECOMMAND_FL_USE_DEFAULT_VERB,
33 	ALL_IURL_INVOKECOMMAND_FLAGS
34 }
35 
36 enum TRANSLATEURL_IN_FLAGS {
37 	TRANSLATEURL_FL_GUESS_PROTOCOL = 1,
38 	TRANSLATEURL_FL_USE_DEFAULT_PROTOCOL,
39 	ALL_TRANSLATEURL_FLAGS
40 }
41 
42 enum URLASSOCIATIONDIALOG_IN_FLAGS {
43 	URLASSOCDLG_FL_USE_DEFAULT_NAME = 1,
44 	URLASSOCDLG_FL_REGISTER_ASSOC,
45 	ALL_URLASSOCDLG_FLAGS
46 }
47 
48 enum MIMEASSOCIATIONDIALOG_IN_FLAGS {
49 	MIMEASSOCDLG_FL_REGISTER_ASSOC = 1,
50 	ALL_MIMEASSOCDLG_FLAGS         = MIMEASSOCDLG_FL_REGISTER_ASSOC
51 }
52 
53 struct URLINVOKECOMMANDINFO {
54 	DWORD dwcbSize = URLINVOKECOMMANDINFO.sizeof;
55 	DWORD dwFlags;
56 	HWND  hwndParent;
57 	PCSTR pcszVerb;
58 }
59 alias URLINVOKECOMMANDINFO CURLINVOKECOMMANDINFO;
60 alias URLINVOKECOMMANDINFO* PURLINVOKECOMMANDINFO, PCURLINVOKECOMMANDINFO;
61 
62 interface IUniformResourceLocator : IUnknown {
63 	HRESULT SetURL(PCSTR, DWORD);
64 	HRESULT GetURL(PSTR*);
65 	HRESULT InvokeCommand(PURLINVOKECOMMANDINFO);
66 }
67 alias IUniformResourceLocator CIUniformResourceLocator;
68 alias IUniformResourceLocator* PIUniformResourceLocator,
69   PCIUniformResourceLocator;
70 
71 extern (Windows) {
72 	BOOL InetIsOffline(DWORD);
73 	HRESULT MIMEAssociationDialogA(HWND, DWORD, PCSTR, PCSTR, PSTR, UINT);
74 	HRESULT MIMEAssociationDialogW(HWND, DWORD, PCWSTR, PCWSTR, PWSTR, UINT);
75 	HRESULT TranslateURLA(PCSTR, DWORD, PSTR*);
76 	HRESULT TranslateURLW(PCWSTR, DWORD, PWSTR*);
77 	HRESULT URLAssociationDialogA(HWND, DWORD, PCSTR, PCSTR, PSTR, UINT);
78 	HRESULT URLAssociationDialogW(HWND, DWORD, PCWSTR, PCWSTR, PWSTR, UINT);
79 }
80 
81 version (Unicode) {
82 	alias TranslateURLW TranslateURL;
83 	alias MIMEAssociationDialogW MIMEAssociationDialog;
84 	alias URLAssociationDialogW URLAssociationDialog;
85 } else {
86 	alias TranslateURLA TranslateURL;
87 	alias MIMEAssociationDialogA MIMEAssociationDialog;
88 	alias URLAssociationDialogA URLAssociationDialog;
89 }