[PATCH] include/commctrl: ListView_SetItemState should be character width agnostic
Nikolay Sivov
nsivov at codeweavers.com
Sun Oct 31 11:29:37 CDT 2021
On 10/31/21 7:24 PM, David Kahurani wrote:
>
>
> On Sun, Oct 31, 2021 at 7:17 PM Nikolay Sivov <nsivov at codeweavers.com
> <mailto:nsivov at 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 at codeweavers.com <mailto:nsivov at codeweavers.com>> wrote:
>>
>>
>>
>> On 10/31/21 6:34 PM, David Kahurani wrote:
>> > Signed-off-by: David Kahurani <k.kahurani at gmail.com
>> <mailto:k.kahurani at 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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20211031/18170ae6/attachment.htm>
More information about the wine-devel
mailing list