How can I use a resource file (*.rc) to style a dialog-based application?
I can use CreateWindow or CreateWindowEx to create the main window of an application. And some of the arguments of CreateWindow or CreateWindowEx define the styles of a dialogbox. But I want to style it using resource file (*.rc) instead of the way of by pass style arguments to function.
Could someone give me some snippets?
Someobody said I can call DialogBox, and give second argument the the style template. Does this create a confict between CreateWindow and the *.rc file? Or can I use both of them at the same time?
Use CreateDialog. It handles wrapping the call to CreateWindowEx as well as posting the WM_INITDLG and WM_SETFONT messages if needed. There’s an example linked from the docs on MSDN.
You can get information about the content of the resource file here in the documentation for DialogEx.