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 version(Windows):
13 
14 private import win32.unknwn, win32.windef;
15 
16 enum : SCODE {
17 	E_FLAGS                     = 0x80041000,
18 	  // = MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x1000)
19 	URL_E_INVALID_SYNTAX        = 0x80041001,
20 	  // = MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x1001)
21 	URL_E_UNREGISTERED_PROTOCOL = 0x80041002, // etc.
22 	IS_E_EXEC_FAILED            = 0x80042002
23 }
24 
25 enum IURL_SETURL_FLAGS {
26 	IURL_SETURL_FL_GUESS_PROTOCOL = 1,
27 	IURL_SETURL_FL_USE_DEFAULT_PROTOCOL,
28 	ALL_IURL_SETURL_FLAGS
29 }
30 
31 enum IURL_INVOKECOMMAND_FLAGS {
32 	IURL_INVOKECOMMAND_FL_ALLOW_UI = 1,
33 	IURL_INVOKECOMMAND_FL_USE_DEFAULT_VERB,
34 	ALL_IURL_INVOKECOMMAND_FLAGS
35 }
36 
37 enum TRANSLATEURL_IN_FLAGS {
38 	TRANSLATEURL_FL_GUESS_PROTOCOL = 1,
39 	TRANSLATEURL_FL_USE_DEFAULT_PROTOCOL,
40 	ALL_TRANSLATEURL_FLAGS
41 }
42 
43 enum URLASSOCIATIONDIALOG_IN_FLAGS {
44 	URLASSOCDLG_FL_USE_DEFAULT_NAME = 1,
45 	URLASSOCDLG_FL_REGISTER_ASSOC,
46 	ALL_URLASSOCDLG_FLAGS
47 }
48 
49 enum MIMEASSOCIATIONDIALOG_IN_FLAGS {
50 	MIMEASSOCDLG_FL_REGISTER_ASSOC = 1,
51 	ALL_MIMEASSOCDLG_FLAGS         = MIMEASSOCDLG_FL_REGISTER_ASSOC
52 }
53 
54 struct URLINVOKECOMMANDINFO {
55 	DWORD dwcbSize = URLINVOKECOMMANDINFO.sizeof;
56 	DWORD dwFlags;
57 	HWND  hwndParent;
58 	PCSTR pcszVerb;
59 }
60 alias URLINVOKECOMMANDINFO CURLINVOKECOMMANDINFO;
61 alias URLINVOKECOMMANDINFO* PURLINVOKECOMMANDINFO, PCURLINVOKECOMMANDINFO;
62 
63 interface IUniformResourceLocator : IUnknown {
64 	HRESULT SetURL(PCSTR, DWORD);
65 	HRESULT GetURL(PSTR*);
66 	HRESULT InvokeCommand(PURLINVOKECOMMANDINFO);
67 }
68 //alias typeof(*(IUniformResourceLocator.init)) CIUniformResourceLocator; // value-type of interface not representable in D
69 alias IUniformResourceLocator PIUniformResourceLocator,
70   PCIUniformResourceLocator;
71 
72 extern (Windows) {
73 	BOOL InetIsOffline(DWORD);
74 	HRESULT MIMEAssociationDialogA(HWND, DWORD, PCSTR, PCSTR, PSTR, UINT);
75 	HRESULT MIMEAssociationDialogW(HWND, DWORD, PCWSTR, PCWSTR, PWSTR, UINT);
76 	HRESULT TranslateURLA(PCSTR, DWORD, PSTR*);
77 	HRESULT TranslateURLW(PCWSTR, DWORD, PWSTR*);
78 	HRESULT URLAssociationDialogA(HWND, DWORD, PCSTR, PCSTR, PSTR, UINT);
79 	HRESULT URLAssociationDialogW(HWND, DWORD, PCWSTR, PCWSTR, PWSTR, UINT);
80 }
81 
82 version (Unicode) {
83 	alias TranslateURLW TranslateURL;
84 	alias MIMEAssociationDialogW MIMEAssociationDialog;
85 	alias URLAssociationDialogW URLAssociationDialog;
86 } else {
87 	alias TranslateURLA TranslateURL;
88 	alias MIMEAssociationDialogA MIMEAssociationDialog;
89 	alias URLAssociationDialogA URLAssociationDialog;
90 }