xref: /reactos/dll/cpl/appwiz/appwiz.h (revision a6726659)
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[MAX_PATH];
31    WCHAR szWorkingDirectory[MAX_PATH];
32    WCHAR szDescription[MAX_PATH];
33    WCHAR szOrigin[MAX_PATH];
34    WCHAR szOldFile[MAX_PATH];
35    WCHAR szLinkName[MAX_PATH];
36 } CREATE_LINK_CONTEXT, *PCREATE_LINK_CONTEXT;
37 
38 extern HINSTANCE hApplet;
39 
40 /* createlink.c */
41 INT_PTR CALLBACK
42 WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
43 
44 INT_PTR CALLBACK
45 FinishDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
46 
47 LONG CALLBACK
48 NewLinkHere(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
49 
50 /* removestartmenuitems.c */
51 LONG CALLBACK
52 ConfigStartMenu(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
53 
54 void ShowLastWin32Error(HWND hWndOwner);
55 
56 typedef enum {
57     ADDON_GECKO,
58     ADDON_MONO
59 } addon_t;
60 
61 BOOL install_addon(addon_t, HWND hwnd_parent) DECLSPEC_HIDDEN;
62 
63 extern HINSTANCE hInst DECLSPEC_HIDDEN;
64 
65 static inline void *heap_alloc(size_t len)
66 {
67     return HeapAlloc(GetProcessHeap(), 0, len);
68 }
69 
70 static inline void *heap_realloc(void *mem, size_t len)
71 {
72     return HeapReAlloc(GetProcessHeap(), 0, mem, len);
73 }
74 
75 static inline BOOL heap_free(void *mem)
76 {
77     return HeapFree(GetProcessHeap(), 0, mem);
78 }
79 
80 static inline WCHAR *heap_strdupAtoW(const char *str)
81 {
82     WCHAR *ret = NULL;
83 
84     if(str) {
85         size_t len;
86 
87         len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
88         ret = heap_alloc(len*sizeof(WCHAR));
89         if(ret)
90             MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
91     }
92 
93     return ret;
94 }
95 
96 #endif /* _APPWIZ_H */
97