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