c# - How to draw rectangle on screen showing where appbar window will dock -
i'm working on class descends wpf window
class implements application toolbar functionality available in window 7 + shell (that is, calls win32 shappbarwindow
dock edge of desktop , undock). idea can drag window around screen , when within distance of desktop edge, docks itself.
because of need call win32 shappbarwindow
function, , because working through wpf events not helpful, i've written window procedure works @ win32 level & hooked in using hwndsource.addhook
method. procedure gets called first , processes needs process, , passes rest on wpf.
i've been working on dragging logic , i'd give user visual indication window dock edge it's closest to, without docking it. end, i'd display transparent rectangle dashed border size window after docking in location be. if user releases left mouse button @ point, window docked @ edge. once mouse moved away edge, rectangle go away.
i know how compute rectangle's size & location. how display rectangle? i'm pretty sure i'd have gdi32 calls, target area outside window's nonclient & client areas. how draw rectangle, without messing other windows might in area?
Comments
Post a Comment