<div>Hi Nikolay,</div><div>I update a new patch, do you think is it OK now ?</div><div>Thank you.</div><div><br></div><div><sign signid="0"><div style="color:#909090;font-family:Arial Narrow;font-size:12px"><br><br><br><br>------------------</div><div style="font-size:14px;font-family:Verdana;color:#000;"><div>Regards,</div><div>Changhui.</div>
</div></sign></div><div> </div><div><includetail><div> </div><div> </div><div style="font:Verdana normal 14px;color:#000;"><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div id="menu_sender"><b>From: </b> "Nikolay Sivov"<bunglehead@gmail.com>;</div><div><b>Date: </b> Wed, Feb 25, 2015 04:12 PM</div><div><b>To: </b> "Changhui Liu"<liuchanghui@linuxdeepin.com>; <wbr></div><div><b>Cc: </b> "wine-devel"<wine-devel@winehq.org>; <wbr></div><div><b>Subject: </b> Re: comctl32: SysDateTimePick32 control add Alt+down hot key likewindows(try 2)</div></div><div> </div>On 25.02.2015 10:56, Changhui Liu wrote:<br>> Superseded patch 109085<br>> http://source.winehq.org/patches/data/109085<br>><br>> Change log:<br>> 1, Pass test on all Windows.<br>><br>> 2, Add DTN_DROPDOWN and DTN_CLOSEUPnotification test.<br>><br>> 3,<br>><br>>>>/  +    case WM_SYSKEYDOWN:<br>> />>/  +        if (wParam == VK_DOWN)<br>> />>/  +        {<br>> />>/  +            POINT pt;<br>> />>/  +            RECT rect;<br>> />>/  +            GetClientRect(hwnd, &rect);<br>> />>/  +            pt.x = rect.right - GetSystemMetrics(SM_CXVSCROLL)/2;<br>> />>/  +            pt.y = rect.top + GetSystemMetrics(SM_CYHSCROLL)/2;<br>> />>/  +<br>> />>/  +            return DATETIME_LButtonDown (infoPtr, (SHORT)pt.x, (SHORT)pt.y);<br>> />>/  +        }<br>> />>/  +<br>> />><br>>>>If it really works this way you should just make it drop directly,<br>>>without faking click point coordinates.<br>><br>> Because most of code of the directly implement are same as DATETIME_LButtonDown,<br>> and too many repeat code looks bad.<br>> So faking click point coordinates can reuse code.<br>><br><br>I'm not saying you should duplicate it, but reuse it in a clean way <br>without hit testing - move relevant code somewhere and use it.<br><br>> +    if (WM_NOTIFY == message)<br>> +    {<br>> +        NMHDR* hdr = (NMHDR*)lParam;<br>> +<br>> +        if (hdr->code == DTN_DROPDOWN)<br>> +        {<br>> +            g_hWndMonthCal = (HWND)SendMessageA(hdr->hwndFrom, DTM_GETMONTHCAL, 0, 0);<br>> +            trace("open SysMonthCal32=%p\n", g_hWndMonthCal );<br>> +        }<br>> +        else if (hdr->code == DTN_CLOSEUP)<br>> +        {<br>> +            trace("close SysMonthCal32=%p\n", g_hWndMonthCal);<br>> +        }<br>> +    }<br><br>That's not a notification test as you don't check anything. Please add a <br>proper message sequence test, we have tons of examples for those.<br></div><!--<![endif]--></includetail></div>