Direct2D and Windows common controls

1.9k views Asked by At

I'm still kind of new to Direct2D so this may be a stupid question.

I want the UI of my application to support things like partial transparency and hardware acceleration. To do proper transparency I need to use the UpdateLayeredWindow API, which expects a source device context. So I use Direct2D to create a ID2D1DCRenderTarget and simply draw to that. So far so good, it seems to work nicely.

Now, I'd like to use some common controls together with this setup. A simple button would be relatively easy to recreate using normal Direct2D drawing functions, but things like edit controls would take a lot more work. Especially when you want to do the regular text processing things that users have come to expect from edit controls. So I'd like to use existing Windows functionality for that.

From reading MSDN, it's possible to get common controls to draw themselves to a device context by sending WM_PRINT messages. But then, how would I know WHEN to send this message? Sure, I can get notifications from an edit control when the user types in it, but I'd still need to figure out when the flashing cursor is supposed to be drawn or not, for example.

How is this usually done? What are my options? Thanks in advance for any pointers.

0

There are 0 answers