R.Wieser
2021-03-23 18:23:04 UTC
Hello all,
Using XPsp3.
I've got a standard dialog and would like to make it appear flat. So, I
intercepted the WM_NCPAINT event and in it got GetDCEx to return a valid DC
(a problem in itself, as it needed a secret flag included (which is not
mentioned by MSDN or elsewhere) ).
But now I'm /again/ pretty much stuck.
#1: I have tried to use DrawEdge using BS_FLAT, but that one leaves some
undrawn space between it and the client area. So for now I'm calling
'Rectangle' using a hollow brush and a pen 8 units thick. Ugly, but for now
it wil do. (I've got no idea how to get the actual width of the border,
SPI_GETNONCLIENTMETRICS says its just one pixel wide)
#2: The next problem is the captuion with its icon and buttons : DrawCaption
refuses to show anything, even though it returns a 'Succes' (0x1) code.
#3: Furthermore, even when I do not draw the caption, icon and the buttons
(leaving a see-thru hole) they still do appear whenever I drag another
window over that space ... Minimizing and than restoring my dialog than
again shows a hole where the caption, icon and buttons should be.
IOW, something seems to be working alongside WM_NCPAINT and do some work I
did not ask for. Capturing WM_NCACTIVATE (sending it to the same NCPaint
code) didn't change anything.
I've been trying for about three days now to get it to work, but
nonwithstanding having found a number of (partial) examples I have not been
able to figure out what I should be doing here. MSDN isn't much of a help.
tl;dr:
has anyone ever overridden the WM_NCPAINT event to draw their own border and
full caption and got it to work. I could use some hints.
Using XPsp3.
I've got a standard dialog and would like to make it appear flat. So, I
intercepted the WM_NCPAINT event and in it got GetDCEx to return a valid DC
(a problem in itself, as it needed a secret flag included (which is not
mentioned by MSDN or elsewhere) ).
But now I'm /again/ pretty much stuck.
#1: I have tried to use DrawEdge using BS_FLAT, but that one leaves some
undrawn space between it and the client area. So for now I'm calling
'Rectangle' using a hollow brush and a pen 8 units thick. Ugly, but for now
it wil do. (I've got no idea how to get the actual width of the border,
SPI_GETNONCLIENTMETRICS says its just one pixel wide)
#2: The next problem is the captuion with its icon and buttons : DrawCaption
refuses to show anything, even though it returns a 'Succes' (0x1) code.
#3: Furthermore, even when I do not draw the caption, icon and the buttons
(leaving a see-thru hole) they still do appear whenever I drag another
window over that space ... Minimizing and than restoring my dialog than
again shows a hole where the caption, icon and buttons should be.
IOW, something seems to be working alongside WM_NCPAINT and do some work I
did not ask for. Capturing WM_NCACTIVATE (sending it to the same NCPaint
code) didn't change anything.
I've been trying for about three days now to get it to work, but
nonwithstanding having found a number of (partial) examples I have not been
able to figure out what I should be doing here. MSDN isn't much of a help.
tl;dr:
has anyone ever overridden the WM_NCPAINT event to draw their own border and
full caption and got it to work. I could use some hints.