Win32: How to draw outside my window?

Looking at the Windows class tooltip window tooltips, I see that it draws its shadow outside the actual rectangle of the tooltip window.

Using SpyXX - I can get a help window and class styles:

Spk7b.png

Rectangle:     (440, 229)-(544, 249), 104x20
Restored Rect: (440, 229)-(544, 249), 104x20
Client Rect:   (0, 0)-(104, 20), 104x20

You will notice that the shadow that you see is physically outside the window that is looming. How can I draw a shadow outside around my window, and outside my window?

Note : The shadow is not drawn using the standard style CS_DROPSHADOW. I confirmed this experimentally and can also see the class style for a window in SpyXX ; he does not use CS_DROPSHADOW:

Windows Styles:     94000001

    WS_POPUP        80000000
    WS_VISIBLE      10000000
    WS_CLIPSIBLINGS  4000000
    TTS_ALWAYSTIP          1

Extended Styles:    00080088

    WS_EX_LAYERED      80000
    WS_EX_TOOLWIN         80
    WS_EX_TOPMOST          8

So how can I draw outside my window?

. DC . GDI, DirectX WPF:

- !

, , , GetDC (NULL) , XOR .. , :

... , , -- , XOR . , DWM, GPU, , DWM.
... - , , , . UCE , , , . ( , ... DirectDraw , DWM , )

+3
3

, .

, / / " "... .

- , , .

+5

Q: ? A: !

, tooltip CS_DROPSHADOW, , , , "" " ++", . , tooltips_class32 - .

- ? , Windows , HWND - -, , , , WS_EX_LAYERED, -. , .

, :, , , , .

-

, Spy ++, . tooltip_class32, / , : , , Spy ++, - , , , Spy ++. , Spy ++ : Spy ++, F5, HWND, . , , HWND - , - SysShadow. , , HWND, " ". , SysShadow, .., , CS_DROPSHADOW, Spy ++ .

(, , , , , Vista: Aero Glass Desktop Composition Manager, , .)

+2

, ; , , , , . , , , , .

+1
source

Source: https://habr.com/ru/post/1732092/


All Articles