2 * Interface code to COMBOBOX widget
4 * Copyright Martin Ayotte, 1993
6 static char Copyright[] = "Copyright Martin Ayotte, 1993";
11 #include <sys/types.h>
19 #include "prototypes.h"
21 /* #define DEBUG_COMBO */
25 HBITMAP hComboBit
= 0;
27 LPHEADCOMBO
ComboGetStorageHeader(HWND hwnd
);
28 int CreateComboStruct(HWND hwnd
);
29 void ComboBoxStaticOwnerDraw(HWND hWnd
, LPHEADCOMBO lphc
);
32 /***********************************************************************
35 LONG
ComboBoxWndProc( HWND hwnd
, WORD message
, WORD wParam
, LONG lParam
)
45 PAINTSTRUCT paintstruct
;
46 LPDRAWITEMSTRUCT lpdis
;
50 wndPtr
= WIN_FindWndPtr(hwnd
);
51 if (wndPtr
== NULL
) return 0;
52 dprintf_combo(stddeb
,"Combo WM_CREATE %d !\n", hwnd
);
53 if (hComboBit
== (HBITMAP
)NULL
)
54 hComboBit
= LoadBitmap((HINSTANCE
)NULL
, MAKEINTRESOURCE(OBM_COMBO
));
55 GetObject(hComboBit
, sizeof(BITMAP
), (LPSTR
)&bm
);
56 wndPtr
->dwStyle
&= 0xFFFFFFFFL
^ (WS_VSCROLL
| WS_HSCROLL
);
57 GetWindowRect(hwnd
, &rect
);
58 width
= rect
.right
- rect
.left
;
59 height
= rect
.bottom
- rect
.top
;
60 if (height
< bm
.bmHeight
) height
= bm
.bmHeight
;
61 /* SetWindowPos(hwnd, 0, 0, 0, width + bm.bmHeight, bm.bmHeight,
62 SWP_NOMOVE | SWP_NOZORDER); */
63 SetWindowPos(hwnd
, 0, 0, 0, width
, bm
.bmHeight
,
64 SWP_NOMOVE
| SWP_NOZORDER
);
65 CreateComboStruct(hwnd
);
66 lphc
= ComboGetStorageHeader(hwnd
);
67 if (lphc
== NULL
) return 0;
68 /* SetRect(&lphc->RectEdit, 0, 0, width - 2, bm.bmHeight); */
69 SetRect(&lphc
->RectEdit
, 0, 0, width
- bm
.bmHeight
, bm
.bmHeight
);
70 if (wndPtr
->dwStyle
& CBS_DROPDOWNLIST
) {
71 if ((wndPtr
->dwStyle
& CBS_OWNERDRAWFIXED
) == CBS_OWNERDRAWFIXED
||
72 (wndPtr
->dwStyle
& CBS_OWNERDRAWVARIABLE
) == CBS_OWNERDRAWVARIABLE
)
75 lphc
->hWndEdit
= CreateWindow("STATIC", "",
76 WS_CHILD
| WS_CLIPCHILDREN
| WS_VISIBLE
| SS_LEFT
,
77 0, 0, width
- bm
.bmHeight
, bm
.bmHeight
,
78 hwnd
, 1, wndPtr
->hInstance
, 0L);
81 /* lphc->hWndEdit = CreateWindow("EDIT", "", */
82 lphc
->hWndEdit
= CreateWindow("STATIC", "",
83 WS_CHILD
| WS_CLIPCHILDREN
| WS_VISIBLE
| SS_LEFT
,
84 0, 0, width
- bm
.bmHeight
, bm
.bmHeight
,
85 hwnd
, 1, wndPtr
->hInstance
, 0L);
87 dwStyle
= WS_POPUP
| WS_BORDER
| WS_VSCROLL
| LBS_NOTIFY
;
88 if ((wndPtr
->dwStyle
& CBS_HASSTRINGS
) == CBS_HASSTRINGS
)
89 dwStyle
|= LBS_HASSTRINGS
;
90 if ((wndPtr
->dwStyle
& CBS_SORT
) == CBS_SORT
)
92 if ((wndPtr
->dwStyle
& CBS_OWNERDRAWFIXED
) == CBS_OWNERDRAWFIXED
)
93 dwStyle
|= LBS_OWNERDRAWFIXED
;
94 if ((wndPtr
->dwStyle
& CBS_OWNERDRAWVARIABLE
) == CBS_OWNERDRAWVARIABLE
)
95 dwStyle
|= LBS_OWNERDRAWVARIABLE
;
96 lphc
->hWndLBox
= CreateWindow("LISTBOX", "", dwStyle
,
97 rect
.left
, rect
.top
+ bm
.bmHeight
,
98 width
, height
, wndPtr
->hwndParent
, 0,
99 wndPtr
->hInstance
, (LPSTR
)MAKELONG(0, hwnd
));
100 ShowWindow(lphc
->hWndLBox
, SW_HIDE
);
101 dprintf_combo(stddeb
,"Combo Creation LBox=%X!\n", lphc
->hWndLBox
);
104 lphc
= ComboGetStorageHeader(hwnd
);
105 if (lphc
== 0) return 0;
107 if (lphc->hWndEdit != 0) DestroyWindow(lphc->hWndEdit);
109 DestroyWindow(lphc
->hWndLBox
);
112 *((LPHEADCOMBO *)&wndPtr->wExtra[1]) = 0;
113 printf("Combo WM_DESTROY after clearing wExtra !\n");
115 dprintf_combo(stddeb
,"Combo WM_DESTROY %p !\n", lphc
);
116 return DefWindowProc( hwnd
, message
, wParam
, lParam
);
118 dprintf_combo(stddeb
,"ComboBox WM_SHOWWINDOW hWnd=%04X !\n",
120 if (!(wParam
== 0 && lParam
== 0L)) {
121 InvalidateRect(hwnd
, NULL
, TRUE
);
126 wndPtr
= WIN_FindWndPtr(hwnd
);
127 lphc
= ComboGetStorageHeader(hwnd
);
128 if (lphc
== NULL
|| wndPtr
== NULL
) return 0;
129 if (LOWORD(lParam
) == lphc
->hWndLBox
) {
130 switch(HIWORD(lParam
)) {
132 lphc
->dwState
= lphc
->dwState
& (CB_SHOWDROPDOWN
^ 0xFFFFFFFFL
);
133 ShowWindow(lphc
->hWndLBox
, SW_HIDE
);
134 y
= SendMessage(lphc
->hWndLBox
, LB_GETCURSEL
, 0, 0L);
136 SendMessage(lphc
->hWndLBox
, LB_GETTEXT
, (WORD
)y
, (LPARAM
)str
);
137 if (lphc
->hWndEdit
!= 0)
138 SendMessage(lphc
->hWndEdit
, WM_SETTEXT
, (WORD
)y
, (LPARAM
)str
);
140 InvalidateRect(hwnd
, NULL
, TRUE
);
144 SendMessage(GetParent(hwnd
), WM_COMMAND
, wndPtr
->wIDmenu
,
145 MAKELONG(hwnd
, CBN_SELCHANGE
));
148 SendMessage(GetParent(hwnd
), WM_COMMAND
, wndPtr
->wIDmenu
,
149 MAKELONG(hwnd
, CBN_DBLCLK
));
155 dprintf_combo(stddeb
,"Combo WM_LBUTTONDOWN wParam=%x lParam=%lX !\n", wParam
, lParam
);
156 GetClientRect(hwnd
, &rect
);
157 rect
.left
= rect
.right
- (rect
.bottom
- rect
.top
);
159 InflateRect(&rect
, -1, -1);
160 GRAPH_DrawReliefRect(hDC
, &rect
, 1, 1, TRUE
);
161 ReleaseDC(hwnd
, hDC
);
162 wndPtr
= WIN_FindWndPtr(hwnd
);
163 lphc
= ComboGetStorageHeader(hwnd
);
164 if (lphc
== NULL
) return 0;
165 lphc
->dwState
= lphc
->dwState
^ CB_SHOWDROPDOWN
;
166 if ((lphc
->dwState
& CB_SHOWDROPDOWN
) == CB_SHOWDROPDOWN
) {
167 ShowWindow(lphc
->hWndLBox
, SW_SHOW
);
168 SetFocus(lphc
->hWndLBox
);
171 dprintf_combo(stddeb
,"before Combo Restore Focus !\n");
172 SetFocus(lphc
->hWndEdit
);
173 dprintf_combo(stddeb
,"before Combo List Hide !\n");
174 ShowWindow(lphc
->hWndLBox
, SW_HIDE
);
175 dprintf_combo(stddeb
,"before Combo List GetCurSel !\n");
176 y
= SendMessage(lphc
->hWndLBox
, LB_GETCURSEL
, 0, 0L);
178 dprintf_combo(stddeb
,"before Combo List GetText !\n");
179 SendMessage(lphc
->hWndLBox
, LB_GETTEXT
, (WORD
)y
, (LPARAM
)str
);
180 SendMessage(lphc
->hWndEdit
, WM_SETTEXT
, (WORD
)y
, (LPARAM
)str
);
182 dprintf_combo(stddeb
,"End of Combo List Hide !\n");
186 dprintf_combo(stddeb
,"Combo WM_LBUTTONUP wParam=%x lParam=%lX !\n", wParam
, lParam
);
187 GetClientRect(hwnd
, &rect
);
188 rect
.left
= rect
.right
- (rect
.bottom
- rect
.top
);
190 InflateRect(&rect
, -1, -1);
191 GRAPH_DrawReliefRect(hDC
, &rect
, 1, 1, FALSE
);
192 ReleaseDC(hwnd
, hDC
);
195 wndPtr
= WIN_FindWndPtr(hwnd
);
196 lphc
= ComboGetStorageHeader(hwnd
);
197 if (lphc
== NULL
|| wndPtr
== NULL
) return 0;
198 y
= SendMessage(lphc
->hWndLBox
, LB_GETCURSEL
, 0, 0L);
199 count
= SendMessage(lphc
->hWndLBox
, LB_GETCOUNT
, 0, 0L);
200 dprintf_combo(stddeb
,"COMBOBOX // GetKeyState(VK_MENU)=%d\n", GetKeyState(VK_MENU
));
201 if (GetKeyState(VK_MENU
) < 0) {
202 lphc
->dwState
= lphc
->dwState
^ CB_SHOWDROPDOWN
;
203 if ((lphc
->dwState
& CB_SHOWDROPDOWN
) == CB_SHOWDROPDOWN
) {
204 GetWindowRect(hwnd
, &rect
);
205 SetWindowPos(lphc
->hWndLBox
, 0, rect
.left
, rect
.bottom
, 0, 0,
206 SWP_NOREDRAW
| SWP_NOSIZE
);
207 SetWindowPos(lphc
->hWndLBox
, 0, 0, 0, 0, 0, SWP_SHOWWINDOW
|
208 SWP_NOMOVE
| SWP_NOSIZE
| SWP_NOZORDER
);
209 SetFocus(lphc
->hWndLBox
);
212 ShowWindow(lphc
->hWndLBox
, SW_HIDE
);
213 y
= SendMessage(lphc
->hWndLBox
, LB_GETCURSEL
, 0, 0L);
215 SendMessage(lphc
->hWndLBox
, LB_GETTEXT
, (WORD
)y
, (LPARAM
)str
);
216 if (lphc
->hWndEdit
!= 0)
217 SendMessage(lphc
->hWndEdit
, WM_SETTEXT
, (WORD
)y
, (LPARAM
)str
);
237 if (y
>= count
) y
= count
- 1;
239 SendMessage(lphc
->hWndLBox
, LB_SETCURSEL
, y
, 0L);
240 SendMessage(lphc
->hWndLBox
, LB_GETTEXT
, (WORD
)y
, (LPARAM
)str
);
241 if (lphc
->hWndEdit
!= 0)
242 SendMessage(lphc
->hWndEdit
, WM_SETTEXT
, (WORD
)y
, (LPARAM
)str
);
243 SendMessage(GetParent(hwnd
), WM_COMMAND
, wndPtr
->wIDmenu
,
244 MAKELONG(hwnd
, CBN_SELCHANGE
));
248 dprintf_combo(stddeb
,"ComboBoxWndProc WM_MEASUREITEM !\n");
249 return(SendMessage(GetParent(hwnd
), WM_MEASUREITEM
, wParam
, lParam
));
251 return(SendMessage(GetParent(hwnd
), WM_CTLCOLOR
, wParam
, lParam
));
253 dprintf_combo(stddeb
,"ComboBoxWndProc WM_SETREDRAW hWnd=%04X w=%04X !\n", hwnd
, wParam
);
254 lphc
= ComboGetStorageHeader(hwnd
);
255 if (lphc
== NULL
) return 0;
256 lphc
->bRedrawFlag
= wParam
;
259 dprintf_combo(stddeb
,"ComboBoxWndProc // WM_DRAWITEM w=%04X l=%08lX\n", wParam
, lParam
);
260 wndPtr
= WIN_FindWndPtr(hwnd
);
261 if (wndPtr
== NULL
) break;
262 lpdis
= (LPDRAWITEMSTRUCT
)lParam
;
263 if (lpdis
== NULL
) break;
264 lpdis
->CtlType
= ODT_COMBOBOX
;
265 lpdis
->CtlID
= wndPtr
->wIDmenu
;
266 return(SendMessage(GetParent(hwnd
), WM_DRAWITEM
, wParam
, lParam
));
268 GetClientRect(hwnd
, &rect
);
269 hDC
= BeginPaint(hwnd
, &paintstruct
);
270 if (hComboBit
!= 0) {
271 GetObject(hComboBit
, sizeof(BITMAP
), (LPSTR
)&bm
);
272 GRAPH_DrawBitmap( hDC
, hComboBit
,
273 rect
.right
- bm
.bmWidth
, 0,
274 0, 0, bm
.bmWidth
, bm
.bmHeight
,
277 EndPaint(hwnd
, &paintstruct
);
278 lphc
= ComboGetStorageHeader(hwnd
);
279 if (lphc
== NULL
) return 0;
280 if (lphc
->hWndEdit
!= 0) {
281 InvalidateRect(lphc
->hWndEdit
, NULL
, TRUE
);
282 UpdateWindow(lphc
->hWndEdit
);
285 ComboBoxStaticOwnerDraw(hwnd
, lphc
);
287 if ((lphc
->dwState
& CB_SHOWDROPDOWN
) == CB_SHOWDROPDOWN
) {
288 InvalidateRect(lphc
->hWndLBox
, NULL
, TRUE
);
289 UpdateWindow(lphc
->hWndLBox
);
293 lphc
= ComboGetStorageHeader(hwnd
);
294 if (lphc
== NULL
) return 0;
295 if (lphc
->hWndEdit
!= 0)
296 SetFocus(lphc
->hWndEdit
);
299 lphc
= ComboGetStorageHeader(hwnd
);
300 if (lphc
== NULL
) return 0;
301 ShowWindow(lphc
->hWndLBox
, SW_HIDE
);
302 y
= SendMessage(lphc
->hWndLBox
, LB_GETCURSEL
, 0, 0L);
304 SendMessage(lphc
->hWndLBox
, LB_GETTEXT
, (WORD
)y
, (LPARAM
)str
);
305 if (lphc
->hWndEdit
!= 0)
306 SendMessage(lphc
->hWndEdit
, WM_SETTEXT
, (WORD
)y
, (LPARAM
)str
);
310 dprintf_combo(stddeb
,"CB_ADDSTRING '%s' !\n", (LPSTR
)lParam
);
311 lphc
= ComboGetStorageHeader(hwnd
);
312 if (lphc
== NULL
) return 0;
313 return(SendMessage(lphc
->hWndLBox
, LB_ADDSTRING
, wParam
, lParam
));
315 dprintf_combo(stddeb
,"CB_GETLBTEXT #%u !\n", wParam
);
316 lphc
= ComboGetStorageHeader(hwnd
);
317 if (lphc
== NULL
) return 0;
318 return(SendMessage(lphc
->hWndLBox
, LB_GETTEXT
, wParam
, lParam
));
319 case CB_GETLBTEXTLEN
:
320 dprintf_combo(stddeb
,"CB_GETLBTEXTLEN !\n");
321 lphc
= ComboGetStorageHeader(hwnd
);
322 if (lphc
== NULL
) return 0;
323 return(SendMessage(lphc
->hWndLBox
, LB_GETTEXTLEN
, wParam
, lParam
));
324 case CB_INSERTSTRING
:
325 dprintf_combo(stddeb
,"CB_INSERTSTRING '%s' !\n",(LPSTR
)lParam
);
326 lphc
= ComboGetStorageHeader(hwnd
);
327 if (lphc
== NULL
) return 0;
328 return(SendMessage(lphc
->hWndLBox
, LB_INSERTSTRING
, wParam
, lParam
));
329 case CB_DELETESTRING
:
330 dprintf_combo(stddeb
,"CB_DELETESTRING #%u !\n", wParam
);
331 lphc
= ComboGetStorageHeader(hwnd
);
332 if (lphc
== NULL
) return 0;
333 return(SendMessage(lphc
->hWndLBox
, LB_DELETESTRING
, wParam
, 0L));
334 case CB_RESETCONTENT
:
335 dprintf_combo(stddeb
,"CB_RESETCONTENT !\n");
336 lphc
= ComboGetStorageHeader(hwnd
);
337 if (lphc
== NULL
) return 0;
338 return(SendMessage(lphc
->hWndLBox
, LB_RESETCONTENT
, 0, 0L));
340 dprintf_combo(stddeb
,"ComboBox CB_DIR !\n");
341 lphc
= ComboGetStorageHeader(hwnd
);
342 if (lphc
== NULL
) return 0;
343 return(SendMessage(lphc
->hWndLBox
, LB_DIR
, wParam
, lParam
));
345 lphc
= ComboGetStorageHeader(hwnd
);
346 return(SendMessage(lphc
->hWndLBox
, LB_FINDSTRING
, wParam
, lParam
));
348 lphc
= ComboGetStorageHeader(hwnd
);
349 if (lphc
== NULL
) return 0;
350 return(SendMessage(lphc
->hWndLBox
, LB_GETCOUNT
, 0, 0L));
352 dprintf_combo(stddeb
,"ComboBox CB_GETCURSEL !\n");
353 lphc
= ComboGetStorageHeader(hwnd
);
354 if (lphc
== NULL
) return 0;
355 return(SendMessage(lphc
->hWndLBox
, LB_GETCURSEL
, 0, 0L));
357 dprintf_combo(stddeb
,"ComboBox CB_SETCURSEL wParam=%X !\n", wParam
);
358 lphc
= ComboGetStorageHeader(hwnd
);
359 if (lphc
== NULL
) return 0;
360 return(SendMessage(lphc
->hWndLBox
, LB_SETCURSEL
, wParam
, 0L));
362 dprintf_combo(stddeb
,"ComboBox CB_GETEDITSEL !\n");
363 lphc
= ComboGetStorageHeader(hwnd
);
364 if (lphc
== NULL
) return 0;
365 /* if (lphc->hWndEdit != 0)
366 return(SendMessage(lphc->hWndEdit, EM_GETSEL, 0, 0L)); */
369 dprintf_combo(stddeb
,"ComboBox CB_SETEDITSEL lParam=%lX !\n",
371 lphc
= ComboGetStorageHeader(hwnd
);
372 if (lphc
== NULL
) return 0;
373 /* if (lphc->hWndEdit != 0)
374 return(SendMessage(lphc->hWndEdit, EM_SETSEL, 0, lParam)); */
376 case CB_SELECTSTRING
:
377 dprintf_combo(stddeb
,"ComboBox CB_SELECTSTRING !\n");
378 lphc
= ComboGetStorageHeader(hwnd
);
379 if (lphc
== NULL
) return 0;
381 case CB_SHOWDROPDOWN
:
382 dprintf_combo(stddeb
,"ComboBox CB_SHOWDROPDOWN !\n");
383 lphc
= ComboGetStorageHeader(hwnd
);
384 if (lphc
== NULL
) return 0;
385 wndPtr
= WIN_FindWndPtr(hwnd
);
386 lphc
->dwState
= lphc
->dwState
| CB_SHOWDROPDOWN
;
388 GetWindowRect(hwnd
, &rect
);
389 SetWindowPos(lphc
->hWndLBox
, 0, rect
.left
, rect
.bottom
, 0, 0,
390 SWP_NOREDRAW
| SWP_NOSIZE
);
391 SetWindowPos(lphc
->hWndLBox
, 0, 0, 0, 0, 0, SWP_SHOWWINDOW
|
392 SWP_NOMOVE
| SWP_NOSIZE
| SWP_NOZORDER
);
395 lphc
->dwState
= lphc
->dwState
^ CB_SHOWDROPDOWN
;
396 ShowWindow(lphc
->hWndLBox
, SW_HIDE
);
397 SendMessage(GetParent(hwnd
), WM_COMMAND
, wndPtr
->wIDmenu
,
398 MAKELONG(hwnd
, CBN_DROPDOWN
));
402 dprintf_combo(stddeb
,"ComboBox CB_GETITEMDATA wParam=%X !\n", wParam
);
403 lphc
= ComboGetStorageHeader(hwnd
);
404 if (lphc
== NULL
) return 0;
405 return(SendMessage(lphc
->hWndLBox
, LB_GETITEMDATA
, wParam
, 0L));
408 dprintf_combo(stddeb
,"ComboBox CB_SETITEMDATA wParam=%04X lParam=%08lX!\n", wParam
, lParam
);
409 lphc
= ComboGetStorageHeader(hwnd
);
410 if (lphc
== NULL
) return 0;
411 return(SendMessage(lphc
->hWndLBox
, LB_SETITEMDATA
, wParam
, lParam
));
414 dprintf_combo(stddeb
,"ComboBox CB_LIMITTEXT !\n");
415 lphc
= ComboGetStorageHeader(hwnd
);
416 if (lphc
== NULL
) return 0;
417 /* if (lphc->hWndEdit != 0)
418 return(SendMessage(lphc->hWndEdit, EM_LIMITTEXT, wParam, 0L)); */
422 return DefWindowProc( hwnd
, message
, wParam
, lParam
);
429 LPHEADCOMBO
ComboGetStorageHeader(HWND hwnd
)
433 wndPtr
= WIN_FindWndPtr(hwnd
);
435 fprintf(stderr
,"Bad Window handle on ComboBox !\n");
438 lphc
= *((LPHEADCOMBO
*)&wndPtr
->wExtra
[1]);
444 int CreateComboStruct(HWND hwnd
)
448 wndPtr
= WIN_FindWndPtr(hwnd
);
450 fprintf(stderr
,"Bad Window handle on ComboBox !\n");
453 lphc
= (LPHEADCOMBO
)malloc(sizeof(HEADCOMBO
));
454 *((LPHEADCOMBO
*)&wndPtr
->wExtra
[1]) = lphc
;
463 void ComboBoxStaticOwnerDraw(HWND hWnd
, LPHEADCOMBO lphc
)
472 LPDRAWITEMSTRUCT lpdis
;
473 dprintf_combo(stddeb
,"ComboBoxStaticOwnerDraw(%04X, %p) !\n", hWnd
, lphc
);
474 y
= SendMessage(lphc
->hWndLBox
, LB_GETCURSEL
, 0, 0L);
476 SendMessage(lphc
->hWndLBox
, LB_GETTEXT
, y
, (LPARAM
)str
);
477 ptr
= (LPSTR
)SendMessage(lphc
->hWndLBox
, LB_GETITEMDATA
, y
, 0L);
480 hBrush
= SendMessage(GetParent(hWnd
), WM_CTLCOLOR
, (WORD
)hDC
,
481 MAKELONG(hWnd
, CTLCOLOR_STATIC
));
482 if (hBrush
== (HBRUSH
)NULL
) hBrush
= GetStockObject(WHITE_BRUSH
);
483 wndPtr
= WIN_FindWndPtr(hWnd
);
484 if (wndPtr
== NULL
) return;
485 hTemp
= USER_HEAP_ALLOC(GMEM_MOVEABLE
, sizeof(DRAWITEMSTRUCT
));
486 lpdis
= (LPDRAWITEMSTRUCT
) USER_HEAP_ADDR(hTemp
);
488 printf("ComboBox Ownerdraw // Error allocating DRAWITEMSTRUCT !\n");
489 ReleaseDC( hWnd
, hDC
);
492 FillRect(hDC
, &lphc
->RectEdit
, hBrush
);
494 if (y
!= LB_ERR
) lpdis
->itemID
= y
- 1;
495 CopyRect(&lpdis
->rcItem
, &lphc
->RectEdit
);
496 lpdis
->itemData
= (DWORD
)ptr
;
497 lpdis
->itemAction
= ODA_DRAWENTIRE
;
498 lpdis
->CtlType
= ODT_COMBOBOX
;
499 lpdis
->CtlID
= wndPtr
->wIDmenu
;
500 SendMessage(GetParent(hWnd
), WM_DRAWITEM
, y
, (LPARAM
)lpdis
);
501 USER_HEAP_FREE(hTemp
);
502 ReleaseDC(hWnd
, hDC
);
506 /************************************************************************
507 * DlgDirSelectComboBox [USER.194]
509 BOOL
DlgDirSelectComboBox(HWND hDlg
, LPSTR lpStr
, int nIDLBox
)
511 fprintf(stdnimp
,"DlgDirSelectComboBox(%04X, '%s', %d) \n",
512 hDlg
, lpStr
, nIDLBox
);
517 /************************************************************************
518 * DlgDirListComboBox [USER.195]
520 int DlgDirListComboBox(HWND hDlg
, LPSTR lpPathSpec
,
521 int nIDLBox
, int nIDStat
, WORD wType
)
525 dprintf_combo(stddeb
,"DlgDirListComboBox(%04X, '%s', %d, %d, %04X) \n",
526 hDlg
, lpPathSpec
, nIDLBox
, nIDStat
, wType
);
527 hWnd
= GetDlgItem(hDlg
, nIDLBox
);
528 lphc
= ComboGetStorageHeader(hWnd
);
529 if (lphc
== NULL
) return 0;
530 SendMessage(lphc
->hWndLBox
, LB_RESETCONTENT
, 0, 0L);
531 return SendMessage(lphc
->hWndLBox
, LB_DIR
, wType
, (DWORD
)lpPathSpec
);