00213 {
00214 HWND hwnd =
HWq(pwnd);
00215
PCBOX pcbox;
00216 POINT pt;
00217
TL tlpwndEdit;
00218
TL tlpwndList;
00219 PAINTSTRUCT ps;
00220 LPWSTR lpwsz =
NULL;
00221 LRESULT lReturn;
00222
static BOOL fInit =
TRUE;
00223
int i;
00224
00225
CheckLock(pwnd);
00226
00227
VALIDATECLASSANDSIZE(pwnd, FNID_COMBOBOX);
00228
INITCONTROLLOOKASIDE(&ComboboxLookaside,
CBOX, spwnd, 8);
00229
00230
00231
00232
00233
00234
00235 pcbox = ((
PCOMBOWND)pwnd)->pcbox;
00236
00237
00238
00239
00240
if (pcbox->
spwndList ==
NULL) {
00241 LRESULT lRet;
00242
00243
if (!
ComboBoxMsgOKInInit(message, &lRet)) {
00244 RIPMSG2(RIP_WARNING,
"ComboBoxWndProcWorker: msg=%04x is sent to hwnd=%08x in the middle of initialization.",
00245 message, hwnd);
00246
return lRet;
00247 }
00248 }
00249
00250
00251
00252
00253
switch (message) {
00254
case CBEC_KILLCOMBOFOCUS:
00255
00256
00257
00258
00259
00260
xxxCBKillFocusHelper(pcbox);
00261
break;
00262
00263
case WM_COMMAND:
00264
00265
00266
00267
00268
00269
return xxxCBCommandHandler(pcbox, (DWORD)wParam, (HWND)lParam);
00270
00271
case WM_STYLECHANGED:
00272 UserAssert(pcbox->
spwndList != NULL);
00273 {
00274 LONG OldStyle;
00275 LONG NewStyle = 0;
00276
00277 pcbox->
fRtoLReading = (
TestWF(pwnd, WEFRTLREADING) != 0);
00278 pcbox->
fRightAlign = (
TestWF(pwnd, WEFRIGHT) != 0);
00279
if (pcbox->
fRtoLReading)
00280 NewStyle |= (WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR);
00281
if (pcbox->
fRightAlign)
00282 NewStyle |= WS_EX_RIGHT;
00283
00284
ThreadLock(pcbox->
spwndList, &tlpwndList);
00285 OldStyle = GetWindowLong(
HWq(pcbox->
spwndList), GWL_EXSTYLE) & ~(WS_EX_RIGHT|WS_EX_RTLREADING|WS_EX_LEFTSCROLLBAR);
00286 SetWindowLong(
HWq(pcbox->
spwndList), GWL_EXSTYLE, OldStyle|NewStyle);
00287
ThreadUnlock(&tlpwndList);
00288
00289
if (!pcbox->
fNoEdit && pcbox->
spwndEdit) {
00290
ThreadLock(pcbox->
spwndEdit, &tlpwndEdit);
00291 OldStyle = GetWindowLong(
HWq(pcbox->
spwndEdit), GWL_EXSTYLE) & ~(WS_EX_RIGHT|WS_EX_RTLREADING|WS_EX_LEFTSCROLLBAR);
00292 SetWindowLong(
HWq(pcbox->
spwndEdit), GWL_EXSTYLE, OldStyle|NewStyle);
00293
ThreadUnlock(&tlpwndEdit);
00294 }
00295
xxxCBPosition(pcbox);
00296
NtUserInvalidateRect(hwnd, NULL, FALSE);
00297 }
00298
break;
00299
00300
case WM_CTLCOLORMSGBOX:
00301
case WM_CTLCOLOREDIT:
00302
case WM_CTLCOLORLISTBOX:
00303
case WM_CTLCOLORBTN:
00304
case WM_CTLCOLORDLG:
00305
case WM_CTLCOLORSCROLLBAR:
00306
case WM_CTLCOLORSTATIC:
00307
case WM_CTLCOLOR:
00308
00309
00310
00311
00312
if (
TestWF(pwnd, WFWIN40COMPAT)) {
00313
TL tlpwndParent;
00314 LRESULT ret;
00315
PWND pwndParent;
00316
00317 pwndParent =
REBASEPWND(pwnd, spwndParent);
00318
ThreadLock(pwndParent, &tlpwndParent);
00319 ret =
SendMessage(
HW(pwndParent), message, wParam, lParam);
00320
ThreadUnlock(tlpwndParent);
00321
return ret;
00322 }
else
00323
return(
DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi));
00324
break;
00325
00326
case WM_GETTEXT:
00327
if (pcbox->
fNoEdit) {
00328
return xxxCBGetTextHelper(pcbox, (
int)wParam, (LPWSTR)lParam, fAnsi);
00329 }
00330
goto CallEditSendMessage;
00331
break;
00332
00333
case WM_GETTEXTLENGTH:
00334
00335
00336
00337
00338
00339
00340
if (pcbox->
fNoEdit) {
00341
return xxxCBGetTextLengthHelper(pcbox, fAnsi);
00342 }
00343
00344
00345
00346
case WM_CLEAR:
00347
case WM_CUT:
00348
case WM_PASTE:
00349
case WM_COPY:
00350
case WM_SETTEXT:
00351
goto CallEditSendMessage;
00352
break;
00353
00354
case WM_CREATE:
00355
00356
00357
00358
00359
00360
return xxxCBCreateHandler(pcbox, pwnd);
00361
00362
case WM_ERASEBKGND:
00363
00364
00365
00366
00367
return 1
L;
00368
00369
case WM_GETFONT:
00370
return (LRESULT)pcbox->
hFont;
00371
00372
case WM_PRINT:
00373
if (!
DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi))
00374
return(
FALSE);
00375
00376
if ((lParam & PRF_OWNED) && (pcbox->
CBoxStyle &
SDROPPABLE) &&
00377
TestWF(pcbox->
spwndList, WFVISIBLE)) {
00378
TL tpwndList;
00379
int iDC = SaveDC((HDC) wParam);
00380 OffsetWindowOrgEx((HDC) wParam, 0, pwnd->
rcWindow.top - pcbox->
spwndList->
rcWindow.top, NULL);
00381 lParam &= ~PRF_CHECKVISIBLE;
00382
ThreadLock(pcbox->
spwndList, &tpwndList);
00383
SendMessageWorker(pcbox->
spwndList, WM_PRINT, wParam, lParam, FALSE);
00384 RestoreDC((HDC) wParam, iDC);
00385 }
00386
return TRUE;
00387
00388
case WM_PRINTCLIENT:
00389
xxxCBPaint(pcbox, (HDC) wParam);
00390
break;
00391
00392
case WM_PAINT: {
00393 HDC hdc;
00394
00395
00396
00397
00398 hdc = (wParam) ? (HDC) wParam :
NtUserBeginPaint(hwnd, &ps);
00399
00400
if (
IsComboVisible(pcbox))
00401
xxxCBPaint(pcbox, hdc);
00402
00403
if (!wParam)
00404
NtUserEndPaint(hwnd, &ps);
00405
break;
00406 }
00407
case WM_GETDLGCODE:
00408
00409
00410
00411
00412
00413 {
00414 LRESULT code = DLGC_WANTCHARS | DLGC_WANTARROWS;
00415
00416
00417
00418
if ((lParam != 0) &&
00419 (((LPMSG)lParam)->message == WM_KEYDOWN) &&
00420 pcbox->
fLBoxVisible &&
00421 ((wParam == VK_RETURN) || (wParam == VK_ESCAPE)))
00422 {
00423 code |= DLGC_WANTMESSAGE;
00424 }
00425
return code;
00426 }
00427
00428
00429
00430
00431
case WM_SETFONT:
00432
xxxCBSetFontHandler(pcbox, (HANDLE)wParam, LOWORD(lParam));
00433
break;
00434
00435
case WM_SYSKEYDOWN:
00436
if (lParam & 0x20000000
L) {
00437
00438
00439
00440
00441
00442
if (lParam & 0x1000000) {
00443
00444
00445
00446
00447
00448
if (wParam == VK_DOWN || wParam == VK_UP)
00449
goto DropCombo;
00450
00451
goto CallDWP;
00452 }
00453
00454
if (
GetKeyState(VK_NUMLOCK) & 0x1) {
00455
00456
00457
00458
goto CallDWP;
00459 }
else {
00460
00461
00462
00463
00464
if (!(wParam == VK_DOWN || wParam == VK_UP))
00465
goto CallDWP;
00466 }
00467 DropCombo:
00468
if (!pcbox->
fLBoxVisible) {
00469
00470
00471
00472
00473
xxxCBShowListBoxWindow(pcbox, TRUE);
00474 }
else {
00475
00476
00477
00478
00479
if (!
xxxCBHideListBoxWindow(pcbox, TRUE, TRUE))
00480
return(0
L);
00481 }
00482 }
00483
goto CallDWP;
00484
break;
00485
00486
case WM_KEYDOWN:
00487
00488
00489
00490
00491
00492
if (pcbox->
fLBoxVisible) {
00493
if ((wParam == VK_RETURN) || (wParam == VK_ESCAPE)) {
00494
xxxCBHideListBoxWindow(pcbox, TRUE, (wParam != VK_ESCAPE));
00495
break;
00496 }
00497 }
00498
00499
00500
case WM_CHAR:
00501
if (fAnsi &&
IS_DBCS_ENABLED() && IsDBCSLeadByteEx(
THREAD_CODEPAGE(), (BYTE)wParam)) {
00502
return ComboBoxDBCharHandler(pcbox, hwnd, message, wParam, lParam);
00503 }
00504
00505
if (pcbox->
fNoEdit) {
00506
goto CallListSendMessage;
00507 }
00508
else
00509
goto CallEditSendMessage;
00510
break;
00511
00512
case WM_LBUTTONDBLCLK:
00513
case WM_LBUTTONDOWN:
00514
00515
#ifdef COLOR_HOTTRACKING
00516
pcbox->fButtonHotTracked =
FALSE;
00517
#endif // COLOR_HOTTRACKING
00518
00519
00520
00521
00522
if (!pcbox->
fFocus) {
00523
NtUserSetFocus(hwnd);
00524
if (!pcbox->
fFocus) {
00525
00526
00527
00528
00529
break;
00530 }
00531 }
00532
00533
00534
00535
00536
00537
00538
00539
00540 POINTSTOPOINT(pt, lParam);
00541
if ((pcbox->
CBoxStyle ==
SDROPDOWN &&
00542
PtInRect(&pcbox->
buttonrc, pt)) ||
00543 pcbox->
CBoxStyle ==
SDROPDOWNLIST) {
00544
00545
00546
00547
00548
00549
00550 pcbox->
fButtonPressed =
TRUE;
00551
if (pcbox->
fLBoxVisible) {
00552
if (pcbox->
fMouseDown) {
00553 pcbox->
fMouseDown =
FALSE;
00554
NtUserReleaseCapture();
00555 }
00556
xxxPressButton(pcbox, FALSE);
00557
00558
if (!
xxxCBHideListBoxWindow(pcbox, TRUE, TRUE))
00559
return(0
L);
00560 }
else {
00561
xxxCBShowListBoxWindow(pcbox, FALSE);
00562
00563
00564
00565
00566 pcbox->
fMouseDown =
TRUE;
00567
NtUserSetCapture(hwnd);
00568
if (
FWINABLE()) {
00569
NotifyWinEvent(EVENT_OBJECT_STATECHANGE, hwnd, OBJID_CLIENT, INDEX_COMBOBOX_BUTTON);
00570 }
00571 }
00572 }
00573
break;
00574
00575
case WM_MOUSEWHEEL:
00576
00577
00578
00579
if (wParam & (MK_CONTROL | MK_SHIFT))
00580
goto CallDWP;
00581
00582
00583
00584
00585
if (pcbox->
fLBoxVisible)
00586
goto CallListSendMessage;
00587
00588
00589
00590
00591
00592
if (pcbox->
fExtendedUI || pcbox->
spwndEdit ==
NULL)
00593
return TRUE;
00594
00595
00596
00597
00598 i =
abs(((
short)HIWORD(wParam))/WHEEL_DELTA);
00599 wParam = ((
short)HIWORD(wParam) > 0) ? VK_UP : VK_DOWN;
00600
00601
ThreadLock(pcbox->
spwndEdit, &tlpwndEdit);
00602
while (i-- > 0) {
00603
SendMessageWorker(
00604 pcbox->
spwndEdit, WM_KEYDOWN, wParam, 0, fAnsi);
00605 }
00606
ThreadUnlock(&tlpwndEdit);
00607
return TRUE;
00608
00609
case WM_CAPTURECHANGED:
00610
if (!(
TestWF(pwnd, WFWIN40COMPAT)))
00611
return 0;
00612
00613
if ((pcbox->
fMouseDown)) {
00614 pcbox->
fMouseDown =
FALSE;
00615
xxxPressButton(pcbox, FALSE);
00616
00617
00618
00619
00620
if (pcbox->
fLBoxVisible)
00621
xxxCBHideListBoxWindow(pcbox, TRUE, FALSE);
00622 }
00623
break;
00624
00625
case WM_LBUTTONUP:
00626
xxxPressButton(pcbox, FALSE);
00627
00628
00629
00630
00631
if (pcbox->
fMouseDown) {
00632 pcbox->
fMouseDown =
FALSE;
00633
00634
if (pcbox->
CBoxStyle ==
SDROPDOWN) {
00635
00636
00637
00638
00639
xxxCBUpdateListBoxWindow(pcbox, TRUE);
00640
xxxCBCompleteEditWindow(pcbox);
00641 }
00642
NtUserReleaseCapture();
00643
00644
00645
00646
00647
if (
TestWF(pwnd, WFWIN40COMPAT)) {
00648
00649
ThreadLock(pcbox->
spwndList, &tlpwndList);
00650
SendMessageWorker(pcbox->
spwndList, LBCB_STARTTRACK, FALSE, 0, FALSE);
00651
ThreadUnlock(&tlpwndList);
00652 }
00653 }
00654
#ifdef COLOR_HOTTRACKING
00655
HotTrack(pcbox);
00656
break;
00657
00658
case WM_MOUSELEAVE:
00659 pcbox->fButtonHotTracked =
FALSE;
00660
NtUserInvalidateRect(hwnd, &pcbox->
buttonrc, TRUE);
00661
#endif // COLOR_HOTTRACKING
00662
break;
00663
00664
case WM_MOUSEMOVE:
00665
if (pcbox->
fMouseDown) {
00666 POINTSTOPOINT(pt, lParam);
00667
00668
00669
00670
if (
PtInRect(&pcbox->
buttonrc, pt) != !!pcbox->
fButtonPressed) {
00671
xxxPressButton(pcbox, (pcbox->
fButtonPressed == 0));
00672 }
00673
00674
_ClientToScreen(pwnd, &pt);
00675
if (
PtInRect(&pcbox->
spwndList->
rcClient, pt)) {
00676
00677
00678
00679
00680
00681
00682 pcbox->
fMouseDown =
FALSE;
00683
NtUserReleaseCapture();
00684
00685
if (pcbox->
CBoxStyle &
SEDITABLE) {
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
xxxCBUpdateListBoxWindow(pcbox, TRUE);
00700 }
00701
00702
00703
00704
00705
00706
_ScreenToClient(pcbox->
spwndList, &pt);
00707 lParam = POINTTOPOINTS(pt);
00708 message = WM_LBUTTONDOWN;
00709
goto CallListSendMessage;
00710 }
00711 }
00712
#ifdef COLOR_HOTTRACKING
00713
HotTrack(pcbox);
00714
#endif // COLOR_HOTTRACKING
00715
break;
00716
00717
case WM_NCDESTROY:
00718
case WM_FINALDESTROY:
00719
xxxCBNcDestroyHandler(pwnd, pcbox);
00720
break;
00721
00722
case WM_SETFOCUS:
00723
if (pcbox->
fNoEdit) {
00724
00725
00726
00727
00728
xxxCBGetFocusHelper(pcbox);
00729 }
else if (pcbox->
spwndEdit) {
00730
00731
00732
00733
ThreadLock(pcbox->
spwndEdit, &tlpwndEdit);
00734
NtUserSetFocus(
HWq(pcbox->
spwndEdit));
00735
ThreadUnlock(&tlpwndEdit);
00736 }
00737
break;
00738
00739
case WM_KILLFOCUS:
00740
00741
00742
00743
00744
if (wParam != 0)
00745 wParam = (WPARAM)
ValidateHwnd((HWND)wParam);
00746
if ((wParam == 0) || !
_IsChild(pwnd, (
PWND)wParam)) {
00747
00748
00749
00750
00751
00752
xxxCBKillFocusHelper(pcbox);
00753 }
00754
00755 UserAssert(pcbox->
spwndList);
00756 {
00757
PLBIV plb = ((
PLBWND)pcbox->
spwndList)->pLBIV;
00758
00759
if ((plb !=
NULL) && (plb != (
PLBIV)-1)) {
00760 plb->
iTypeSearch = 0;
00761
if (plb->
pszTypeSearch) {
00762
UserLocalFree(plb->
pszTypeSearch);
00763 plb->
pszTypeSearch =
NULL;
00764 }
00765 }
00766 }
00767
break;
00768
00769
case WM_SETREDRAW:
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780 pcbox->
fNoRedraw = (
UINT)!((
BOOL)wParam);
00781
00782
00783
00784
00785
00786
if (!pcbox->
fNoEdit && pcbox->
spwndEdit) {
00787
ThreadLock(pcbox->
spwndEdit, &tlpwndEdit);
00788
SendMessageWorker(pcbox->
spwndEdit, message, wParam, lParam, FALSE);
00789
ThreadUnlock(&tlpwndEdit);
00790 }
00791
goto CallListSendMessage;
00792
break;
00793
00794
case WM_ENABLE:
00795
00796
00797
00798
00799
00800
NtUserInvalidateRect(hwnd, NULL, FALSE);
00801
if ((pcbox->
CBoxStyle &
SEDITABLE) && pcbox->
spwndEdit) {
00802
00803
00804
00805
00806
ThreadLock(pcbox->
spwndEdit, &tlpwndEdit);
00807
NtUserEnableWindow(
HWq(pcbox->
spwndEdit), (
TestWF(pwnd, WFDISABLED) == 0));
00808
ThreadUnlock(&tlpwndEdit);
00809 }
00810
00811
00812
00813
00814 UserAssert(pcbox->
spwndList);
00815
ThreadLock(pcbox->
spwndList, &tlpwndList);
00816
NtUserEnableWindow(
HWq(pcbox->
spwndList), (
TestWF(pwnd, WFDISABLED) == 0));
00817
ThreadUnlock(&tlpwndList);
00818
break;
00819
00820
case WM_SIZE:
00821
00822
00823
00824
00825
00826
00827 UserAssert(pcbox->
spwndList);
00828
if (LOWORD(lParam) == 0 || HIWORD(lParam) == 0) {
00829
00830
00831
00832
00833
00834
return 0;
00835 }
00836
00837
00838
if (pcbox->
cxCombo == pwnd->
rcWindow.right - pwnd->
rcWindow.left) {
00839
int iNewHeight = pwnd->
rcWindow.bottom - pwnd->
rcWindow.top;
00840
00841
00842
if (pcbox->
fLBoxVisible) {
00843
00844
if (pcbox->
cyDrop + pcbox->
cyCombo == iNewHeight)
00845
return(0
L);
00846 }
else {
00847
00848
if (pcbox->
cyCombo == iNewHeight)
00849
return(0
L);
00850 }
00851 }
00852
00853
xxxCBSizeHandler(pcbox);
00854
break;
00855
00856
case CB_GETDROPPEDSTATE:
00857
00858
00859
00860
00861
00862
00863
return pcbox->
fLBoxVisible;
00864
00865
case CB_GETDROPPEDCONTROLRECT:
00866
00867
00868
00869
00870
00871
00872 ((LPRECT)lParam)->left = pwnd->
rcWindow.left;
00873 ((LPRECT)lParam)->top = pwnd->
rcWindow.top;
00874 ((LPRECT)lParam)->right = pwnd->
rcWindow.left +
max(pcbox->
cxDrop, pcbox->
cxCombo);
00875 ((LPRECT)lParam)->bottom = pwnd->
rcWindow.top + pcbox->
cyCombo + pcbox->
cyDrop;
00876
break;
00877
00878
case CB_SETDROPPEDWIDTH:
00879
if (pcbox->
CBoxStyle &
SDROPPABLE) {
00880
if (wParam) {
00881 wParam =
max(wParam, (UINT)pcbox->
cxCombo);
00882
00883
if (wParam != (
UINT) pcbox->
cxDrop)
00884 {
00885 pcbox->
cxDrop = (
int)wParam;
00886
xxxCBPosition(pcbox);
00887 }
00888 }
00889 }
00890
00891
00892
case CB_GETDROPPEDWIDTH:
00893
if (pcbox->
CBoxStyle &
SDROPPABLE)
00894
return((LRESULT)
max(pcbox->
cxDrop, pcbox->
cxCombo));
00895
else
00896
return(CB_ERR);
00897
break;
00898
00899
case CB_DIR:
00900
00901
00902
00903
00904
if (fAnsi && lParam != 0) {
00905
if (MBToWCS((LPSTR)lParam, -1, &lpwsz, -1, TRUE) == 0)
00906
return CB_ERR;
00907 lParam = (LPARAM)lpwsz;
00908 }
00909 lReturn =
xxxCBDir(pcbox, LOWORD(wParam), (LPWSTR)lParam);
00910
if (fAnsi && lParam != 0) {
00911
UserLocalFree(lpwsz);
00912 }
00913
return lReturn;
00914
00915
case CB_SETEXTENDEDUI:
00916
00917
00918
00919
00920
00921
00922
if (pcbox->
CBoxStyle &
SDROPPABLE) {
00923
if (!wParam) {
00924 pcbox->
fExtendedUI = 0;
00925
return 0;
00926 }
00927
00928
if (wParam == 1) {
00929 pcbox->
fExtendedUI = 1;
00930
return 0;
00931 }
00932
00933 RIPERR1(ERROR_INVALID_PARAMETER,
00934 RIP_WARNING,
00935
"Invalid parameter \"wParam\" (%ld) to ComboBoxWndProcWorker",
00936 wParam);
00937
00938 }
else {
00939 RIPERR1(ERROR_INVALID_MESSAGE,
00940 RIP_WARNING,
00941
"Invalid message (%ld) sent to ComboBoxWndProcWorker",
00942 message);
00943 }
00944
00945
return CB_ERR;
00946
00947
case CB_GETEXTENDEDUI:
00948
if (pcbox->
CBoxStyle &
SDROPPABLE) {
00949
if (pcbox->
fExtendedUI)
00950
return TRUE;
00951 }
00952
return FALSE;
00953
00954
case CB_GETEDITSEL:
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965 message = EM_GETSEL;
00966
goto CallEditSendMessage;
00967
break;
00968
00969
case CB_LIMITTEXT:
00970
00971
00972
00973
00974
00975
00976
00977 message = EM_LIMITTEXT;
00978
goto CallEditSendMessage;
00979
break;
00980
00981
case CB_SETEDITSEL:
00982
00983
00984
00985
00986
00987
00988 message = EM_SETSEL;
00989
00990 wParam = (
int)(
SHORT)LOWORD(lParam);
00991 lParam = (
int)(
SHORT)HIWORD(lParam);
00992
goto CallEditSendMessage;
00993
break;
00994
00995
case CB_ADDSTRING:
00996
00997
00998
00999
01000
01001
if (!pcbox->
fCase)
01002 message = LB_ADDSTRING;
01003
else
01004 message = (pcbox->
fCase &
UPPERCASE) ? LB_ADDSTRINGUPPER : LB_ADDSTRINGLOWER;
01005
goto CallListSendMessage;
01006
break;
01007
01008
case CB_DELETESTRING:
01009
01010
01011
01012
01013
01014 message = LB_DELETESTRING;
01015
goto CallListSendMessage;
01016
break;
01017
01018
case CB_INITSTORAGE:
01019
01020
01021 message = LB_INITSTORAGE;
01022
goto CallListSendMessage;
01023
01024
case CB_SETTOPINDEX:
01025
01026
01027 message = LB_SETTOPINDEX;
01028
goto CallListSendMessage;
01029
01030
case CB_GETTOPINDEX:
01031
01032 message = LB_GETTOPINDEX;
01033
goto CallListSendMessage;
01034
01035
case CB_GETCOUNT:
01036
01037
01038
01039
01040
01041 message = LB_GETCOUNT;
01042
goto CallListSendMessage;
01043
break;
01044
01045
case CB_GETCURSEL:
01046
01047
01048
01049
01050
01051 message = LB_GETCURSEL;
01052
goto CallListSendMessage;
01053
break;
01054
01055
case CB_GETLBTEXT:
01056
01057
01058
01059
01060
01061 message = LB_GETTEXT;
01062
goto CallListSendMessage;
01063
break;
01064
01065
case CB_GETLBTEXTLEN:
01066
01067
01068
01069
01070
01071 message = LB_GETTEXTLEN;
01072
goto CallListSendMessage;
01073
break;
01074
01075
case CB_INSERTSTRING:
01076
01077
01078
01079
01080
01081
if (!pcbox->
fCase)
01082 message = LB_INSERTSTRING;
01083
else
01084 message = (pcbox->
fCase &
UPPERCASE) ? LB_INSERTSTRINGUPPER : LB_INSERTSTRINGLOWER;
01085
goto CallListSendMessage;
01086
break;
01087
01088
case CB_RESETCONTENT:
01089
01090
01091
01092
01093
01094
01095
01096 UserAssert(pcbox->
spwndList);
01097
ThreadLock(pcbox->
spwndList, &tlpwndList);
01098
SendMessageWorker(pcbox->
spwndList, LB_RESETCONTENT, 0, 0, FALSE);
01099
ThreadUnlock(&tlpwndList);
01100
xxxCBInternalUpdateEditWindow(pcbox, NULL);
01101
break;
01102
01103
case CB_GETHORIZONTALEXTENT:
01104 message = LB_GETHORIZONTALEXTENT;
01105
goto CallListSendMessage;
01106
01107
case CB_SETHORIZONTALEXTENT:
01108 message = LB_SETHORIZONTALEXTENT;
01109
goto CallListSendMessage;
01110
01111
case CB_FINDSTRING:
01112
01113
01114
01115
01116
01117 message = LB_FINDSTRING;
01118
goto CallListSendMessage;
01119
break;
01120
01121
case CB_FINDSTRINGEXACT:
01122
01123
01124
01125
01126
01127 message = LB_FINDSTRINGEXACT;
01128
goto CallListSendMessage;
01129
break;
01130
01131
case CB_SELECTSTRING:
01132
01133
01134
01135
01136
01137 UserAssert(pcbox->
spwndList);
01138
ThreadLock(pcbox->
spwndList, &tlpwndList);
01139 lParam =
SendMessageWorker(pcbox->
spwndList, LB_SELECTSTRING,
01140 wParam, lParam, fAnsi);
01141
ThreadUnlock(&tlpwndList);
01142
xxxCBInternalUpdateEditWindow(pcbox, NULL);
01143
return lParam;
01144
01145
case CB_SETCURSEL:
01146
01147
01148
01149
01150
01151
01152
01153
01154 UserAssert(pcbox->
spwndList);
01155
01156
ThreadLock(pcbox->
spwndList, &tlpwndList);
01157 lParam =
SendMessageWorker(pcbox->
spwndList, LB_SETCURSEL, wParam, lParam, FALSE);
01158
if (lParam != -1) {
01159
SendMessageWorker(pcbox->
spwndList, LB_SETTOPINDEX, wParam, 0, FALSE);
01160 }
01161
ThreadUnlock(&tlpwndList);
01162
xxxCBInternalUpdateEditWindow(pcbox, NULL);
01163
return lParam;
01164
01165
case CB_GETITEMDATA:
01166 message = LB_GETITEMDATA;
01167
goto CallListSendMessage;
01168
break;
01169
01170
case CB_SETITEMDATA:
01171 message = LB_SETITEMDATA;
01172
goto CallListSendMessage;
01173
break;
01174
01175
case CB_SETITEMHEIGHT:
01176
if (wParam == -1) {
01177
if (HIWORD(lParam) != 0)
01178
return CB_ERR;
01179
return xxxCBSetEditItemHeight(pcbox, LOWORD(lParam));
01180 }
01181
01182 message = LB_SETITEMHEIGHT;
01183
goto CallListSendMessage;
01184
break;
01185
01186
case CB_GETITEMHEIGHT:
01187
if (wParam == -1)
01188
return pcbox->
editrc.bottom - pcbox->
editrc.top;
01189
01190 message = LB_GETITEMHEIGHT;
01191
goto CallListSendMessage;
01192
break;
01193
01194
case CB_SHOWDROPDOWN:
01195
01196
01197
01198
01199
01200
if (wParam && !pcbox->
fLBoxVisible) {
01201
xxxCBShowListBoxWindow(pcbox, TRUE);
01202 }
else {
01203
if (!wParam && pcbox->
fLBoxVisible) {
01204
xxxCBHideListBoxWindow(pcbox, TRUE, FALSE);
01205 }
01206 }
01207
break;
01208
01209
case CB_SETLOCALE:
01210
01211
01212
01213
01214
01215 message = LB_SETLOCALE;
01216
goto CallListSendMessage;
01217
break;
01218
01219
case CB_GETLOCALE:
01220
01221
01222
01223
01224
01225 message = LB_GETLOCALE;
01226
goto CallListSendMessage;
01227
break;
01228
01229
case WM_MEASUREITEM:
01230
case WM_DELETEITEM:
01231
case WM_DRAWITEM:
01232
case WM_COMPAREITEM:
01233
return xxxCBMessageItemHandler(pcbox, message, (LPVOID)lParam);
01234
01235
case WM_NCCREATE:
01236
01237
01238
01239
01240
01241
return CBNcCreateHandler(pcbox, pwnd);
01242
01243
case WM_PARENTNOTIFY:
01244
if (LOWORD(wParam) == WM_DESTROY) {
01245
if ((HWND)lParam ==
HW(pcbox->
spwndEdit)) {
01246 pcbox->
CBoxStyle &= ~
SEDITABLE;
01247 pcbox->
fNoEdit =
TRUE;
01248 pcbox->
spwndEdit = pwnd;
01249 }
else if ((HWND)lParam ==
HW(pcbox->
spwndList)) {
01250 pcbox->
CBoxStyle &= ~
SDROPPABLE;
01251 pcbox->
spwndList =
NULL;
01252 }
01253 }
01254
break;
01255
01256
case WM_UPDATEUISTATE:
01257
01258
01259
01260 UserAssert(pcbox->
spwndList);
01261
ThreadLock(pcbox->
spwndList, &tlpwndList);
01262
SendMessageWorker(pcbox->
spwndList, WM_UPDATEUISTATE,
01263 wParam, lParam, fAnsi);
01264
ThreadUnlock(&tlpwndList);
01265
goto CallDWP;
01266
01267
case WM_HELP:
01268 {
01269 LPHELPINFO lpHelpInfo;
01270
01271
01272
01273
if ((lpHelpInfo = (LPHELPINFO)lParam) !=
NULL &&
01274 ((pcbox->
spwndEdit && lpHelpInfo->iCtrlId == (
SHORT)(
PTR_TO_ID(pcbox->
spwndEdit->
spmenu))) ||
01275 lpHelpInfo->iCtrlId == (
SHORT)(
PTR_TO_ID(pcbox->
spwndList->
spmenu)) )) {
01276
01277
01278 lpHelpInfo->iCtrlId = (
SHORT)(
PTR_TO_ID(pwnd->
spmenu));
01279 lpHelpInfo->hItemHandle = hwnd;
01280 lpHelpInfo->dwContextId =
GetContextHelpId(pwnd);
01281 }
01282 }
01283
01284
01285
01286
01287
default:
01288
01289
if (
SYSMET(PENWINDOWS) &&
01290 (message >= WM_PENWINFIRST && message <= WM_PENWINLAST))
01291
goto CallEditSendMessage;
01292
01293 CallDWP:
01294
return DefWindowProcWorker(pwnd, message, wParam, lParam, fAnsi);
01295 }
01296
01297
return TRUE;
01298
01299
01300
01301
01302 CallEditSendMessage:
01303
if (!pcbox->
fNoEdit && pcbox->
spwndEdit) {
01304
01305
01306
01307
ThreadLock(pcbox->
spwndEdit, &tlpwndEdit);
01308 lReturn =
SendMessageWorker(pcbox->
spwndEdit, message,
01309 wParam, lParam, fAnsi);
01310
ThreadUnlock(&tlpwndEdit);
01311 }
01312
else {
01313 RIPERR0(ERROR_INVALID_COMBOBOX_MESSAGE, RIP_VERBOSE,
"");
01314 lReturn = CB_ERR;
01315 }
01316
return lReturn;
01317
01318 CallListSendMessage:
01319
01320
01321
01322 UserAssert(pcbox->
spwndList);
01323
ThreadLock(pcbox->
spwndList, &tlpwndList);
01324 lReturn =
SendMessageWorker(pcbox->
spwndList, message,
01325 wParam, lParam, fAnsi);
01326
ThreadUnlock(&tlpwndList);
01327
return lReturn;
01328
01329 }