Ownerdraw a Dialog
-
Hi all, I'm using VC++ with Windows API, no MFC. I want to create a dialog that is entirely owner-drawn, but I can't find a style to use with it (buttons being BS_OWNERDRAW, etc). Is there a style for owner-drawing entire dialogs or do I have to do this in some other way? Thanks!
KR
-
Hi all, I'm using VC++ with Windows API, no MFC. I want to create a dialog that is entirely owner-drawn, but I can't find a style to use with it (buttons being BS_OWNERDRAW, etc). Is there a style for owner-drawing entire dialogs or do I have to do this in some other way? Thanks!
KR
Just register your own window class and run a message pump.
Steve
-
Just register your own window class and run a message pump.
Steve
The dialog is created as a popup for my application which is already registered. I'm not sure how registering the dialog would help as it already has a message pump? Or maybe I don't understand what you mean? How can I use the dialog's message pump to custom draw the dialog? If I use WM_PAINT I can only draw in the client area of the dialog, right? If I set the dialog's border to "None" then I can basically draw the entire thing as long as I use a square bitmap... but I don't want it to be square, and if I draw the bitmap transparently I see the gray crap beneath it... isn't there a way I can just override the default drawing behavior of the dialog in the same way that I catch the WM_DRAWITEM message for my other custom controls? Thanks!
KR
-
The dialog is created as a popup for my application which is already registered. I'm not sure how registering the dialog would help as it already has a message pump? Or maybe I don't understand what you mean? How can I use the dialog's message pump to custom draw the dialog? If I use WM_PAINT I can only draw in the client area of the dialog, right? If I set the dialog's border to "None" then I can basically draw the entire thing as long as I use a square bitmap... but I don't want it to be square, and if I draw the bitmap transparently I see the gray crap beneath it... isn't there a way I can just override the default drawing behavior of the dialog in the same way that I catch the WM_DRAWITEM message for my other custom controls? Thanks!
KR
What I'm saying is that if you want a dialog-like window that's totally user drawn then just make one: don't use the
CreateDialog
function and friends. If the dialog is to be modal all you have to do is disable it's parent and you may want to run a your own message pump.Steve
-
What I'm saying is that if you want a dialog-like window that's totally user drawn then just make one: don't use the
CreateDialog
function and friends. If the dialog is to be modal all you have to do is disable it's parent and you may want to run a your own message pump.Steve