Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Main Window in Resource Script (.rc)

Tags:

windows

winapi

I'm not exactly sure what you can (or should) do with *.rc files. Most Win32 example code, including Visual Studio templates, creates the main window programmatically in WinMain. I could create a dialog in the resource script and just show it in WinMain, but I'm not sure if that's the best idea, since dialogs are treated differently than windows. Is there a way to put controls in the main window from a resource script, or should I just create it as a dialog?

like image 995
rpjohnst Avatar asked Sep 10 '26 22:09

rpjohnst


1 Answers

The only Win32 API which places controls on a Window are the CreateDialog[Indirect][Ex] family of functions.

The practice of creating a dialog was the root window of the application has been common since 16-bit Windows and even today's 64-bit Windows maintains compatibility with that practice.

like image 199
Heath Hunnicutt Avatar answered Sep 13 '26 03:09

Heath Hunnicutt