Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modern, native way of creating WinAPI GUI apps in C++ [closed]

Tags:

First, I know this is kind of common question, but I could not find the exact answer I am looking for.

I have done many projects in Java using Swing. Starting by just coding the GUI, then later moving onto GUI designers. This proved to be a very quick and easy way to build GUI apps.

But now, I need to move to C++. I am beginning a project which uses a lot of HW resources (DirectX, OpenCV, etc...) I know there are Java libraries for these technologies. However, C++ is definitely the right way to go, considering the internals of this project.

I know C and C++ languages well from MCU programming. Also, I have read many articles on native WinAPI programming, Windows internals, etc. I think I have enough knowledge to start. I don´t want to worry much about GUI design, but it must look appropriate.

I know there are few basic options: Pure WinAPI, MFC, WTL, Qt... I would be very glad if there were some kind of GUI designer tool, but from my research, there is not. There is the MFC wizard which helps to create a basic window, but it is not a designer. The closest thing I found was Qt. But from what I read, it is not using WinAPI for drawing, for in future look and feel of Qt written app can differ from native Windows look.

So, to summarize, please, if you are experienced with creating native Windows C++ Apps with GUI, what would you recommend to me? Specifically, is there any tool or designer I missed?

(I am using Visual Studio 2010 professional, since I have it free thanks to the DreamSpark project)

like image 862
B.Gen.Jack.O.Neill Avatar asked Mar 15 '12 23:03

B.Gen.Jack.O.Neill


People also ask

Can you create a GUI in C?

You can't write modern GUI applications, as it will only produce 16-bit code. All modern operating systems are 32-bit, and many are now 64-bit.

What is WinAPI and how to use it?

It allows you to write native Windows applications that have access to the full set of GUI controls. You'll find a nice tutorial hereon writing WinAPI applications in C. If you choose to go with Visual Studio, it also includes boilerplate code for a blank WinAPI application that will get you up and running quickly.

Is there a Windows API tutorial for C programming language?

This is Windows API tutorial for the C programming language. It is pure Windows API tutorial. It does not cover MFC. After reading this tutorial, you will be able to program non trivial Windows applications. Even if you program in a higher level programming language, this tutorial will give you valuable knowledge of how things work under the hood.

Can I use Windows API to create a desktop application?

in a window. You can use the code that you develop in this walkthrough as a pattern to create other Windows desktop applications. The Windows API (also known as the Win32 API, Windows Desktop API, and Windows Classic API) is a C-language-based framework for creating Windows applications.

What is the Windows API?

The Windows API is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. It was formerly called Winapi or Win32 API.


1 Answers

I recently used Qt4 and was very pleased with the API. I found it straightforward, well documented, and the code is extremely concise.

Qt does an extremely good job of emulating the target OS look and feel (as @In silico pointed out in the comments, Qt actually draws everything itself and does not use native components) Regardless, this can be coded by hand or visually through the GUI editor in their IDE, Qt Creator. If you go this route, I recommend creating your initial GUI project (.pro file) there, then importing it into Visual Studio via the Qt Visual Studio Add-In.

Slots and signals, Qt's event/messaging system, is also worth mentioning. Yes, it's critical to GUI programming, but could also be extremely useful in lower-level code.

I expect Qt would work well in your project, but as always, create a few simple tests to ensure the technologies will work together feasibly.

like image 99
Courtney Christensen Avatar answered Oct 03 '22 01:10

Courtney Christensen