source: trunk/src/comdlg32/comdlg32.cpp@ 46

Last change on this file since 46 was 46, checked in by sandervl, 26 years ago

* empty log message *

File size: 9.5 KB
Line 
1/*
2 * COMDLG32 implementation
3 *
4 * Copyright 1998 Sander van Leeuwen
5 *
6 *
7 * Project Odin Software License can be found in LICENSE.TXT
8 *
9 */
10#include <os2win.h>
11#include <stdarg.h>
12#include <misc.h>
13#include <wndproc.h>
14
15//******************************************************************************
16//TODO:template names in structures!!!!
17//******************************************************************************
18BOOL WIN32API GetSaveFileNameA(LPOPENFILENAMEA lpofn)
19{
20 Win32WindowProc *wndproc;
21
22 if(lpofn->Flags & OFN_ENABLEHOOK) {
23 wndproc = CreateWindowProc(lpofn->lpfnHook);
24 if(wndproc == NULL)
25 return(FALSE);
26
27 lpofn->lpfnHook = (WNDPROC)Win32WindowProc::GetOS2Callback();
28 }
29#ifdef DEBUG
30 WriteLog("GetSaveFileName\n");
31#endif
32 return(O32_GetSaveFileName(lpofn));
33}
34//******************************************************************************
35//******************************************************************************
36BOOL WIN32API GetOpenFileNameA(LPOPENFILENAMEA lpofn)
37{
38 Win32WindowProc *wndproc;
39
40 if(lpofn->Flags & OFN_ENABLEHOOK) {
41 wndproc = CreateWindowProc(lpofn->lpfnHook);
42 if(wndproc == NULL)
43 return(FALSE);
44
45 lpofn->lpfnHook = (WNDPROC)Win32WindowProc::GetOS2Callback();
46 }
47#ifdef DEBUG
48 WriteLog("GetOpenFileNameA\n");
49#endif
50 return O32_GetOpenFileName(lpofn);
51}
52//******************************************************************************
53//******************************************************************************
54INT16 WIN32API GetFileTitleA(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf)
55{
56#ifdef DEBUG
57 WriteLog("GetFileTitle\n");
58#endif
59 return O32_GetFileTitle(lpFile, lpTitle, cbBuf);
60}
61//******************************************************************************
62//******************************************************************************
63BOOL WIN32API ChooseColorA(LPCHOOSECOLORA lpcc)
64{
65 Win32WindowProc *wndproc;
66
67 if(lpcc->Flags & CC_ENABLEHOOK) {
68 wndproc = CreateWindowProc((WNDPROC)lpcc->lpfnHook);
69 if(wndproc == NULL)
70 return(FALSE);
71
72 lpcc->lpfnHook = (LPCCHOOKPROC)Win32WindowProc::GetOS2Callback();
73 }
74#ifdef DEBUG
75 WriteLog("OS2ChooseColorA");
76#endif
77 return O32_ChooseColor(lpcc);
78}
79//******************************************************************************
80//******************************************************************************
81BOOL WIN32API ChooseColorW(LPCHOOSECOLORW lpcc)
82{
83 Win32WindowProc *wndproc;
84
85 if(lpcc->Flags & CC_ENABLEHOOK) {
86 wndproc = CreateWindowProc((WNDPROC)lpcc->lpfnHook);
87 if(wndproc == NULL)
88 return(FALSE);
89
90 lpcc->lpfnHook = (LPCCHOOKPROC)Win32WindowProc::GetOS2Callback();
91 }
92#ifdef DEBUG
93 WriteLog("OS2ChooseColorW");
94#endif
95 // NOTE: This will not work as is (needs UNICODE support)
96// return O32_ChooseColor(lpcc);
97 return 0;
98}
99//******************************************************************************
100//******************************************************************************
101BOOL WIN32API ChooseFontA(LPCHOOSEFONTA lpcf)
102{
103 Win32WindowProc *wndproc;
104
105 if(lpcf->Flags & CF_ENABLEHOOK) {
106 wndproc = CreateWindowProc((WNDPROC)lpcf->lpfnHook);
107 if(wndproc == NULL)
108 return(FALSE);
109
110 lpcf->lpfnHook = (WNDPROC)Win32WindowProc::GetOS2Callback();
111 }
112#ifdef DEBUG
113 WriteLog("OS2ChooseFontA");
114#endif
115 return O32_ChooseFont(lpcf);
116}
117//******************************************************************************
118//******************************************************************************
119BOOL WIN32API ChooseFontW(LPCHOOSEFONTW lpcf)
120{
121 Win32WindowProc *wndproc;
122
123 if(lpcf->Flags & CF_ENABLEHOOK) {
124 wndproc = CreateWindowProc((WNDPROC)lpcf->lpfnHook);
125 if(wndproc == NULL)
126 return(FALSE);
127
128 lpcf->lpfnHook = (WNDPROC)Win32WindowProc::GetOS2Callback();
129 }
130#ifdef DEBUG
131 WriteLog("OS2ChooseFontW");
132#endif
133 // NOTE: This will not work as is (needs UNICODE support)
134// return O32_ChooseFont(lpcf);
135 return 0;
136}
137//******************************************************************************
138//******************************************************************************
139DWORD WIN32API CommDlgExtendedError(void)
140{
141#ifdef DEBUG
142 WriteLog("OS2CommDlgExtendedError");
143#endif
144 return O32_CommDlgExtendedError();
145}
146//******************************************************************************
147//******************************************************************************
148HWND WIN32API FindTextA(LPFINDREPLACEA lpfr)
149{
150 Win32WindowProc *wndproc;
151
152 if(lpfr->Flags & FR_ENABLEHOOK) {
153 wndproc = CreateWindowProc((WNDPROC)lpfr->lpfnHook);
154 if(wndproc == NULL)
155 return(FALSE);
156
157 lpfr->lpfnHook = (WNDPROC)Win32WindowProc::GetOS2Callback();
158 }
159#ifdef DEBUG
160 WriteLog("OS2FindTextA");
161#endif
162 return O32_FindText(lpfr);
163}
164//******************************************************************************
165//******************************************************************************
166HWND WIN32API FindTextW(LPFINDREPLACEW lpfr)
167{
168 Win32WindowProc *wndproc;
169
170 if(lpfr->Flags & FR_ENABLEHOOK) {
171 wndproc = CreateWindowProc((WNDPROC)lpfr->lpfnHook);
172 if(wndproc == NULL)
173 return(FALSE);
174
175 lpfr->lpfnHook = (WNDPROC)Win32WindowProc::GetOS2Callback();
176 }
177#ifdef DEBUG
178 WriteLog("OS2FindTextW");
179#endif
180 // NOTE: This will not work as is (needs UNICODE support)
181// return O32_FindText(lpfr);
182 return 0;
183}
184//******************************************************************************
185//******************************************************************************
186INT16 WIN32API GetFileTitleW(LPCWSTR lpFile, LPWSTR lpTitle, UINT cbBuf)
187{
188#ifdef DEBUG
189 WriteLog("OS2GetFileTitleW");
190#endif
191 // NOTE: This will not work as is (needs UNICODE support)
192// return O32_GetFileTitle(arg1, arg2, arg3);
193 return 0;
194}
195//******************************************************************************
196//******************************************************************************
197BOOL WIN32API GetOpenFileNameW(LPOPENFILENAMEW lpofn)
198{
199 Win32WindowProc *wndproc;
200
201 if(lpofn->Flags & OFN_ENABLEHOOK) {
202 wndproc = CreateWindowProc((WNDPROC)lpofn->lpfnHook);
203 if(wndproc == NULL)
204 return(FALSE);
205
206 lpofn->lpfnHook = (WNDPROC)Win32WindowProc::GetOS2Callback();
207 }
208#ifdef DEBUG
209 WriteLog("OS2GetOpenFileNameW");
210#endif
211 // NOTE: This will not work as is (needs UNICODE support)
212// return O32_GetOpenFileName(lpofn);
213 return 0;
214}
215//******************************************************************************
216//******************************************************************************
217BOOL WIN32API GetSaveFileNameW(LPOPENFILENAMEW lpofn)
218{
219 Win32WindowProc *wndproc;
220
221 if(lpofn->Flags & OFN_ENABLEHOOK) {
222 wndproc = CreateWindowProc((WNDPROC)lpofn->lpfnHook);
223 if(wndproc == NULL)
224 return(FALSE);
225
226 lpofn->lpfnHook = (WNDPROC)Win32WindowProc::GetOS2Callback();
227 }
228#ifdef DEBUG
229 WriteLog("OS2GetSaveFileNameW");
230#endif
231 // NOTE: This will not work as is (needs UNICODE support)
232// return O32_GetSaveFileName((LPOPENFILENAMEA)lpofn);
233 return 0;
234}
235//******************************************************************************
236//todo: hooks
237//******************************************************************************
238BOOL WIN32API PrintDlgA(LPPRINTDLGA lppd)
239{
240#ifdef DEBUG
241 WriteLog("OS2PrintDlgA");
242#endif
243 return O32_PrintDlg(lppd);
244}
245//******************************************************************************
246//todo: hooks
247//******************************************************************************
248BOOL WIN32API PrintDlgW( LPPRINTDLGW arg1)
249{
250#ifdef DEBUG
251 WriteLog("OS2PrintDlgW");
252#endif
253 // NOTE: This will not work as is (needs UNICODE support)
254// return PrintDlg(arg1);
255 return FALSE;
256}
257//******************************************************************************
258//******************************************************************************
259HWND WIN32API ReplaceTextA(LPFINDREPLACEA lpfr)
260{
261 Win32WindowProc *wndproc;
262
263 if(lpfr->Flags & FR_ENABLEHOOK) {
264 wndproc = CreateWindowProc((WNDPROC)lpfr->lpfnHook);
265 if(wndproc == NULL)
266 return(FALSE);
267
268 lpfr->lpfnHook = (WNDPROC)Win32WindowProc::GetOS2Callback();
269 }
270#ifdef DEBUG
271 WriteLog("OS2ReplaceTextA");
272#endif
273 return O32_ReplaceText(lpfr);
274}
275//******************************************************************************
276//******************************************************************************
277HWND WIN32API ReplaceTextW(LPFINDREPLACEW lpfr)
278{
279 Win32WindowProc *wndproc;
280
281 if(lpfr->Flags & FR_ENABLEHOOK) {
282 wndproc = CreateWindowProc((WNDPROC)lpfr->lpfnHook);
283 if(wndproc == NULL)
284 return(FALSE);
285
286 lpfr->lpfnHook = (WNDPROC)Win32WindowProc::GetOS2Callback();
287 }
288#ifdef DEBUG
289 WriteLog("OS2ReplaceTextW");
290#endif
291 // NOTE: This will not work as is (needs UNICODE support)
292// return O32_ReplaceText(lpfr);
293 return 0;
294}
295//******************************************************************************
296//******************************************************************************
297BOOL WIN32API PageSetupDlgA(LPPAGESETUPDLGA lppsd)
298{
299#ifdef DEBUG
300 WriteLog("OS2PageSetupDlgA not implemented");
301#endif
302 return(FALSE);
303}
304//******************************************************************************
305//******************************************************************************
306BOOL WIN32API PageSetupDlgW(LPPAGESETUPDLGW lppsd)
307{
308#ifdef DEBUG
309 WriteLog("OS2PageSetupDlgW not implemented");
310#endif
311 return(FALSE);
312}
313//******************************************************************************
314//******************************************************************************
Note: See TracBrowser for help on using the repository browser.