Alexander Rafferty
Alexander Rafferty

Reputation: 6233

drawing outside client area, winAPI

How would I draw outside the client area of a window, and on the title bar. I know it can be done, but I am unsure of how to implement this effectively. Think google chrome, where the tabs are on the title bar.

Upvotes: 2

Views: 2112

Answers (3)

cpx
cpx

Reputation: 17567

Drawing a custom window caption DrawCaption

Upvotes: 2

tenfour
tenfour

Reputation: 36896

It may be worth mentioning WM_NCHITTEST also, if you plan on customizing where non-client elements are located.

Upvotes: 2

Jim Brissom
Jim Brissom

Reputation: 32919

When Windows asks you to draw the portion of the window that is outside your client area, it will send you an WM_NCPAINT message. Handle that message and draw whatever you want the non-client portion of your window to be. See the page I linked for an example of how to get a device context you can draw upon.

Upvotes: 3

Related Questions