On Thu, 14 Nov 2019 at 21:36, Bram Moolenaar <[email protected]> wrote:
> The other use of SetClassLongPtr() is inside an #ifdef.
> I suppose for older compilers.
> How about this:
>
> gui_mch_new_colors(void)
> {
> HBRUSH prevBrush;
>
> s_brush = CreateSolidBrush(gui.back_pixel);
> #ifdef SetClassLongPtr
> prevBrush = (HBRUSH)SetClassLongPtr(
> s_hwnd, GCLP_HBRBACKGROUND,
> (LONG_PTR)s_brush);
> #else
> prevBrush = (HBRUSH)SetClassLong(
> s_hwnd, GCL_HBRBACKGROUND,
> (long_u)s_brush);
> #endif
> InvalidateRect(s_hwnd, NULL, TRUE);
> DeleteObject(prevBrush);
> }
>
Well spotted. Thanks. SetClassLongPtr should define out to SetClassLong but
maybe not on really old compilers. :) Good to keep the consistency as
always.
I just compiled and tested your version in 32 and 64-bit. Both working
fine. Go for it.
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/CAOF_f3O5zb2Bj0BrwZuyv5dOuNwOny11XkBEc7xjXHPOFGJcKg%40mail.gmail.com.