01269 {
01270 LRESULT lt;
01271
PWND pwndT;
01272
TL tlpwndParent;
01273
TL tlpwndT;
01274
int icolBack;
01275
int icolFore;
01276
int i;
01277
01278
CheckLock(pwnd);
01279
01280
if (pwnd == (
PWND)-1) {
01281
return 0;
01282 }
01283
01284
if (message > WM_USER) {
01285
return 0;
01286 }
01287
01288
01289
01290
01291
01292
01293
01294
01295
01296
switch (message) {
01297
case WM_CLIENTSHUTDOWN:
01298
return xxxClientShutdown(pwnd, wParam);
01299
01300
case WM_NCACTIVATE:
01301
xxxDWP_DoNCActivate(pwnd, (LOWORD(wParam) ? NCA_ACTIVE : 0), (HRGN)lParam);
01302
return (LONG)
TRUE;
01303
01304
case WM_NCHITTEST:
01305
return FindNCHit(pwnd, (LONG)lParam);
01306
01307
case WM_NCCALCSIZE:
01308
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320
01321
01322
01323
xxxCalcClientRect(pwnd, (LPRECT)lParam, FALSE);
01324
break;
01325
01326
case WM_NCLBUTTONDOWN:
01327
case WM_NCLBUTTONUP:
01328
case WM_NCLBUTTONDBLCLK:
01329
xxxDWP_NCMouse(pwnd, message, (UINT)wParam, lParam);
01330
break;
01331
01332
case WM_CANCELMODE:
01333 {
01334
01335
01336
01337
01338
01339
xxxDWP_DoCancelMode(pwnd);
01340 }
01341
break;
01342
01343
case WM_NCCREATE:
01344
if (
TestWF(pwnd, (WFHSCROLL | WFVSCROLL))) {
01345
if (
_InitPwSB(pwnd) ==
NULL)
01346
return (LONG)
FALSE;
01347 }
01348
01349
#ifdef FE_SB // xxxDefWindowProc()
01350
01351
01352
01353
01354
01355
if (lParam) {
01356
PLARGE_STRING pstr = &((
PCREATESTRUCTEX)lParam)->strName;
01357
01358
if (pwnd->
head.rpdesk ==
NULL || pstr ==
NULL || pstr->
Buffer ==
NULL) {
01359 pwnd->
strName.
Length = 0;
01360
return TRUE;
01361 }
01362
01363
if ((pstr->
bAnsi && (pstr->
Length >=
sizeof(
BYTE)) &&
01364 (*(
PBYTE)(pstr->
Buffer) == 0xff)) ||
01365 (!pstr->
bAnsi && (pstr->
Length >=
sizeof(WCHAR)) &&
01366 (*(PWCHAR)(pstr->
Buffer) == 0xffff))) {
01367
01368
01369
01370
return (LONG)
TRUE;
01371 }
01372 }
01373
#endif // FE_SB
01374
01375
SetWF(pwnd, WFTITLESET);
01376
01377
return (LONG)
DefSetText(pwnd, &((
PCREATESTRUCTEX)lParam)->strName);
01378
01379
case WM_PRINT:
01380
return((LRESULT)
xxxDWPPrint(pwnd, (HDC) wParam, lParam));
01381
01382
case WM_NCPAINT:
01383 {
01384 HDC hdc;
01385
01386
01387
01388
SetWF(pwnd, WFMENUDRAW);
01389
01390
01391
01392
01393
01394 hdc =
_GetDCEx(pwnd,
01395 (HRGN)wParam,
01396 DCX_USESTYLE |
01397 DCX_WINDOW |
01398 DCX_INTERSECTRGN |
01399 DCX_NODELETERGN |
01400 DCX_LOCKWINDOWUPDATE);
01401
01402
xxxDrawWindowFrame(pwnd,
01403 hdc,
01404 FALSE,
01405 (
TestWF(pwnd, WFFRAMEON) &&
01406 (
GETPTI(pwnd)->pq == gpqForeground)));
01407
01408
_ReleaseDC(hdc);
01409
ClrWF(pwnd, WFMENUDRAW);
01410 }
01411
break;
01412
01413
case WM_ISACTIVEICON:
01414
return TestWF(pwnd, WFFRAMEON) != 0;
01415
01416
case WM_SETTEXT:
01417
01418
01419
01420
01421
01422
01423
01424
if (lt =
DefSetText(pwnd, (
PLARGE_STRING)lParam)) {
01425
01426
01427
01428
xxxRedrawTitle(pwnd, DC_TEXT);
01429
if (
FWINABLE()) {
01430
xxxWindowEvent(EVENT_OBJECT_NAMECHANGE, pwnd, OBJID_WINDOW, INDEXID_CONTAINER, 0);
01431 }
01432 }
01433
return lt;
01434
01435
case WM_GETTEXT:
01436
if (wParam != 0) {
01437
PLARGE_STRING pstr = (
PLARGE_STRING)lParam;
01438
01439
if (pwnd->
strName.
Length) {
01440
if (pstr->
bAnsi) {
01441 i = WCSToMB(pwnd->
strName.
Buffer,
01442 pwnd->
strName.
Length /
sizeof(WCHAR),
01443 (LPSTR *)&pstr->
Buffer, pstr->
MaximumLength - 1, FALSE);
01444 ((LPSTR)pstr->
Buffer)[i] = 0;
01445 pstr->
Length = i;
01446 }
else {
01447 i =
TextCopy(&pwnd->
strName, pstr->
Buffer, (UINT)wParam);
01448 pstr->
Length = i *
sizeof(WCHAR);
01449 }
01450
return i;
01451 }
01452
01453
01454
01455
01456
if (pstr->
bAnsi) {
01457 *(LPSTR)pstr->
Buffer = 0;
01458 }
else {
01459 *(LPWSTR)pstr->
Buffer = 0;
01460 }
01461 }
01462
return 0
L;
01463
01464
case WM_GETTEXTLENGTH:
01465
if (pwnd->
strName.
Length) {
01466
UINT cch;
01467
if (lParam) {
01468
RtlUnicodeToMultiByteSize(&cch,
01469 pwnd->
strName.
Buffer,
01470 pwnd->
strName.
Length);
01471 }
else {
01472 cch = pwnd->
strName.
Length /
sizeof(WCHAR);
01473 }
01474
return cch;
01475 }
01476
return 0
L;
01477
01478
case WM_CLOSE:
01479
xxxDestroyWindow(pwnd);
01480
break;
01481
01482
case WM_PAINT:
01483
case WM_PAINTICON:
01484
xxxDWP_Paint(pwnd);
01485
break;
01486
01487
case WM_ERASEBKGND:
01488
case WM_ICONERASEBKGND:
01489
return (LONG)
xxxDWP_EraseBkgnd(pwnd, message, (HDC)wParam);
01490
01491
case WM_SYNCPAINT:
01492
01493
01494
01495
01496
ClrWF(pwnd, WFSYNCPAINTPENDING);
01497
01498
01499
01500
01501
01502
01503
01504
01505
01506
01507
01508
01509
01510
01511
01512
01513
01514
01515
xxxInternalDoSyncPaint(pwnd, (DWORD)wParam);
01516
break;
01517
01518
case WM_QUERYOPEN:
01519
case WM_QUERYENDSESSION:
01520
case WM_DEVICECHANGE:
01521
case WM_POWERBROADCAST:
01522
return (LONG)
TRUE;
01523
01524
01525
case WM_RBUTTONUP:
01526
#ifdef USE_MIRRORING
01527
if (
TestWF(pwnd, WEFLAYOUTRTL)) {
01528 lParam = MAKELPARAM(pwnd->
rcClient.right -
GET_X_LPARAM(lParam),
GET_Y_LPARAM(lParam) + pwnd->
rcClient.top);
01529 }
else
01530
#endif
01531
{
01532 lParam = MAKELONG(
GET_X_LPARAM(lParam) + pwnd->
rcClient.left,
GET_Y_LPARAM(lParam) + pwnd->
rcClient.top);
01533 }
01534
xxxSendMessage(pwnd, WM_CONTEXTMENU, (WPARAM)
HWq(pwnd), lParam);
01535
break;
01536
01537
case WM_NCRBUTTONDOWN:
01538 {
01539
int nHit;
01540 MSG
msg;
01541 LONG spt;
01542
PTHREADINFO pti =
PtiCurrent();
01543
01544 nHit =
FindNCHit(pwnd, (LONG)lParam);
01545
if (nHit == HTVSCROLL || nHit == HTHSCROLL) {
01546
if (!
_IsDescendant(pti->
pq->
spwndActive, pwnd)) {
01547
break;
01548 }
01549 }
else if (nHit == HTCAPTION || nHit == HTSYSMENU) {
01550
if (pwnd != pti->
pq->
spwndActive) {
01551
break;
01552 }
01553 }
else {
01554
break;
01555 }
01556
01557
xxxSetCapture(pwnd);
01558
01559
while (
TRUE)
01560 {
01561
if (
xxxPeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE))
01562 {
01563
if (
msg.message == WM_RBUTTONUP)
01564 {
01565
xxxReleaseCapture();
01566 spt = POINTTOPOINTS(
msg.pt);
01567 nHit =
FindNCHit(pwnd, spt);
01568
if ((nHit == HTCAPTION) || (nHit == HTSYSMENU) ||
01569 (nHit == HTVSCROLL) || (nHit == HTHSCROLL)) {
01570
xxxSendMessage(pwnd, WM_CONTEXTMENU, (WPARAM)
HWq(pwnd), spt);
01571 }
01572
break;
01573 }
01574 }
01575
if (pwnd != pti->
pq->
spwndCapture)
01576
01577
break;
01578
01579
if (!
xxxSleepThread(QS_MOUSE, 0, TRUE))
01580
break;
01581 }
01582 }
01583
break;
01584
01585
01586
01587
01588
case WM_NCXBUTTONUP:
01589
case WM_XBUTTONUP:
01590 {
01591 WORD cmd;
01592 WORD keystate;
01593 LPARAM lParamAppCommand;
01594
01595 cmd = 0;
01596
switch (GET_XBUTTON_WPARAM(wParam)) {
01597
case XBUTTON1:
01598 cmd = APPCOMMAND_BROWSER_BACKWARD;
01599
break;
01600
01601
case XBUTTON2:
01602 cmd = APPCOMMAND_BROWSER_FORWARD;
01603
break;
01604
01605
default:
01606
break;
01607 }
01608
01609
if (cmd == 0) {
01610
break;
01611 }
01612
01613 cmd |= FAPPCOMMAND_MOUSE;
01614
if (message == WM_XBUTTONUP) {
01615 keystate = GET_KEYSTATE_WPARAM(wParam);
01616 }
else {
01617 keystate = (WORD)
GetMouseKeyFlags(
PtiCurrent()->pq);
01618 }
01619
01620 lParamAppCommand = MAKELPARAM(keystate, cmd);
01621
xxxSendMessage(pwnd, WM_APPCOMMAND, (WPARAM)
HWq(pwnd), lParamAppCommand);
01622
break;
01623 }
01624
01625
case WM_MOUSEWHEEL:
01626
if (
TestwndChild(pwnd)) {
01627
ThreadLockAlways(pwnd->
spwndParent, &tlpwndParent);
01628
xxxSendMessage(pwnd->
spwndParent, WM_MOUSEWHEEL, wParam, lParam);
01629
ThreadUnlock(&tlpwndParent);
01630 }
01631
break;
01632
01633
case WM_CONTEXTMENU:
01634 {
01635
int nHit;
01636
01637 nHit =
FindNCHit(pwnd, (LONG)lParam);
01638
01639
01640
01641
01642
if ((nHit == HTVSCROLL) || (nHit == HTHSCROLL)) {
01643
if (
_IsDescendant(
PtiCurrent()->pq->spwndActive, pwnd)) {
01644
xxxDoScrollMenu(pwnd, NULL, nHit - HTHSCROLL, lParam);
01645 }
01646
break;
01647 }
01648
01649
if (
TestwndChild(pwnd)) {
01650
ThreadLockAlways(pwnd->
spwndParent, &tlpwndParent);
01651
xxxSendMessage(pwnd->
spwndParent, WM_CONTEXTMENU, (WPARAM)
HWq(pwnd), lParam);
01652
ThreadUnlock(&tlpwndParent);
01653 }
else {
01654
01655
01656
01657
if (pwnd ==
PtiCurrent()->pq->spwndActive)
01658 {
01659
if (nHit == HTCAPTION)
01660
goto DoTheDefaultThang;
01661
else if (nHit == HTSYSMENU)
01662 {
01663 i = SC_CLOSE;
01664
goto DoTheSysMenuThang;
01665 }
01666
01667
01668
01669
01670
01671
if (lParam ==
KEYBOARD_MENU && !
TestWF(pwnd, WFWIN40COMPAT))
01672
xxxSimulateShiftF10();
01673 }
01674 }
01675 }
01676
break;
01677
01678
case WM_APPCOMMAND:
01679
01680
01681
01682
if (
TestwndChild(pwnd)) {
01683
ThreadLockAlways(pwnd->
spwndParent, &tlpwndParent);
01684 lt =
xxxSendMessage(pwnd->
spwndParent, WM_APPCOMMAND, wParam, lParam);
01685
ThreadUnlock(&tlpwndParent);
01686
return lt;
01687 }
else if (pwnd !=
PWNDDESKTOP(pwnd) ) {
01688
01689
01690
01691
01692
01693
01694
01695
if (
IsHooked(
PtiCurrent(), WHF_SHELL))
01696
xxxCallHook(HSHELL_APPCOMMAND, wParam, lParam, WH_SHELL);
01697
01698
01699
01700
01701
PostShellHookMessages(HSHELL_APPCOMMAND, lParam);
01702 }
01703
break;
01704
01705
case WM_KEYF1:
01706
xxxSendHelpMessage(pwnd, HELPINFO_WINDOW,
01707 (
int) (
TestwndChild(pwnd) ?
PTR_TO_ID(pwnd->spmenu) : 0),
01708
HWq(pwnd),
GetContextHelpId(pwnd));
01709
break;
01710
01711
case WM_SYSCOMMAND:
01712
xxxSysCommand(pwnd, (UINT)wParam, lParam);
01713
break;
01714
01715
case WM_KEYDOWN:
01716
if (wParam == VK_F10) {
01717
PtiCurrent()->pq->QF_flags |=
QF_FF10STATUS;
01718 HandleF10:
01719
01720
01721
01722
if (
_GetKeyState(VK_SHIFT) < 0 &&
TestWF(pwnd, WFWIN40COMPAT)) {
01723
xxxSendMessage(pwnd, WM_CONTEXTMENU, (WPARAM)
HWq(pwnd), KEYBOARD_MENU);
01724 }
01725 }
01726
break;
01727
01728
case WM_HELP:
01729
01730
01731 pwndT = (
TestwndChild(pwnd)? pwnd->spwndParent : pwnd->spwndOwner);
01732
if (pwndT && (pwndT !=
_GetDesktopWindow())) {
01733
ThreadLockAlways(pwndT, &tlpwndT);
01734 lt =
xxxSendMessage(pwndT, WM_HELP, wParam, lParam);
01735
ThreadUnlock(&tlpwndT);
01736
return lt;
01737 }
01738
return 0
L;
01739
01740
case WM_SYSKEYDOWN:
01741 {
01742
PTHREADINFO pti =
PtiCurrent();
01743
01744
01745
01746
01747
if (HIWORD(lParam) &
SYS_ALTERNATE) {
01748
01749
01750
01751
01752
01753
01754
if ((HIWORD(lParam) &
SYS_PREVKEYSTATE) == 0) {
01755
01756
01757
01758
01759
01760
if ((wParam == VK_MENU) &&
01761 !(pti->
pq->
QF_flags &
QF_FMENUSTATUS)) {
01762 pti->
pq->
QF_flags |=
QF_FMENUSTATUS;
01763
xxxDrawMenuBarUnderlines(pwnd, TRUE);
01764 }
else {
01765 pti->
pq->
QF_flags &= ~(
QF_FMENUSTATUS|
QF_FMENUSTATUSBREAK);
01766 }
01767 }
01768
01769 pti->
pq->
QF_flags &= ~
QF_FF10STATUS;
01770
01771
xxxDWP_ProcessVirtKey((UINT)wParam);
01772
01773 }
else {
01774
if (wParam == VK_F10) {
01775 pti->
pq->
QF_flags |=
QF_FF10STATUS;
01776
goto HandleF10;
01777 }
01778 }
01779 }
01780
break;
01781
01782
case WM_SYSKEYUP:
01783
case WM_KEYUP:
01784 {
01785
PTHREADINFO pti =
PtiCurrent();
01786
01787
01788
01789
01790
01791
01792
01793
01794
01795
if ((wParam == VK_MENU && !(pti->
pq->
QF_flags &
QF_TABSWITCHING) && ((pti->
pq->
QF_flags &
01796 (
QF_FMENUSTATUS |
QF_FMENUSTATUSBREAK)) ==
QF_FMENUSTATUS)) ||
01797 (wParam == VK_F10 && (pti->
pq->
QF_flags &
QF_FF10STATUS ))) {
01798 pwndT =
GetTopLevelWindow(pwnd);
01799
if (
gspwndFullScreen != pwndT) {
01800
01801
ThreadLockWithPti(pti, pwndT, &tlpwndT);
01802
01803
01804
01805
01806
if (wParam == VK_F10) {
01807
xxxDrawMenuBarUnderlines(pwnd, TRUE);
01808 }
01809
xxxSendMessage(pwndT, WM_SYSCOMMAND, SC_KEYMENU, 0);
01810
ThreadUnlock(&tlpwndT);
01811 }
01812 }
01813
01814
01815
01816
01817
01818
01819
01820
01821
01822
if (wParam == VK_MENU) {
01823 pti->
pq->
QF_flags &= ~
QF_TABSWITCHING;
01824
xxxDrawMenuBarUnderlines(pwnd, FALSE);
01825 }
01826
01827 pti->
pq->
QF_flags &= ~(
QF_FMENUSTATUS |
QF_FMENUSTATUSBREAK |
QF_FF10STATUS);
01828 }
01829
break;
01830
01831
case WM_SYSCHAR:
01832 {
01833
PTHREADINFO pti =
PtiCurrent();
01834
01835
01836
01837
01838 pti->
pq->
QF_flags &= ~(
QF_FMENUSTATUS |
QF_FMENUSTATUSBREAK);
01839
01840
if (wParam == VK_RETURN &&
TestWF(pwnd, WFMINIMIZED)) {
01841
01842
01843
01844
01845
01846
_PostMessage(pwnd, WM_SYSCOMMAND, SC_RESTORE, 0L);
01847
break;
01848 }
01849
01850
if ((HIWORD(lParam) &
SYS_ALTERNATE) && wParam) {
01851
if (wParam == VK_TAB || wParam == VK_ESCAPE)
01852
break;
01853
01854
01855
01856
01857
if ((wParam ==
MENUSYSMENU) && (
TestwndChild(pwnd))) {
01858
ThreadLockAlwaysWithPti(pti, pwnd->spwndParent, &tlpwndParent);
01859
xxxSendMessage(pwnd->spwndParent, message, wParam, lParam);
01860
ThreadUnlock(&tlpwndParent);
01861 }
else {
01862
xxxSendMessage(pwnd, WM_SYSCOMMAND, SC_KEYMENU, (DWORD)wParam);
01863 }
01864 }
else {
01865
01866
01867
01868
01869
if (wParam != VK_ESCAPE)
01870
xxxMessageBeep(0);
01871 }
01872 }
01873
break;
01874
01875
case WM_CHARTOITEM:
01876
case WM_VKEYTOITEM:
01877
01878
01879
01880
01881
return -1
L;
01882
01883
case WM_ACTIVATE:
01884
if (wParam)
01885
xxxSetFocus(pwnd);
01886
break;
01887
01888
case WM_INPUTLANGCHANGEREQUEST:
01889 {
01890
PWND pwndFocus =
PtiCurrent()->pq->spwndFocus;
01891
01892
01893
01894
01895
01896
01897
if (pwndFocus && (pwndFocus != pwnd) &&
01898 pwnd->
pcls->
atomClassName !=
gpsi->
atomSysClass[
ICLS_DIALOG]) {
01899
01900
01901
01902
01903
01904
ThreadLockAlways(pwndFocus, &tlpwndT);
01905
xxxSendMessage(pwndFocus, message, wParam, lParam);
01906
ThreadUnlock(&tlpwndT);
01907 }
else if (!
xxxActivateKeyboardLayout(
_GetProcessWindowStation(NULL),
01908 (HKL)lParam, KLF_SETFORPROCESS, pwnd)) {
01909 RIPERR1(ERROR_INVALID_KEYBOARD_HANDLE, RIP_WARNING,
"WM_INPUTLANGCHANGEREQUEST: Invalid keyboard handle (0x%08lx)", lParam);
01910 }
01911
break;
01912 }
01913
01914
case WM_INPUTLANGCHANGE:
01915 {
01916
PBWL pbwl;
01917 HWND *phwnd;
01918
TL tlpwnd;
01919
01920 pbwl =
BuildHwndList(pwnd->spwndChild, BWL_ENUMLIST, NULL);
01921
if (pbwl ==
NULL)
01922
return 0;
01923
01924
for (phwnd = pbwl->
rghwnd; *phwnd != (HWND)1; phwnd++) {
01925
01926
01927
01928
if ((pwnd =
RevalidateHwnd(*phwnd)) ==
NULL)
01929
continue;
01930
01931
ThreadLockAlways(pwnd, &tlpwnd);
01932 RIPMSG1(RIP_VERBOSE,
"WM_INPUTLANGCHANGE: Sending message to pwnd %#p", pwnd);
01933
xxxSendMessage(pwnd, message, wParam, lParam);
01934
ThreadUnlock(&tlpwnd);
01935 }
01936
FreeHwndList(pbwl);
01937
01938
break;
01939 }
01940
01941
case WM_SETREDRAW:
01942
xxxDWP_SetRedraw(pwnd, wParam != 0);
01943
break;
01944
01945
case WM_WINDOWPOSCHANGING:
01946 {
01947
01948
01949
01950 WINDOWPOS *
ppos = ((WINDOWPOS *)lParam);
01951
if (!(
ppos->flags & SWP_NOSIZE)) {
01952
xxxAdjustSize(pwnd, &
ppos->cx, &
ppos->cy);
01953 }
01954 }
01955
break;
01956
01957
case WM_WINDOWPOSCHANGED:
01958
xxxHandleWindowPosChanged(pwnd, (PWINDOWPOS)lParam);
01959
break;
01960
01961
case WM_CTLCOLORSCROLLBAR:
01962
if (
gpsi->BitCount < 8 ||
01963
SYSRGB(3DHILIGHT) !=
SYSRGB(SCROLLBAR) ||
01964
SYSRGB(3DHILIGHT) ==
SYSRGB(WINDOW))
01965 {
01966
01967
01968
01969
01970
01971
01972
01973 GreSetBkColor((HDC)wParam,
SYSRGB(3DHILIGHT));
01974 GreSetTextColor((HDC)wParam,
SYSRGB(3DFACE));
01975
return((LRESULT)
gpsi->hbrGray);
01976 }
01977
01978 icolBack = COLOR_3DHILIGHT;
01979 icolFore = COLOR_BTNTEXT;
01980
goto SetColor;
01981
01982
case WM_CTLCOLORBTN:
01983
if (
TestWF(pwnd, WFWIN40COMPAT)) {
01984 icolBack = COLOR_3DFACE;
01985 icolFore = COLOR_BTNTEXT;
01986 }
else {
01987
goto ColorDefault;
01988 }
01989
goto SetColor;
01990
01991
case WM_CTLCOLORSTATIC:
01992
case WM_CTLCOLORDLG:
01993
case WM_CTLCOLORMSGBOX:
01994
01995
01996
01997
if (
TestWF(pwnd, WFWIN40COMPAT)
01998 ) {
01999 icolBack = COLOR_3DFACE;
02000 icolFore = COLOR_WINDOWTEXT;
02001
goto SetColor;
02002 }
02003
02004
02005
case WM_CTLCOLOR:
02006
case WM_CTLCOLORLISTBOX:
02007
case WM_CTLCOLOREDIT:
02008 ColorDefault:
02009 icolBack = COLOR_WINDOW;
02010 icolFore = COLOR_WINDOWTEXT;
02011
02012 SetColor:
02013 GreSetBkColor((HDC)wParam,
gpsi->argbSystem[icolBack]);
02014 GreSetTextColor((HDC)wParam,
gpsi->argbSystem[icolFore]);
02015
return (LRESULT)(
SYSHBRUSH(icolBack));
02016
02017
case WM_SETCURSOR:
02018
02019
02020
02021
02022
02023
02024
return (LONG)
xxxDWP_SetCursor(pwnd, (HWND)wParam, (
int)(SHORT)lParam,
02025 HIWORD(lParam));
02026
02027
case WM_MOUSEACTIVATE:
02028 pwndT =
GetChildParent(pwnd);
02029
if (pwndT !=
NULL) {
02030
ThreadLockAlways(pwndT, &tlpwndT);
02031 lt =
xxxSendMessage(pwndT, WM_MOUSEACTIVATE, wParam, lParam);
02032
ThreadUnlock(&tlpwndT);
02033
if (lt != 0)
02034
return lt;
02035 }
02036
02037
02038
02039
02040
02041
return ( (LOWORD(lParam) == HTCAPTION)
02042 && (HIWORD(lParam) == WM_LBUTTONDOWN)
02043 )
02044 ? (LONG)MA_NOACTIVATE
02045 : (LONG)MA_ACTIVATE;
02046
02047
case WM_SHOWWINDOW:
02048
02049
02050
02051
02052
02053
02054
02055
02056
02057
if (LOWORD(lParam) != 0 && (
TestwndPopup(pwnd) || pwnd->spwndOwner)) {
02058
02059
02060
02061
02062
02063
02064
02065
02066
02067
02068
02069
02070
02071
if ((!wParam &&
TestWF(pwnd, WFVISIBLE)) ||
02072 (wParam && !
TestWF(pwnd, WFVISIBLE) &&
02073
TestWF(pwnd, WFHIDDENPOPUP))) {
02074
02075
02076
02077
02078
ClrWF(pwnd, WFHIDDENPOPUP);
02079
if (!wParam)
02080
SetWF(pwnd, WFHIDDENPOPUP);
02081
02082
xxxShowWindow(
02083 pwnd,
02084 (wParam ? SW_SHOWNOACTIVATE : SW_HIDE) |
TEST_PUDF(PUDF_ANIMATE));
02085 }
02086 }
02087
break;
02088
02089
case WM_SYSMENU:
02090
if ( !
TestWF(pwnd, WFDISABLED)
02091 && ( (
GETPTI(pwnd)->pq ==
gpqForeground)
02092 ||
xxxSetForegroundWindow(pwnd, FALSE))
02093 )
02094 {
02095
PMENU pMenu;
02096
TL tpmenu;
02097 DoTheDefaultThang:
02098
if (
TestWF(pwnd, WFMAXIMIZED) ||
TestWF(pwnd, WFMINIMIZED))
02099 i = SC_RESTORE;
02100
else
02101 i = SC_MAXIMIZE;
02102
02103 DoTheSysMenuThang:
02104
if ((pMenu =
xxxGetSysMenu(pwnd, TRUE)) !=
NULL)
02105 {
02106
_SetMenuDefaultItem(pMenu, i, MF_BYCOMMAND);
02107
02108
02109
PostShellHookMessages(HSHELL_SYSMENU, (LPARAM)
HWq(pwnd));
02110
02111
ThreadLockAlways(pMenu, &tpmenu);
02112
if (lParam == 0xFFFFFFFF)
02113 {
02114
02115
if (
FDoTray())
02116 {
02117 TPMPARAMS tpm;
02118
02119 tpm.cbSize =
sizeof(TPMPARAMS);
02120
02121
if (
xxxSendMinRectMessages(pwnd, &tpm.rcExclude)) {
02122
xxxTrackPopupMenuEx(pMenu, TPM_SYSMENU | TPM_VERTICAL,
02123 tpm.rcExclude.left, tpm.rcExclude.top, pwnd, &tpm);
02124 }
02125 }
02126 }
02127
else
02128 {
02129
xxxTrackPopupMenuEx(pMenu, TPM_RIGHTBUTTON | TPM_SYSMENU,
02130
GET_X_LPARAM(lParam),
GET_Y_LPARAM(lParam), pwnd, NULL);
02131 }
02132
ThreadUnlock(&tpmenu);
02133 }
02134 }
02135
break;
02136
02137
case WM_DRAWITEM:
02138
DWP_DrawItem((LPDRAWITEMSTRUCT)lParam);
02139
break;
02140
02141
case WM_GETHOTKEY:
02142
return (LONG)
DWP_GetHotKey(pwnd);
02143
break;
02144
02145
case WM_SETHOTKEY:
02146
return (LONG)
DWP_SetHotKey(pwnd, (DWORD)wParam);
02147
break;
02148
02149
case WM_GETICON:
02150
return (LRESULT)
DWP_GetIcon(pwnd, (BOOL)wParam);
02151
02152
case WM_SETICON:
02153
return (LRESULT)
xxxDWP_SetIcon(pwnd, wParam, (HICON)lParam);
02154
02155
case WM_COPYGLOBALDATA:
02156
02157
02158
02159
02160
02161
02162
02163
return(SfnCOPYGLOBALDATA(NULL, 0, wParam, lParam, 0, 0, 0, NULL));
02164
02165
case WM_QUERYDROPOBJECT:
02166
02167
02168
02169
return (LRESULT)(
TestWF(pwnd, WEFACCEPTFILES) ?
TRUE :
FALSE);
02170
02171
case WM_DROPOBJECT:
02172
return DO_DROPFILE;
02173
02174
case WM_ACCESS_WINDOW:
02175
if (
ValidateHwnd((HWND)wParam)) {
02176
02177
return TRUE;
02178 }
02179
return FALSE;
02180
02181
case WM_NOTIFYFORMAT:
02182
if(lParam == NF_QUERY)
02183
return(
TestWF(pwnd, WFANSICREATOR) ? NFR_ANSI : NFR_UNICODE);
02184
break;
02185
02186
case WM_CHANGEUISTATE:
02187 {
02188 WORD wAction = LOWORD(wParam);
02189 WORD wFlags = HIWORD(wParam);
02190
BOOL bRealChange =
FALSE;
02191
02192
if (wFlags & ~UISF_VALID || wAction > UIS_LASTVALID ||
02193 lParam || !
TEST_KbdCuesPUSIF) {
02194
return 0;
02195 }
02196
02197
if (wAction == UIS_INITIALIZE) {
02198
if (
gpsi->bLastRITWasKeyboard) {
02199 wAction = UIS_CLEAR;
02200 }
else {
02201 wAction = UIS_SET;
02202 }
02203 wFlags = UISF_HIDEFOCUS | UISF_HIDEACCEL;
02204 wParam = MAKEWPARAM(wAction, wFlags);
02205 }
02206
02207 UserAssert(wAction == UIS_SET || wAction == UIS_CLEAR);
02208
02209
02210
02211
if (wFlags & UISF_HIDEFOCUS) {
02212 bRealChange = (!!
TestWF(pwnd, WEFPUIFOCUSHIDDEN)) ^ (wAction == UIS_SET);
02213 }
02214
if (wFlags & UISF_HIDEACCEL) {
02215 bRealChange |= (!!
TestWF(pwnd, WEFPUIACCELHIDDEN)) ^ (wAction == UIS_SET);
02216 }
02217
02218
if (!bRealChange) {
02219
break;
02220 }
02221
02222
02223
02224
02225
02226
02227
if (
TestwndChild(pwnd)) {
02228
ThreadLockAlways(pwnd->spwndParent, &tlpwndParent);
02229 lt =
xxxSendMessage(pwnd->spwndParent, WM_CHANGEUISTATE, wParam, lParam);
02230
ThreadUnlock(&tlpwndParent);
02231
return lt;
02232 }
else {
02233
return xxxSendMessage(pwnd, WM_UPDATEUISTATE, wParam, lParam);
02234 }
02235
02236 }
02237
break;
02238
02239
case WM_QUERYUISTATE:
02240
return (
TestWF(pwnd, WEFPUIFOCUSHIDDEN) ? UISF_HIDEFOCUS : 0) |
02241 (
TestWF(pwnd, WEFPUIACCELHIDDEN) ? UISF_HIDEACCEL : 0);
02242
break;
02243
02244
case WM_UPDATEUISTATE:
02245 {
02246 WORD wAction = LOWORD(wParam);
02247 WORD wFlags = HIWORD(wParam);
02248
02249
if (wFlags & ~UISF_VALID || wAction > UIS_LASTVALID ||
02250 lParam || !
TEST_KbdCuesPUSIF) {
02251
return 0;
02252 }
02253
02254
switch (wAction) {
02255
case UIS_INITIALIZE:
02256
02257
02258
02259
02260
if (!
gpsi->bLastRITWasKeyboard) {
02261
SetWF(pwnd, WEFPUIFOCUSHIDDEN);
02262
SetWF(pwnd, WEFPUIACCELHIDDEN);
02263 wParam = MAKEWPARAM(UIS_SET, UISF_HIDEACCEL | UISF_HIDEFOCUS);
02264 }
else {
02265
ClrWF(pwnd, WEFPUIFOCUSHIDDEN);
02266
ClrWF(pwnd, WEFPUIACCELHIDDEN);
02267 wParam = MAKEWPARAM(UIS_CLEAR, UISF_HIDEACCEL | UISF_HIDEFOCUS);
02268 }
02269
break;
02270
02271
case UIS_SET:
02272
if (wFlags & UISF_HIDEACCEL) {
02273
SetWF(pwnd, WEFPUIACCELHIDDEN);
02274 }
02275
if (wFlags & UISF_HIDEFOCUS) {
02276
SetWF(pwnd, WEFPUIFOCUSHIDDEN);
02277 }
02278
break;
02279
02280
case UIS_CLEAR:
02281
if (wFlags & UISF_HIDEACCEL) {
02282
ClrWF(pwnd, WEFPUIACCELHIDDEN);
02283 }
02284
if (wFlags & UISF_HIDEFOCUS) {
02285
ClrWF(pwnd, WEFPUIFOCUSHIDDEN);
02286 }
02287
break;
02288
02289
default:
02290
break;
02291 }
02292
02293
02294
02295
02296
if (pwnd->spwndChild) {
02297
02298
PBWL pbwl;
02299 HWND *phwnd;
02300
TL tlpwnd;
02301
02302 pbwl =
BuildHwndList(pwnd->spwndChild, BWL_ENUMLIST, NULL);
02303
if (pbwl ==
NULL)
02304
return 0;
02305
02306
for (phwnd = pbwl->
rghwnd; *phwnd != (HWND)1; phwnd++) {
02307
02308
02309
02310
if ((pwnd =
RevalidateHwnd(*phwnd)) ==
NULL)
02311
continue;
02312
02313
ThreadLockAlways(pwnd, &tlpwnd);
02314
xxxSendMessage(pwnd, message, wParam, lParam);
02315
ThreadUnlock(&tlpwnd);
02316 }
02317
FreeHwndList(pbwl);
02318 }
02319 }
02320
break;
02321
02322
#ifdef PENWIN20
02323
02324
default:
02325
02326
02327
02328
02329
if ( (message >= WM_HANDHELDFIRST)
02330 && (message <= WM_HANDHELDLAST)
02331 ) {
02332
if (lpfnHandHeld !=
NULL)
02333
return (*lpfnHandHeld)(HW16(pwnd), message, wParamLo, lParam);
02334 }
else if ( (message >= WM_PENWINFIRST)
02335 && (message <= WM_PENWINLAST)
02336 ) {
02337
if (
SYSMET(PENWINDOWS))
02338
return DefPenWindowProc(pwnd, message, wParamLo, lParam);
02339 }
02340
02341
#endif // PENWIN20
02342
}
02343
02344
return 0;
02345 }