Release 960717
[wine/multimedia.git] / controls / combo.c
blob989c0b23dc1ad5b6d950758d66cddb8ffdc49b4c
1 /*
2 * Combo controls
3 *
4 * Copyright 1993 Martin Ayotte
5 * Copyright 1995 Bernd Schmidt
6 * Copyright 1996 Albrecht Kleine [some fixes]
7 *
8 */
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13 #include <sys/types.h>
14 #include <sys/stat.h>
16 #include "windows.h"
17 #include "sysmetrics.h"
18 #include "combo.h"
19 #include "stackframe.h"
20 #include "user.h"
21 #include "win.h"
22 #include "graphics.h"
23 #include "heap.h"
24 #include "listbox.h"
25 #include "dos_fs.h"
26 #include "drive.h"
27 #include "stddebug.h"
28 #include "debug.h"
29 #include "xmalloc.h"
32 * Note: Combos are probably implemented in a different way by Windows.
33 * Using a message spy for Windows, you can see some undocumented
34 * messages being passed between ComboBox and ComboLBox.
35 * I hope no programs rely on the implementation of combos.
38 #define ID_EDIT 1
39 #define ID_CLB 2
40 #define CBLMM_EDGE 4 /* distance inside box which is same as moving mouse
41 outside box, to trigger scrolling of CBL */
43 static BOOL CBCheckSize(HWND hwnd);
44 static BOOL CBLCheckSize(HWND hwnd);
46 static HBITMAP hComboBit = 0;
47 static WORD CBitHeight, CBitWidth;
49 static int COMBO_Init()
51 BITMAP16 bm;
53 dprintf_combo(stddeb, "COMBO_Init\n");
54 hComboBit = LoadBitmap16(0, MAKEINTRESOURCE(OBM_COMBO));
55 GetObject16( hComboBit, sizeof(bm), &bm );
56 CBitHeight = bm.bmHeight;
57 CBitWidth = bm.bmWidth;
58 return 0;
61 LPHEADCOMBO ComboGetStorageHeader(HWND hwnd)
63 return (LPHEADCOMBO)GetWindowLong32A(hwnd,4);
66 LPHEADLIST ComboGetListHeader(HWND hwnd)
68 return (LPHEADLIST)GetWindowLong32A(hwnd,0);
71 int CreateComboStruct(HWND hwnd, LONG style)
73 LPHEADCOMBO lphc;
75 lphc = (LPHEADCOMBO)xmalloc(sizeof(HEADCOMBO));
76 SetWindowLong32A(hwnd,4,(LONG)lphc);
77 lphc->hWndEdit = 0;
78 lphc->hWndLBox = 0;
79 lphc->dwState = 0;
80 lphc->LastSel = -1;
81 lphc->dwStyle = style;
82 lphc->DropDownVisible = FALSE;
83 return TRUE;
86 void ComboUpdateWindow(HWND hwnd, LPHEADLIST lphl, LPHEADCOMBO lphc, BOOL repaint)
88 WND *wndPtr = WIN_FindWndPtr(hwnd);
90 if (wndPtr->dwStyle & WS_VSCROLL)
91 SetScrollRange(lphc->hWndLBox,SB_VERT,0,ListMaxFirstVisible(lphl),TRUE);
92 if (repaint && lphl->bRedrawFlag) InvalidateRect32( hwnd, NULL, TRUE );
95 /***********************************************************************
96 * CBNCCreate
98 static LRESULT CBNCCreate(HWND hwnd, WPARAM wParam, LPARAM lParam)
100 CREATESTRUCT16 *createStruct;
102 if (!hComboBit) COMBO_Init();
104 createStruct = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
105 createStruct->style |= WS_BORDER;
106 SetWindowLong32A(hwnd, GWL_STYLE, createStruct->style);
108 dprintf_combo(stddeb,"ComboBox WM_NCCREATE!\n");
109 return DefWindowProc16(hwnd, WM_NCCREATE, wParam, lParam);
113 /***********************************************************************
114 * CBCreate
116 static LRESULT CBCreate(HWND hwnd, WPARAM wParam, LPARAM lParam)
118 LPHEADLIST lphl;
119 LPHEADCOMBO lphc;
120 LONG style = 0;
121 LONG cstyle = GetWindowLong32A(hwnd,GWL_STYLE);
122 RECT16 rect,lboxrect;
123 WND* wndPtr = WIN_FindWndPtr(hwnd);
124 char className[] = "COMBOLBOX"; /* Hack so that class names are > 0x10000 */
125 char editName[] = "EDIT";
126 HWND hwndp=0;
128 /* translate combo into listbox styles */
129 cstyle |= WS_BORDER;
130 if (cstyle & CBS_OWNERDRAWFIXED) style |= LBS_OWNERDRAWFIXED;
131 if (cstyle & CBS_OWNERDRAWVARIABLE) style |= LBS_OWNERDRAWVARIABLE;
132 if (cstyle & CBS_SORT) style |= LBS_SORT;
133 if (cstyle & CBS_HASSTRINGS) style |= LBS_HASSTRINGS;
134 style |= LBS_NOTIFY;
135 CreateListBoxStruct(hwnd, ODT_COMBOBOX, style, GetParent(hwnd));
136 CreateComboStruct(hwnd,cstyle);
138 lphl = ComboGetListHeader(hwnd);
139 lphc = ComboGetStorageHeader(hwnd);
141 GetClientRect16(hwnd,&rect);
142 lphc->LBoxTop = lphl->StdItemHeight;
144 switch(cstyle & 3)
146 case CBS_SIMPLE: /* edit control, list always visible */
147 lboxrect=rect;
148 dprintf_combo(stddeb,"CBS_SIMPLE\n");
149 style= WS_BORDER | WS_CHILD | WS_VISIBLE | WS_VSCROLL;
150 SetRectEmpty16(&lphc->RectButton);
151 hwndp=hwnd;
152 break;
154 case CBS_DROPDOWNLIST: /* static control, dropdown listbox */
155 case CBS_DROPDOWN: /* edit control, dropdown listbox */
156 GetWindowRect16(hwnd,&lboxrect);
157 style = WS_POPUP | WS_BORDER | WS_VSCROLL;
158 /* FIXME: WinSight says these should be CHILD windows with the TOPMOST flag
159 * set. Wine doesn't support TOPMOST, and simply setting the WS_CHILD
160 * flag doesn't work. */
161 lphc->RectButton = rect;
162 lphc->RectButton.left = lphc->RectButton.right - 6 - CBitWidth;
163 lphc->RectButton.bottom = lphc->RectButton.top + lphl->StdItemHeight;
164 SetWindowPos(hwnd, 0, 0, 0, rect.right -rect.left + 2*SYSMETRICS_CXBORDER,
165 lphl->StdItemHeight + 2*SYSMETRICS_CYBORDER,
166 SWP_NOMOVE | SWP_NOZORDER | SWP_NOSENDCHANGING);
167 dprintf_combo(stddeb,(cstyle & 3)==CBS_DROPDOWN ? "CBS_DROPDOWN\n": "CBS_DROPDOWNLIST\n");
168 break;
170 default: fprintf(stderr,"COMBOBOX error: bad class style!\n");
171 return 0;
174 if ((cstyle & 3) != CBS_DROPDOWNLIST)
175 lphc->hWndEdit = CreateWindow16( editName, NULL,
176 WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | ES_LEFT,
177 0, 0, rect.right-6-CBitWidth,
178 lphl->StdItemHeight+2*SYSMETRICS_CYBORDER,
179 hwnd, (HMENU)ID_EDIT, WIN_GetWindowInstance(hwnd), NULL );
181 lboxrect.top+=lphc->LBoxTop;
182 lphc->hWndLBox = CreateWindow16( className, NULL, style |
183 ((cstyle & WS_HSCROLL)? WS_HSCROLL : 0) |
184 ((cstyle & WS_VSCROLL)? WS_VSCROLL : 0),
185 lboxrect.left, lboxrect.top,
186 lboxrect.right - lboxrect.left,
187 lboxrect.bottom - lboxrect.top,
188 hwndp,(HMENU)ID_CLB, WIN_GetWindowInstance(hwnd),
189 (LPVOID)(HWND32)hwnd );
191 wndPtr->dwStyle &= ~(WS_VSCROLL | WS_HSCROLL);
193 dprintf_combo( stddeb, "Combo Creation hwnd=%04x LBox=%04x Edit=%04x\n",
194 hwnd, lphc->hWndLBox, lphc->hWndEdit);
195 dprintf_combo( stddeb, " lbox %d,%d-%d,%d button %d,%d-%d,%d\n",
196 lboxrect.left, lboxrect.top, lboxrect.right, lboxrect.bottom,
197 lphc->RectButton.left, lphc->RectButton.top,
198 lphc->RectButton.right, lphc->RectButton.bottom );
199 dprintf_combo( stddeb, " client %d,%d-%d,%d window %d,%d-%d,%d\n",
200 wndPtr->rectClient.left, wndPtr->rectClient.top,
201 wndPtr->rectClient.right, wndPtr->rectClient.bottom,
202 wndPtr->rectWindow.left, wndPtr->rectWindow.top,
203 wndPtr->rectWindow.right, wndPtr->rectWindow.bottom );
204 return 0;
207 /***********************************************************************
208 * CBDestroy
210 static LRESULT CBDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam)
212 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
214 if (lphc->hWndEdit) DestroyWindow( lphc->hWndEdit );
215 if (lphc->hWndLBox) DestroyWindow( lphc->hWndLBox );
216 return 0;
219 /***********************************************************************
220 * CBPaint
222 static LRESULT CBPaint(HWND hwnd, WPARAM wParam, LPARAM lParam)
224 LPHEADLIST lphl = ComboGetListHeader(hwnd);
225 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
226 LPLISTSTRUCT lpls;
227 PAINTSTRUCT16 ps;
228 HBRUSH hBrush;
229 HFONT hOldFont;
230 HDC16 hdc;
231 RECT16 rect;
233 hdc = BeginPaint16(hwnd, &ps);
235 GetClientRect16(hwnd, &rect);
236 CBCheckSize(hwnd);
237 /* 1 for button border */
238 rect.right = lphc->RectButton.left - 1;
240 if (hComboBit != 0 && !IsRectEmpty16(&lphc->RectButton))
242 Rectangle(hdc,lphc->RectButton.left-1,lphc->RectButton.top-1,
243 lphc->RectButton.right+1,lphc->RectButton.bottom+1);
244 GRAPH_DrawReliefRect(hdc, &lphc->RectButton, 2, 2, FALSE);
245 GRAPH_DrawBitmap(hdc, hComboBit,
246 lphc->RectButton.left + 2,lphc->RectButton.top + 2,
247 0, 0, CBitWidth, CBitHeight );
249 if (!IsWindowVisible(hwnd) || !lphl->bRedrawFlag
250 || (lphc->dwStyle & 3) != CBS_DROPDOWNLIST)
252 /* we don't want to draw an entry when there is an edit control */
253 EndPaint16(hwnd, &ps);
254 return 0;
257 hOldFont = SelectObject(hdc, lphl->hFont);
259 hBrush = SendMessage32A( lphl->hParent, WM_CTLCOLORLISTBOX, hdc, hwnd );
260 if (hBrush == 0) hBrush = GetStockObject(WHITE_BRUSH);
262 lpls = ListBoxGetItem(lphl,lphl->ItemFocused);
263 if (lpls != NULL) {
264 FillRect16(hdc, &rect, hBrush);
265 ListBoxDrawItem (hwnd, lphl, hdc, lpls, &rect, ODA_DRAWENTIRE, 0);
266 if (GetFocus() == hwnd)
267 ListBoxDrawItem (hwnd,lphl, hdc, lpls, &rect, ODA_FOCUS, ODS_FOCUS);
269 else FillRect16(hdc, &rect, hBrush);
270 SelectObject(hdc,hOldFont);
271 EndPaint16(hwnd, &ps);
272 return 0;
275 /***********************************************************************
276 * CBGetDlgCode
278 static LRESULT CBGetDlgCode(HWND hwnd, WPARAM wParam, LPARAM lParam)
280 return DLGC_WANTARROWS | DLGC_WANTCHARS;
283 /***********************************************************************
284 * CBLButtonDown
286 static LRESULT CBLButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
288 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
289 SendMessage16(hwnd,CB_SHOWDROPDOWN,!lphc->DropDownVisible,0);
290 return 0;
293 /***********************************************************************
294 * CBKeyDown
296 static LRESULT CBKeyDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
298 LPHEADLIST lphl = ComboGetListHeader(hwnd);
299 WORD newFocused = lphl->ItemFocused;
301 switch(wParam) {
302 case VK_HOME:
303 newFocused = 0;
304 break;
305 case VK_END:
306 newFocused = lphl->ItemsCount - 1;
307 break;
308 case VK_UP:
309 if (newFocused > 0) newFocused--;
310 break;
311 case VK_DOWN:
312 newFocused++;
313 break;
314 default:
315 return 0;
318 if (newFocused >= lphl->ItemsCount)
319 newFocused = lphl->ItemsCount - 1;
321 ListBoxSetCurSel(lphl, newFocused);
322 SendMessage16(hwnd, WM_COMMAND,ID_CLB,MAKELONG(0,CBN_SELCHANGE));
323 ListBoxSendNotification(lphl, CBN_SELCHANGE);
325 lphl->ItemFocused = newFocused;
326 ListBoxScrollToFocus(lphl);
327 /* SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);*/
328 InvalidateRect32( hwnd, NULL, TRUE );
330 return 0;
333 /***********************************************************************
334 * CBChar
336 static LRESULT CBChar(HWND hwnd, WPARAM wParam, LPARAM lParam)
338 LPHEADLIST lphl = ComboGetListHeader(hwnd);
339 WORD newFocused;
341 newFocused = ListBoxFindNextMatch(lphl, wParam);
342 if (newFocused == (WORD)LB_ERR) return 0;
344 if (newFocused >= lphl->ItemsCount)
345 newFocused = lphl->ItemsCount - 1;
347 ListBoxSetCurSel(lphl, newFocused);
348 SendMessage16(hwnd, WM_COMMAND,ID_CLB,MAKELONG(0,CBN_SELCHANGE));
349 ListBoxSendNotification(lphl, CBN_SELCHANGE);
350 lphl->ItemFocused = newFocused;
351 ListBoxScrollToFocus(lphl);
353 /* SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);*/
354 InvalidateRect32( hwnd, NULL, TRUE );
356 return 0;
359 /***********************************************************************
360 * CBKillFocus
362 static LRESULT CBKillFocus(HWND hwnd, WPARAM wParam, LPARAM lParam)
364 return 0;
367 /***********************************************************************
368 * CBSetFocus
370 static LRESULT CBSetFocus(HWND hwnd, WPARAM wParam, LPARAM lParam)
372 return 0;
375 /***********************************************************************
376 * CBResetContent
378 static LRESULT CBResetContent(HWND hwnd, WPARAM wParam, LPARAM lParam)
380 LPHEADLIST lphl = ComboGetListHeader(hwnd);
381 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
383 ListBoxResetContent(lphl);
384 ComboUpdateWindow(hwnd, lphl, lphc, TRUE);
385 return 0;
388 /***********************************************************************
389 * CBDir
391 static LRESULT CBDir(HWND hwnd, WPARAM wParam, LPARAM lParam)
393 WORD wRet;
394 LPHEADLIST lphl = ComboGetListHeader(hwnd);
395 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
397 wRet = ListBoxDirectory(lphl, wParam, (LPSTR)PTR_SEG_TO_LIN(lParam));
398 ComboUpdateWindow(hwnd, lphl, lphc, TRUE);
399 return wRet;
402 /***********************************************************************
403 * CBInsertString
405 static LRESULT CBInsertString(HWND hwnd, WPARAM wParam, LPARAM lParam)
407 WORD wRet;
408 LPHEADLIST lphl = ComboGetListHeader(hwnd);
409 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
411 if (lphl->HasStrings)
412 wRet = ListBoxInsertString(lphl, wParam, (LPSTR)PTR_SEG_TO_LIN(lParam));
413 else
414 wRet = ListBoxInsertString(lphl, wParam, (LPSTR)lParam);
415 ComboUpdateWindow(hwnd, lphl, lphc, TRUE);
416 return wRet;
419 /***********************************************************************
420 * CBAddString
422 static LRESULT CBAddString(HWND hwnd, WPARAM wParam, LPARAM lParam)
424 WORD wRet;
425 LPHEADLIST lphl = ComboGetListHeader(hwnd);
426 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
428 if (lphl->HasStrings)
429 wRet = ListBoxAddString(lphl, (LPSTR)PTR_SEG_TO_LIN(lParam));
430 else
431 wRet = ListBoxAddString(lphl, (LPSTR)lParam);
433 ComboUpdateWindow(hwnd, lphl, lphc, TRUE);
434 return wRet;
437 /***********************************************************************
438 * CBDeleteString
440 static LRESULT CBDeleteString(HWND hwnd, WPARAM wParam, LPARAM lParam)
442 LPHEADLIST lphl = ComboGetListHeader(hwnd);
443 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
444 LONG lRet = ListBoxDeleteString(lphl,wParam);
446 ComboUpdateWindow(hwnd, lphl, lphc, TRUE);
447 return lRet;
450 /***********************************************************************
451 * CBSelectString
453 static LRESULT CBSelectString(HWND hwnd, WPARAM wParam, LPARAM lParam)
455 LPHEADLIST lphl = ComboGetListHeader(hwnd);
456 WORD wRet;
458 wRet = ListBoxFindString(lphl, wParam, (SEGPTR)lParam);
460 /* XXX add functionality here */
462 return 0;
465 /***********************************************************************
466 * CBFindString
468 static LRESULT CBFindString(HWND hwnd, WPARAM wParam, LPARAM lParam)
470 LPHEADLIST lphl = ComboGetListHeader(hwnd);
471 return ListBoxFindString(lphl, wParam, (SEGPTR)lParam);
474 /***********************************************************************
475 * CBGetCount
477 static LRESULT CBGetCount(HWND hwnd, WPARAM wParam, LPARAM lParam)
479 LPHEADLIST lphl = ComboGetListHeader(hwnd);
480 return lphl->ItemsCount;
483 /***********************************************************************
484 * CBSetCurSel
486 static LRESULT CBSetCurSel(HWND hwnd, WPARAM wParam, LPARAM lParam)
488 LPHEADLIST lphl = ComboGetListHeader(hwnd);
489 WORD wRet;
491 wRet = ListBoxSetCurSel(lphl, wParam);
493 dprintf_combo(stddeb,"CBSetCurSel: hwnd %04x wp %x lp %lx wRet %d\n",
494 hwnd,wParam,lParam,wRet);
495 /* SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);*/
496 InvalidateRect32( hwnd, NULL, TRUE );
498 return wRet;
501 /***********************************************************************
502 * CBGetCurSel
504 static LRESULT CBGetCurSel(HWND hwnd, WPARAM wParam, LPARAM lParam)
506 LPHEADLIST lphl = ComboGetListHeader(hwnd);
507 return lphl->ItemFocused;
510 /***********************************************************************
511 * CBGetItemHeight
513 static LRESULT CBGetItemHeight(HWND hwnd, WPARAM wParam, LPARAM lParam)
515 LPHEADLIST lphl = ComboGetListHeader(hwnd);
516 LPLISTSTRUCT lpls = ListBoxGetItem (lphl, wParam);
518 if (lpls == NULL) return LB_ERR;
519 return lpls->mis.itemHeight;
522 /***********************************************************************
523 * CBSetItemHeight
525 static LRESULT CBSetItemHeight(HWND hwnd, WPARAM wParam, LPARAM lParam)
527 LPHEADLIST lphl = ComboGetListHeader(hwnd);
528 return ListBoxSetItemHeight(lphl, wParam, lParam);
531 /***********************************************************************
532 * CBSetRedraw
534 static LRESULT CBSetRedraw(HWND hwnd, WPARAM wParam, LPARAM lParam)
536 LPHEADLIST lphl = ComboGetListHeader(hwnd);
537 lphl->bRedrawFlag = wParam;
538 return 0;
541 /***********************************************************************
542 * CBSetFont
544 static LRESULT CBSetFont(HWND hwnd, WPARAM wParam, LPARAM lParam)
546 LPHEADLIST lphl = ComboGetListHeader(hwnd);
547 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
549 if (wParam == 0)
550 lphl->hFont = GetStockObject(SYSTEM_FONT);
551 else
552 lphl->hFont = (HFONT)wParam;
553 if (lphc->hWndEdit)
554 SendMessage16(lphc->hWndEdit,WM_SETFONT,lphl->hFont,0);
555 return 0;
558 /***********************************************************************
559 * CBGetLBTextLen
561 static LRESULT CBGetLBTextLen(HWND hwnd, WPARAM wParam, LPARAM lParam)
563 LPHEADLIST lphl = ComboGetListHeader(hwnd);
564 LPLISTSTRUCT lpls = ListBoxGetItem(lphl,wParam);
566 if (lpls == NULL || !lphl->HasStrings) return LB_ERR;
567 return strlen(lpls->itemText);
570 /***********************************************************************
571 * CBGetLBText
573 static LRESULT CBGetLBText(HWND hwnd, WPARAM wParam, LPARAM lParam)
575 LPHEADLIST lphl = ComboGetListHeader(hwnd);
576 return ListBoxGetText(lphl, wParam, (LPSTR)PTR_SEG_TO_LIN(lParam));
579 /***********************************************************************
580 * CBGetItemData
582 static LRESULT CBGetItemData(HWND hwnd, WPARAM wParam, LPARAM lParam)
584 LPHEADLIST lphl = ComboGetListHeader(hwnd);
585 return ListBoxGetItemData(lphl, wParam);
588 /***********************************************************************
589 * CBSetItemData
591 static LRESULT CBSetItemData(HWND hwnd, WPARAM wParam, LPARAM lParam)
593 LPHEADLIST lphl = ComboGetListHeader(hwnd);
594 return ListBoxSetItemData(lphl, wParam, lParam);
597 /***********************************************************************
598 * CBShowDropDown
600 static LRESULT CBShowDropDown(HWND hwnd, WPARAM wParam, LPARAM lParam)
602 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
603 RECT32 rect;
605 if ((lphc->dwStyle & 3) == CBS_SIMPLE) return LB_ERR;
607 wParam = !!wParam;
608 if (wParam != lphc->DropDownVisible) {
609 lphc->DropDownVisible = wParam;
610 GetWindowRect32(hwnd,&rect);
611 SetWindowPos(lphc->hWndLBox, 0, rect.left, rect.top+lphc->LBoxTop, 0, 0,
612 SWP_NOSIZE | (wParam ? SWP_SHOWWINDOW : SWP_HIDEWINDOW));
613 if (!wParam) SetFocus(hwnd);
615 return 0;
619 /***********************************************************************
620 * CBCheckSize
622 static BOOL CBCheckSize(HWND hwnd)
624 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
625 LPHEADLIST lphl = ComboGetListHeader(hwnd);
626 LONG cstyle = GetWindowLong32A(hwnd,GWL_STYLE);
627 RECT16 cRect,wRect;
629 if (lphc->hWndLBox == 0) return FALSE;
631 GetClientRect16(hwnd,&cRect);
632 GetWindowRect16(hwnd,&wRect);
634 dprintf_combo(stddeb,
635 "CBCheckSize: hwnd %04x Rect %d,%d-%d,%d wRect %d,%d-%d,%d\n",
636 hwnd,cRect.left,cRect.top,cRect.right,cRect.bottom,
637 wRect.left,wRect.top,wRect.right,wRect.bottom);
638 if ((cstyle & 3) == CBS_SIMPLE ) return TRUE ;
640 if ((cRect.bottom - cRect.top) >
641 (lphl->StdItemHeight + 2*SYSMETRICS_CYBORDER)) {
642 SetWindowPos(hwnd, 0, 0, 0,
643 cRect.right-cRect.left,
644 lphl->StdItemHeight+2*SYSMETRICS_CYBORDER,
645 SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE );
646 GetClientRect16(hwnd,&cRect);
647 GetWindowRect16(hwnd,&wRect);
649 lphc->RectButton.right = cRect.right;
650 lphc->RectButton.left = cRect.right - 2*SYSMETRICS_CXBORDER - 4
651 - CBitWidth;
652 lphc->RectButton.top = cRect.top;
653 lphc->RectButton.bottom = cRect.bottom;
656 if (cRect.right < lphc->RectButton.left) {
657 /* if the button is outside the window, move it in */
658 if ((wRect.right - wRect.left - 2*SYSMETRICS_CXBORDER) == (cRect.right - cRect.left)) {
659 lphc->RectButton.right = cRect.right;
660 lphc->RectButton.left = cRect.right - 2*SYSMETRICS_CXBORDER - 4
661 - CBitWidth;
662 lphc->RectButton.top = cRect.top;
663 lphc->RectButton.bottom = cRect.bottom;
665 /* otherwise we need to make the client include the button */
666 else
667 SetWindowPos(hwnd, 0, 0, 0, lphc->RectButton.right,
668 lphl->StdItemHeight+2*SYSMETRICS_CYBORDER,
669 SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE );
672 CBLCheckSize(hwnd);
673 return TRUE;
676 /***********************************************************************
677 * CBCommand
679 static LRESULT CBCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
681 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
682 LPHEADLIST lphl = ComboGetListHeader(hwnd);
683 char buffer[256];
684 WORD newFocused;
685 WORD id;
686 if (lphc->hWndEdit) /* interdependence only used for CBS_SIMPLE and CBS_DROPDOWN styles */
688 switch (wParam)
690 case ID_CLB: /* update EDIT window */
691 if (HIWORD(lParam)==CBN_SELCHANGE)
692 if (lphl->HasStrings)
694 ListBoxGetText(lphl,lphl->ItemFocused, buffer);
695 dprintf_combo(stddeb,"CBCommand: update Edit: %s\n",buffer);
696 SetWindowText32A( lphc->hWndEdit, buffer );
698 break;
699 case ID_EDIT: /* update LISTBOX window */
700 id=GetWindowWord(hwnd,GWW_ID);
701 switch (HIWORD(lParam))
703 case EN_UPDATE:GetWindowText32A(lphc->hWndEdit,buffer,255);
704 if (*buffer)
706 newFocused=ListBoxFindString(lphl, -1, MAKE_SEGPTR(buffer));
707 dprintf_combo(stddeb,"CBCommand: new selection #%d is= %s\n",
708 newFocused,buffer);
709 if (newFocused != (WORD)LB_ERR)
710 { /* if found something */
711 ListBoxSetCurSel(lphl, newFocused);
712 ListBoxSendNotification(lphl, CBN_SELCHANGE);
713 InvalidateRect32(hwnd, NULL, TRUE);
716 SendMessage16(GetParent(hwnd),WM_COMMAND,id,
717 MAKELONG(hwnd, CBN_EDITUPDATE));
718 break;
719 case EN_CHANGE:SendMessage16(GetParent(hwnd),WM_COMMAND,id,
720 MAKELONG(hwnd, CBN_EDITCHANGE));
721 break;
722 case EN_ERRSPACE:SendMessage16(GetParent(hwnd),WM_COMMAND,id,
723 MAKELONG(hwnd, CBN_ERRSPACE));
724 break;
726 break;
729 return 0;
733 /***********************************************************************
734 * ComboWndProc
736 LRESULT ComboBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
738 switch(message) {
739 case WM_NCCREATE: return CBNCCreate(hwnd, wParam, lParam);
740 case WM_CREATE: return CBCreate(hwnd, wParam, lParam);
741 case WM_DESTROY: return CBDestroy(hwnd, wParam, lParam);
742 case WM_GETDLGCODE: return CBGetDlgCode(hwnd, wParam, lParam);
743 case WM_KEYDOWN: return CBKeyDown(hwnd, wParam, lParam);
744 case WM_CHAR: return CBChar(hwnd, wParam, lParam);
745 case WM_SETFONT: return CBSetFont(hwnd, wParam, lParam);
746 case WM_SETREDRAW: return CBSetRedraw(hwnd, wParam, lParam);
747 case WM_PAINT: return CBPaint(hwnd, wParam, lParam);
748 case WM_LBUTTONDOWN: return CBLButtonDown(hwnd, wParam, lParam);
749 case WM_SETFOCUS: return CBSetFocus(hwnd, wParam, lParam);
750 case WM_KILLFOCUS: return CBKillFocus(hwnd, wParam, lParam);
751 case WM_SIZE: return CBCheckSize(hwnd);
752 case WM_COMMAND: return CBCommand(hwnd, wParam, lParam);
753 case CB_RESETCONTENT: return CBResetContent(hwnd, wParam, lParam);
754 case CB_DIR: return CBDir(hwnd, wParam, lParam);
755 case CB_ADDSTRING: return CBAddString(hwnd, wParam, lParam);
756 case CB_INSERTSTRING: return CBInsertString(hwnd, wParam, lParam);
757 case CB_DELETESTRING: return CBDeleteString(hwnd, wParam, lParam);
758 case CB_FINDSTRING: return CBFindString(hwnd, wParam, lParam);
759 case CB_GETCOUNT: return CBGetCount(hwnd, wParam, lParam);
760 case CB_GETCURSEL: return CBGetCurSel(hwnd, wParam, lParam);
761 case CB_GETITEMDATA: return CBGetItemData(hwnd, wParam, lParam);
762 case CB_GETITEMHEIGHT: return CBGetItemHeight(hwnd, wParam, lParam);
763 case CB_GETLBTEXT: return CBGetLBText(hwnd, wParam, lParam);
764 case CB_GETLBTEXTLEN: return CBGetLBTextLen(hwnd, wParam, lParam);
765 case CB_SELECTSTRING: return CBSelectString(hwnd, wParam, lParam);
766 case CB_SETITEMDATA: return CBSetItemData(hwnd, wParam, lParam);
767 case CB_SETCURSEL: return CBSetCurSel(hwnd, wParam, lParam);
768 case CB_SETITEMHEIGHT: return CBSetItemHeight(hwnd, wParam, lParam);
769 case CB_SHOWDROPDOWN: return CBShowDropDown(hwnd, wParam, lParam);
771 return DefWindowProc16(hwnd, message, wParam, lParam);
774 /*--------------------------------------------------------------------*/
775 /* ComboLBox code starts here */
777 HWND CLBoxGetCombo(HWND hwnd)
779 return (HWND)GetWindowLong32A(hwnd,0);
782 LPHEADLIST CLBoxGetListHeader(HWND hwnd)
784 return ComboGetListHeader(CLBoxGetCombo(hwnd));
787 /***********************************************************************
788 * CBLCreate
790 static LRESULT CBLCreate( HWND hwnd, WPARAM wParam, LPARAM lParam )
792 CREATESTRUCT16 *createStruct = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
793 SetWindowLong32A(hwnd,0,(LONG)createStruct->lpCreateParams);
794 return 0;
797 /***********************************************************************
798 * CBLGetDlgCode
800 static LRESULT CBLGetDlgCode( HWND hwnd, WPARAM wParam, LPARAM lParam )
802 return DLGC_WANTARROWS | DLGC_WANTCHARS;
805 /***********************************************************************
806 * CBLKeyDown
808 static LRESULT CBLKeyDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
810 LPHEADLIST lphl = CLBoxGetListHeader(hwnd);
811 WORD newFocused = lphl->ItemFocused;
813 switch(wParam) {
814 case VK_HOME:
815 newFocused = 0;
816 break;
817 case VK_END:
818 newFocused = lphl->ItemsCount - 1;
819 break;
820 case VK_UP:
821 if (newFocused > 0) newFocused--;
822 break;
823 case VK_DOWN:
824 newFocused++;
825 break;
826 case VK_PRIOR:
827 if (newFocused > lphl->ItemsVisible) {
828 newFocused -= lphl->ItemsVisible;
829 } else {
830 newFocused = 0;
832 break;
833 case VK_NEXT:
834 newFocused += lphl->ItemsVisible;
835 break;
836 default:
837 return 0;
840 if (newFocused >= lphl->ItemsCount)
841 newFocused = lphl->ItemsCount - 1;
843 ListBoxSetCurSel(lphl, newFocused);
844 ListBoxSendNotification(lphl, CBN_SELCHANGE);
845 SendMessage16(GetParent(hwnd), WM_COMMAND,ID_CLB,MAKELONG(0,CBN_SELCHANGE));
846 lphl->ItemFocused = newFocused;
847 ListBoxScrollToFocus(lphl);
848 SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
849 InvalidateRect32( hwnd, NULL, TRUE );
850 return 0;
853 /***********************************************************************
854 * CBLChar
856 static LRESULT CBLChar( HWND hwnd, WPARAM wParam, LPARAM lParam )
858 return 0;
861 /***********************************************************************
862 * CBLPaint
864 static LRESULT CBLPaint( HWND hwnd, WPARAM wParam, LPARAM lParam )
866 LPHEADLIST lphl = CLBoxGetListHeader(hwnd);
867 LPLISTSTRUCT lpls;
868 PAINTSTRUCT16 ps;
869 HBRUSH hBrush;
870 HFONT hOldFont;
871 WND * wndPtr = WIN_FindWndPtr(hwnd);
872 HWND combohwnd = CLBoxGetCombo(hwnd);
873 HDC16 hdc;
874 RECT16 rect;
875 int i, top, height;
877 top = 0;
878 hdc = BeginPaint16( hwnd, &ps );
880 if (!IsWindowVisible(hwnd) || !lphl->bRedrawFlag) {
881 EndPaint16(hwnd, &ps);
882 return 0;
885 hOldFont = SelectObject(hdc, lphl->hFont);
886 /* listboxes should be white */
887 hBrush = GetStockObject(WHITE_BRUSH);
889 GetClientRect16(hwnd, &rect);
890 FillRect16(hdc, &rect, hBrush);
891 CBLCheckSize(hwnd);
893 lpls = lphl->lpFirst;
895 lphl->ItemsVisible = 0;
896 for(i = 0; i < lphl->ItemsCount; i++) {
897 if (lpls == NULL) break;
899 if (i >= lphl->FirstVisible) {
900 height = lpls->mis.itemHeight;
901 /* must have enough room to draw entire item */
902 if (top > (rect.bottom-height+1)) break;
904 lpls->itemRect.top = top;
905 lpls->itemRect.bottom = top + height;
906 lpls->itemRect.left = rect.left;
907 lpls->itemRect.right = rect.right;
909 dprintf_listbox(stddeb,"drawing item: %d %d %d %d %d\n",
910 rect.left,top,rect.right,top+height,lpls->itemState);
911 if (lphl->OwnerDrawn) {
912 ListBoxDrawItem (combohwnd, lphl, hdc, lpls, &lpls->itemRect, ODA_DRAWENTIRE, 0);
913 if (lpls->itemState)
914 ListBoxDrawItem (combohwnd, lphl, hdc, lpls, &lpls->itemRect, ODA_SELECT, ODS_SELECTED);
915 } else {
916 ListBoxDrawItem (combohwnd, lphl, hdc, lpls, &lpls->itemRect, ODA_DRAWENTIRE,
917 lpls->itemState);
919 if ((lphl->ItemFocused == i) && GetFocus() == hwnd)
920 ListBoxDrawItem (combohwnd, lphl, hdc, lpls, &lpls->itemRect, ODA_FOCUS, ODS_FOCUS);
922 top += height;
923 lphl->ItemsVisible++;
926 lpls = lpls->lpNext;
929 if (wndPtr->dwStyle & WS_VSCROLL)
930 SetScrollRange(hwnd, SB_VERT, 0, ListMaxFirstVisible(lphl), TRUE);
932 SelectObject(hdc,hOldFont);
933 EndPaint16( hwnd, &ps );
934 return 0;
938 /***********************************************************************
939 * CBLKillFocus
941 static LRESULT CBLKillFocus( HWND hwnd, WPARAM wParam, LPARAM lParam )
943 /* SendMessage16(CLBoxGetCombo(hwnd),CB_SHOWDROPDOWN,0,0);*/
944 return 0;
947 /***********************************************************************
948 * CBLActivate
950 static LRESULT CBLActivate( HWND hwnd, WPARAM wParam, LPARAM lParam )
952 if (wParam == WA_INACTIVE)
953 SendMessage16(CLBoxGetCombo(hwnd),CB_SHOWDROPDOWN,0,0);
954 return 0;
957 /***********************************************************************
958 * CBLLButtonDown
960 static LRESULT CBLLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
962 LPHEADLIST lphl = CLBoxGetListHeader(hwnd);
963 int y;
964 RECT16 rectsel;
966 SetFocus(hwnd);
967 SetCapture(hwnd);
969 lphl->PrevFocused = lphl->ItemFocused;
971 y = ListBoxFindMouse(lphl, LOWORD(lParam), HIWORD(lParam));
972 if (y == -1)
973 return 0;
975 ListBoxSetCurSel(lphl, y);
976 ListBoxGetItemRect(lphl, y, &rectsel);
978 InvalidateRect32( hwnd, NULL, TRUE );
979 return 0;
982 /***********************************************************************
983 * CBLLButtonUp
985 static LRESULT CBLLButtonUp( HWND hwnd, WPARAM wParam, LPARAM lParam )
987 LPHEADLIST lphl = CLBoxGetListHeader(hwnd);
989 if (GetCapture() == hwnd) ReleaseCapture();
991 if(!lphl)
993 fprintf(stdnimp,"CBLLButtonUp: CLBoxGetListHeader returned NULL!\n");
995 else if (lphl->PrevFocused != lphl->ItemFocused)
997 SendMessage16(CLBoxGetCombo(hwnd),CB_SETCURSEL,lphl->ItemFocused,0);
998 SendMessage16(GetParent(hwnd), WM_COMMAND,ID_CLB,MAKELONG(0,CBN_SELCHANGE));
999 ListBoxSendNotification(lphl, CBN_SELCHANGE);
1002 SendMessage16(CLBoxGetCombo(hwnd),CB_SHOWDROPDOWN,0,0);
1004 return 0;
1007 /***********************************************************************
1008 * CBLMouseMove
1010 static LRESULT CBLMouseMove( HWND hwnd, WPARAM wParam, LPARAM lParam )
1012 LPHEADLIST lphl = CLBoxGetListHeader(hwnd);
1013 short y;
1014 WORD wRet;
1015 RECT16 rect, rectsel;
1017 y = SHIWORD(lParam);
1018 wRet = ListBoxFindMouse(lphl, LOWORD(lParam), HIWORD(lParam));
1019 ListBoxGetItemRect(lphl, wRet, &rectsel);
1020 GetClientRect16(hwnd, &rect);
1022 dprintf_combo(stddeb,"CBLMouseMove: hwnd %04x wp %x lp %lx y %d if %d wret %d %d,%d-%d,%d\n",
1023 hwnd,wParam,lParam,y,lphl->ItemFocused,wRet,rectsel.left,rectsel.top,rectsel.right,rectsel.bottom);
1025 if ((wParam & MK_LBUTTON) != 0) {
1026 if (y < CBLMM_EDGE) {
1027 if (lphl->FirstVisible > 0) {
1028 lphl->FirstVisible--;
1029 SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
1030 ListBoxSetCurSel(lphl, wRet);
1031 InvalidateRect32( hwnd, NULL, TRUE );
1032 return 0;
1035 else if (y >= (rect.bottom-CBLMM_EDGE)) {
1036 if (lphl->FirstVisible < ListMaxFirstVisible(lphl)) {
1037 lphl->FirstVisible++;
1038 SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
1039 ListBoxSetCurSel(lphl, wRet);
1040 InvalidateRect32( hwnd, NULL, TRUE );
1041 return 0;
1044 else {
1045 if ((short) wRet == lphl->ItemFocused) return 0;
1046 ListBoxSetCurSel(lphl, wRet);
1047 InvalidateRect32( hwnd, NULL, TRUE );
1051 return 0;
1054 /***********************************************************************
1055 * CBLVScroll
1057 static LRESULT CBLVScroll( HWND hwnd, WPARAM wParam, LPARAM lParam )
1059 LPHEADLIST lphl = CLBoxGetListHeader(hwnd);
1060 int y;
1062 y = lphl->FirstVisible;
1064 switch(wParam) {
1065 case SB_LINEUP:
1066 if (lphl->FirstVisible > 0)
1067 lphl->FirstVisible--;
1068 break;
1070 case SB_LINEDOWN:
1071 lphl->FirstVisible++;
1072 break;
1074 case SB_PAGEUP:
1075 if (lphl->FirstVisible > lphl->ItemsVisible) {
1076 lphl->FirstVisible -= lphl->ItemsVisible;
1077 } else {
1078 lphl->FirstVisible = 0;
1080 break;
1082 case SB_PAGEDOWN:
1083 lphl->FirstVisible += lphl->ItemsVisible;
1084 break;
1086 case SB_THUMBTRACK:
1087 lphl->FirstVisible = LOWORD(lParam);
1088 break;
1091 if (lphl->FirstVisible > ListMaxFirstVisible(lphl))
1092 lphl->FirstVisible = ListMaxFirstVisible(lphl);
1094 if (y != lphl->FirstVisible) {
1095 SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
1096 InvalidateRect32( hwnd, NULL, TRUE );
1099 return 0;
1103 /***********************************************************************
1104 * CBLCheckSize
1106 static BOOL CBLCheckSize(HWND hwnd)
1108 LPHEADCOMBO lphc = ComboGetStorageHeader(hwnd);
1109 LPHEADLIST lphl = ComboGetListHeader(hwnd);
1110 LPLISTSTRUCT lpls;
1111 HWND hWndLBox;
1112 RECT16 cRect,wRect,lRect,lwRect;
1113 int totheight,dw;
1114 char className[80];
1116 GetClassName32A(hwnd,className,80);
1117 fflush(stddeb);
1118 if (strncmp(className,"COMBOBOX",8)) return FALSE;
1119 if ((hWndLBox = lphc->hWndLBox) == 0) return FALSE;
1120 dprintf_combo(stddeb,"CBLCheckSize headers hw %04x lb %04x name %s\n",
1121 hwnd,hWndLBox,className);
1123 GetClientRect16(hwnd,&cRect);
1124 GetWindowRect16(hwnd,&wRect);
1125 GetClientRect16(hWndLBox,&lRect);
1126 GetWindowRect16(hWndLBox,&lwRect);
1128 dprintf_combo(stddeb,"CBLCheckSize: init cRect %d,%d-%d,%d wRect %d,%d-%d,%d\n",
1129 cRect.left,cRect.top,cRect.right,cRect.bottom,
1130 wRect.left,wRect.top,wRect.right,wRect.bottom);
1131 dprintf_combo(stddeb," lRect %d,%d-%d,%d lwRect %d,%d-%d,%d\n",
1132 lRect.left,lRect.top,lRect.right,lRect.bottom,
1133 lwRect.left,lwRect.top,lwRect.right,lwRect.bottom);
1134 fflush(stddeb);
1136 totheight = 0;
1137 for (lpls=lphl->lpFirst; lpls != NULL; lpls=lpls->lpNext)
1138 totheight += lpls->mis.itemHeight;
1140 dw = cRect.right-cRect.left+2*SYSMETRICS_CXBORDER+SYSMETRICS_CXVSCROLL;
1141 dw -= lwRect.right-lwRect.left;
1142 dw -= SYSMETRICS_CXVSCROLL;
1144 /* TODO: This isn't really what windows does */
1145 if ((lRect.bottom-lRect.top < 3*lphl->StdItemHeight) || dw) {
1146 dprintf_combo(stddeb," Changing; totHeight %d StdItemHght %d dw %d\n",
1147 totheight,lphl->StdItemHeight,dw);
1148 SetWindowPos(hWndLBox, 0, lRect.left, lRect.top,
1149 lwRect.right-lwRect.left+dw, totheight+2*SYSMETRICS_CYBORDER,
1150 SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE );
1152 return TRUE;
1156 /***********************************************************************
1157 * ComboLBoxWndProc
1159 LRESULT ComboLBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
1161 switch(message) {
1162 case WM_CREATE: return CBLCreate(hwnd, wParam, lParam);
1163 case WM_GETDLGCODE: return CBLGetDlgCode(hwnd, wParam, lParam);
1164 case WM_KEYDOWN: return CBLKeyDown(hwnd, wParam, lParam);
1165 case WM_CHAR: return CBLChar(hwnd, wParam, lParam);
1166 case WM_PAINT: return CBLPaint(hwnd, wParam, lParam);
1167 case WM_KILLFOCUS: return CBLKillFocus(hwnd, wParam, lParam);
1168 case WM_ACTIVATE: return CBLActivate(hwnd, wParam, lParam);
1169 case WM_LBUTTONDOWN: return CBLLButtonDown(hwnd, wParam, lParam);
1170 case WM_LBUTTONUP: return CBLLButtonUp(hwnd, wParam, lParam);
1171 case WM_MOUSEMOVE: return CBLMouseMove(hwnd, wParam, lParam);
1172 case WM_VSCROLL: return CBLVScroll(hwnd, wParam, lParam);
1173 case WM_SIZE: return CBLCheckSize(hwnd);
1175 return DefWindowProc16(hwnd, message, wParam, lParam);
1178 /************************************************************************
1179 * DlgDirSelectComboBox [USER.194]
1181 BOOL DlgDirSelectComboBox(HWND hDlg, LPSTR lpStr, INT nIDLBox)
1183 fprintf(stdnimp,"DlgDirSelectComboBox(%04x, '%s', %d) \n",
1184 hDlg, lpStr, nIDLBox);
1185 return TRUE;
1188 static INT32 COMBO_DlgDirList( HWND32 hDlg, LPARAM path, INT32 idCBox,
1189 INT32 idStatic, UINT32 wType, BOOL32 unicode )
1191 LRESULT res = 0;
1193 if (idCBox)
1195 SendDlgItemMessage32A( hDlg, idCBox, CB_RESETCONTENT, 0, 0 );
1196 if (unicode)
1197 res = SendDlgItemMessage32W( hDlg, idCBox, CB_DIR, wType, path );
1198 else
1199 res = SendDlgItemMessage32A( hDlg, idCBox, CB_DIR, wType, path );
1201 if (idStatic)
1203 char temp[512] = "A:\\";
1204 int drive = DRIVE_GetCurrentDrive();
1205 temp[0] += drive;
1206 lstrcpyn32A( temp + 3, DRIVE_GetDosCwd(drive), sizeof(temp)-3 );
1207 AnsiLower( temp );
1208 SetDlgItemText32A( hDlg, idStatic, temp );
1210 return (res >= 0);
1214 /***********************************************************************
1215 * DlgDirListComboBox16 (USER.195)
1217 INT16 DlgDirListComboBox16( HWND16 hDlg, LPCSTR path, INT16 idCBox,
1218 INT16 idStatic, UINT16 wType )
1220 dprintf_combo( stddeb,"DlgDirListComboBox16(%04x,'%s',%d,%d,%04x)\n",
1221 hDlg, path, idCBox, idStatic, wType );
1222 return COMBO_DlgDirList( hDlg, (LPARAM)path, idCBox,
1223 idStatic, wType, FALSE );
1227 /***********************************************************************
1228 * DlgDirListComboBox32A (USER32.143)
1230 INT32 DlgDirListComboBox32A( HWND32 hDlg, LPCSTR path, INT32 idCBox,
1231 INT32 idStatic, UINT32 wType )
1233 dprintf_combo( stddeb,"DlgDirListComboBox32A(%08x,'%s',%d,%d,%08X)\n",
1234 hDlg, path, idCBox, idStatic, wType );
1235 return COMBO_DlgDirList( hDlg, (LPARAM)path, idCBox,
1236 idStatic, wType, FALSE );
1240 /***********************************************************************
1241 * DlgDirListComboBox32W (USER32.144)
1243 INT32 DlgDirListComboBox32W( HWND32 hDlg, LPCWSTR path, INT32 idCBox,
1244 INT32 idStatic, UINT32 wType )
1246 dprintf_combo( stddeb,"DlgDirListComboBox32W(%08x,%p,%d,%d,%08X)\n",
1247 hDlg, path, idCBox, idStatic, wType );
1248 return COMBO_DlgDirList( hDlg, (LPARAM)path, idCBox,
1249 idStatic, wType, TRUE );