xref: /reactos/dll/cpl/appwiz/appwiz.h (revision bea6d763)
1 #ifndef _APPWIZ_H
2 #define _APPWIZ_H
3 
4 #include <config.h>
5 #include <wine/port.h>
6 
7 #include <stdarg.h>
8 
9 #define WIN32_NO_STATUS
10 #define _INC_WINDOWS
11 #define COM_NO_WINDOWS_H
12 
13 #define COBJMACROS
14 
15 #include <windef.h>
16 #include <winbase.h>
17 #include <winreg.h>
18 #include <winnls.h>
19 #include <shlobj.h>
20 #include <intshcut.h>
21 #include <shlwapi.h>
22 
23 #include <wine/debug.h>
24 WINE_DEFAULT_DEBUG_CHANNEL(appwiz);
25 
26 #include "resource.h"
27 
28 typedef struct
29 {
30    WCHAR szTarget[2 * MAX_PATH];
31    WCHAR szWorkingDirectory[MAX_PATH];
32    WCHAR szDescription[MAX_PATH];
33    WCHAR szArguments[2 * MAX_PATH];
34    WCHAR szOrigin[MAX_PATH];
35    WCHAR szOldFile[MAX_PATH];
36    WCHAR szLinkName[MAX_PATH];
37 } CREATE_LINK_CONTEXT, *PCREATE_LINK_CONTEXT;
38 
39 extern HINSTANCE hApplet;
40 
41 /* createlink.c */
42 INT_PTR CALLBACK
43 WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
44 
45 INT_PTR CALLBACK
46 FinishDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
47 
48 LONG CALLBACK
49 NewLinkHere(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
50 
51 /* removestartmenuitems.c */
52 LONG CALLBACK
53 ConfigStartMenu(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
54 
55 void ShowLastWin32Error(HWND hWndOwner);
56 
57 typedef enum {
58     ADDON_GECKO,
59     ADDON_MONO
60 } addon_t;
61 
62 BOOL install_addon(addon_t, HWND hwnd_parent) DECLSPEC_HIDDEN;
63 
64 extern HINSTANCE hInst DECLSPEC_HIDDEN;
65 
66 static inline void *heap_alloc(size_t len)
67 {
68     return HeapAlloc(GetProcessHeap(), 0, len);
69 }
70 
71 static inline void *heap_realloc(void *mem, size_t len)
72 {
73     return HeapReAlloc(GetProcessHeap(), 0, mem, len);
74 }
75 
76 static inline BOOL heap_free(void *mem)
77 {
78     return HeapFree(GetProcessHeap(), 0, mem);
79 }
80 
81 static inline WCHAR *heap_strdupAtoW(const char *str)
82 {
83     WCHAR *ret = NULL;
84 
85     if(str) {
86         size_t len;
87 
88         len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
89         ret = heap_alloc(len*sizeof(WCHAR));
90         if(ret)
91             MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
92     }
93 
94     return ret;
95 }
96 
97 #endif /* _APPWIZ_H */
98