Hi Bram, 2019/11/15 Fri 6:36:36 UTC+9 Bram Moolenaar wrote: > > > Simon wrote: > > > Attached is a patch to solve a long-standing issue in gVim when > > using dark backgrounds. e.g. > > > > https://github.com/vim/vim/issues/349 > > https://www.reddit.com/r/vim/search/?q=gvim%20borders&restrict_sr=1 > > > > * This mini patch automatically changes the main window to the > > background colour thus eliminating white-space to the right and bottom > > edge - it looks great > > > > * I have utilised the static s_brush so it will always contain the > > main window background brush just as before > > > > * The previous brush is deleted after being replaced by the new one > > > > * I have checked for memory leaks > > > > > > Thanks for everything. :) > > 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); > } >
I don't remember when SetClassLongPtr() was added. At least, VC 2008 has it, and VC 6 doesn't have it. We already dropped support for Windows 9x, so I don't think we need to keep support old compilers which support Win9x. I think we can drop support for VC 2005 or older. How about always using SetClassLongPtr()? Regards, Ken Takata -- -- 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/9b6f1167-2864-42ae-b5f1-69d3ec140c8b%40googlegroups.com.
