[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH] include/commctrl: ListView_SetItemState should be character width agnostic
From:       David Kahurani <k.kahurani () gmail ! com>
Date:       2021-10-31 16:32:17
Message-ID: CAAZOf262S1VYhgFSrwa7jB7D3xrhBM5xJKwCwc0sAe_RCdg6-g () mail ! gmail ! com
[Download RAW message or body]

On Sun, Oct 31, 2021 at 7:29 PM Nikolay Sivov <nsivov@codeweavers.com>
wrote:

>
>
> On 10/31/21 7:24 PM, David Kahurani wrote:
>
>
>
> On Sun, Oct 31, 2021 at 7:17 PM Nikolay Sivov <nsivov@codeweavers.com>
> wrote:
>
>>
>>
>> On 10/31/21 7:14 PM, David Kahurani wrote:
>>
>>
>>
>> On Sun, Oct 31, 2021 at 7:11 PM Nikolay Sivov <nsivov@codeweavers.com>
>> wrote:
>>
>>>
>>>
>>> On 10/31/21 6:34 PM, David Kahurani wrote:
>>> > Signed-off-by: David Kahurani <k.kahurani@gmail.com>
>>> > ---
>>> >  include/commctrl.h | 4 ++--
>>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>>> >
>>> > diff --git a/include/commctrl.h b/include/commctrl.h
>>> > index 41abceb..d67f5f7 100644
>>> > --- a/include/commctrl.h
>>> > +++ b/include/commctrl.h
>>> > @@ -3939,8 +3939,8 @@ typedef struct tagLVITEMINDEX
>>> >      (INT)SNDMSGW((hwnd),LVM_SETITEMW,0,(LPARAM)(const LVITEMW
>>> *)(pitem))
>>> >  #define ListView_SetItem WINELIB_NAME_AW(ListView_SetItem)
>>> >  #define ListView_SetItemState(hwnd,i,data,dataMask) \
>>> > -{ LVITEM _LVi; _LVi.state = data; _LVi.stateMask = dataMask;\
>>> > -  SNDMSG(hwnd, LVM_SETITEMSTATE, (WPARAM)(UINT)i, (LPARAM)
>>> (LPLVITEM)&_LVi);}
>>> > +{ LVITEMW _LVi; _LVi.state = data; _LVi.stateMask = dataMask;\
>>> > +  SNDMSGW(hwnd, LVM_SETITEMSTATE, (WPARAM)(UINT)i, (LPARAM)
>>> (LPLVITEMW)&_LVi);}
>>> >  #define ListView_GetItemState(hwnd,i,mask) \
>>> >
>>> (UINT)SNDMSG((hwnd),LVM_GETITEMSTATE,(WPARAM)(UINT)(i),(LPARAM)(UINT)(mask))
>>> >  #define ListView_SetCheckState(hwndLV, i, bCheck) \
>>>
>>> This doesn't match what SDK does.
>>>
>>> Are you saying there is some other magic beyond what is already in this
>> macro or a difference in width(s) used?
>>
>>
>> SNDMSG resolves to either SendMessageA or SendMessageW, I don't see
>> anything special for _SetItemState() in SDK.
>>
>
> SNDMSG will resolve to an error if you try to use this macro. LVMITEM
> should also be either LVMITEMA or LVMITEMW. It looked to me like this code
> preceeds these conventions.
>
>
>> It's not clear what motivated this change, could you clarify?
>>
>
> I was trying to use ListView_SetItemState in some other code.
>
>
>
Brilliant, thanks for clearing that up.

If you tried to use it in Wine, yes, it won't work, because you can't use
> SendMessage macro when in __WINESRC__. Instead of ListView_* macros you'll
> need to make explicit SendMessage calls.
>

[Attachment #3 (text/html)]

<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Sun, Oct 31, 2021 at 7:29 PM Nikolay Sivov &lt;<a \
href="mailto:nsivov@codeweavers.com">nsivov@codeweavers.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  
    
  
  <div>
    <br>
    <br>
    <div>On 10/31/21 7:24 PM, David Kahurani
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="ltr"><br>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Sun, Oct 31, 2021 at 7:17
            PM Nikolay Sivov &lt;<a href="mailto:nsivov@codeweavers.com" \
target="_blank">nsivov@codeweavers.com</a>&gt;  wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  <div> <br>
              <br>
              <div>On 10/31/21 7:14 PM, David Kahurani wrote:<br>
              </div>
              <blockquote type="cite">
                <div dir="ltr">
                  <div dir="ltr"><br>
                  </div>
                  <br>
                  <div class="gmail_quote">
                    <div dir="ltr" class="gmail_attr">On Sun, Oct 31,
                      2021 at 7:11 PM Nikolay Sivov &lt;<a \
href="mailto:nsivov@codeweavers.com" target="_blank">nsivov@codeweavers.com</a>&gt;  \
wrote:<br>  </div>
                    <blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>  <br>
                      On 10/31/21 6:34 PM, David Kahurani wrote:<br>
                      &gt; Signed-off-by: David Kahurani &lt;<a \
href="mailto:k.kahurani@gmail.com" target="_blank">k.kahurani@gmail.com</a>&gt;<br>  \
&gt; ---<br>  &gt;   include/commctrl.h | 4 ++--<br>
                      &gt;   1 file changed, 2 insertions(+), 2
                      deletions(-)<br>
                      &gt;<br>
                      &gt; diff --git a/include/commctrl.h
                      b/include/commctrl.h<br>
                      &gt; index 41abceb..d67f5f7 100644<br>
                      &gt; --- a/include/commctrl.h<br>
                      &gt; +++ b/include/commctrl.h<br>
                      &gt; @@ -3939,8 +3939,8 @@ typedef struct
                      tagLVITEMINDEX<br>
                      &gt;        
                      (INT)SNDMSGW((hwnd),LVM_SETITEMW,0,(LPARAM)(const
                      LVITEMW *)(pitem))<br>
                      &gt;   #define ListView_SetItem
                      WINELIB_NAME_AW(ListView_SetItem)<br>
                      &gt;   #define
                      ListView_SetItemState(hwnd,i,data,dataMask) \<br>
                      &gt; -{ LVITEM _LVi; _LVi.state = data;
                      _LVi.stateMask = dataMask;\<br>
                      &gt; -   SNDMSG(hwnd, LVM_SETITEMSTATE,
                      (WPARAM)(UINT)i, (LPARAM) (LPLVITEM)&amp;_LVi);}<br>
                      &gt; +{ LVITEMW _LVi; _LVi.state = data;
                      _LVi.stateMask = dataMask;\<br>
                      &gt; +   SNDMSGW(hwnd, LVM_SETITEMSTATE,
                      (WPARAM)(UINT)i, (LPARAM) (LPLVITEMW)&amp;_LVi);}<br>
                      &gt;   #define ListView_GetItemState(hwnd,i,mask) \<br>
                      &gt;        
(UINT)SNDMSG((hwnd),LVM_GETITEMSTATE,(WPARAM)(UINT)(i),(LPARAM)(UINT)(mask))<br>
                      &gt;   #define ListView_SetCheckState(hwndLV, i,
                      bCheck) \<br>
                      <br>
                      This doesn&#39;t match what SDK does.<br>
                      <br>
                    </blockquote>
                    <div>Are you saying there is some other magic beyond
                      what is already in this macro or a difference in
                      width(s) used? <br>
                    </div>
                  </div>
                </div>
              </blockquote>
              <br>
              SNDMSG resolves to either SendMessageA or SendMessageW, I
              don&#39;t see anything special for _SetItemState() in SDK.<br>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>SNDMSG will resolve to an error if you try to use this
            macro. LVMITEM should also be either LVMITEMA or LVMITEMW.
            It looked to me like this code preceeds these conventions.<br>
          </div>
          <div><br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  <div> <br>
              It&#39;s not clear what motivated this change, could you
              clarify?<br>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>I was trying to use ListView_SetItemState in some other
            code.<br>
          </div>
        </div>
      </div>
    </blockquote>
    <br></div></blockquote><div><br></div><div>Brilliant, thanks for clearing that \
up.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>  If you tried to \
use it in Wine, yes, it won&#39;t work, because you  can&#39;t use SendMessage macro \
when in __WINESRC__. Instead of  ListView_* macros you&#39;ll need to make explicit \
SendMessage calls.<br>  </div>

</blockquote></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic