Jump to content
  • Advertisement
Sign in to follow this  
SteveHatcher

Examples of win32 Gui code?

This topic is 1184 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All,

 

Not sure if this is the right place for this. Apart from the "Programming Windows" book by Pretzold. Does anyone know of any sites or resources where I can find simple win32 programs and also their source code? I am talking super simple like a window and maybe a 'File - Open' tab. Maybe something that shows an example of opening a text file and displaying some text in a panel... Just things like that.

 

Even full working programs that are simple enough to get your head around the code would be fine (like stuff on github), but i really have no idea where to look.

 

Thanks

Share this post


Link to post
Share on other sites
Advertisement

If you're serious about Win32, The Old New Thing is a must have bookmark.  There's a lot that isn't properly documented, many funny and weird quirks, and Raymond Chen probably knows more about the inner and arcane workings of the Win32 API than anyone on the planet.

Share this post


Link to post
Share on other sites

Thanks guys, some great links here to get me started.

 

 

Win32 is old. It's expanded here and there, but alot of the "old" stuff is still how it's done. It's not like DirectX where Microsoft discards the API and gets to redesign it from the ground up - older applications must still work on newer systems, so the "old" Win32 is still Win32.

 

Were you wanting to learn the newer Microsoft APIs? You probably want WinRT or .NET then.

 

Are you just wanting to make desktop applications? I'm a huge fan of Qt (which is free even for closed-source commercial use if you link by DLL; don't get mislead by the website).

Qt provides cross-platform native-interface GUIs, and is very powerful, and also has fantastic documentation, a large community, and plenty of open-source example applications. It's best used with the QtCreator IDE, though.

 

I didn't know that about WinRT or .NET, I will look into them, thanks.

 

I am looking to make a desktop gui for myself and maybe a few others, for data processing. I have heard Qt is the way to go for making Win32 apps so I will probably play around a bit with the API to get a general feel for things then dive into Qt.

 

Quick question, I am getting a bit confused about all the terminology they are throwing around. In terms of the Win32 API, which is pretty much raw C and C++ (isint it?), where does WinRT and .NET fit into things?

 

I find examples of things I have used can help me understand. When making a game using D3D11 I used the DirectX tool kit, and SFML. Are WinRT and .NET anything like them?

 

Thanks

Share this post


Link to post
Share on other sites

I am looking to make a desktop gui for myself and maybe a few others, for data processing. I have heard Qt is the way to go for making Win32 apps so I will probably play around a bit with the API to get a general feel for things then dive into Qt.

Qt is definitely the way to go for desktop applications.
Note: You'll want to use QtCreator as your IDE, it makes things alot easier with Qt development.
Note 2: Qt is free, even for commercial use, as long as you dynamically link to the DLLs, but the website is confusing and often misleads people into thinking they have to pay licensing fees. Ignore that.
 

I didn't know that about WinRT or .NET, I will look into them, thanks.
...
Quick question, I am getting a bit confused about all the terminology they are throwing around. In terms of the Win32 API, which is pretty much raw C and C++ (isint it?), where does WinRT and .NET fit into things?


Win32 is written in C (or at least its interface is exposed as C). This means that any language that can "talk with" C can use Win32.

For Microsoft's new way of doing things, they created what they call a "Common Language Runtime" - this means any language that uses Microsoft's Common Language Runtime can use the .NET framework. C# was designed for .NET, but other languages have added some support.

 

Microsoft also created a different version of C++ that they call C++/CLI, which runs on the Common Language Runtime (the recommended IDE for that is Visual Studio). I haven't used "C++/CLI" (I've only used regular C++), so I don't know how good it is.

 

Whether you use C++ and Qt (in QtCreator), or C++/CLI and .NET (in Visual Studio), or C# and .NET (in Visual Studio), you'll definitely have alot of learning to do, and at first it'll seem confusing, but once you get over the hill, things will make sense.

 

WinRT is for the new Windows 8/10 style of apps ( [1] [2] ), which might not be what you are going for.

WinRT is built on the CLR, so anything that can use .NET can use WinRT.

 

As I said before, I'm biased in favor of Qt. Qt lets you make native applications looking the same visually like .NET does, but you can also theme them how you want and design your own widgets and such. Here's a complicated messy screenshot of my own project written in Qt. Mind the overuse of gradients and non-standard widgets - I get carried away. biggrin.png

Share this post


Link to post
Share on other sites

Many moons ago, my introduction to Win32 was Andre Lamothe's "Tricks of the Game Programming Gurus"...

 

http://www.amazon.co.uk/Tricks-Windows-Programming-Gurus-CD-Rom/dp/0672313618/ref=sr_1_2?ie=UTF8&qid=1442131560&sr=8-2&keywords=tricks+of+the+game+programming+gurus

 

...DirectX wise, its ancient but there is still a lot in the book you can learn from such as 2D rendering algorithims, maths, how to add resources(bmps, wavs) to your exe files and much more. 

 

The wonderful thing about this book is that it made excellent preparation for when I went on to take a degree in computing, and the first module in C++/WinAPI I pretty much breezed through it and gained very high marks on assignments.

Share this post


Link to post
Share on other sites

Hi Servant, thanks for your detailed reply, I think I am getting the picture now. As you said, eventually it comes down to picking one and going for it...

 

 

As I said before, I'm biased in favor of Qt. Qt lets you make native applications looking the same visually like .NET does, but you can also theme them how you want and design your own widgets and such. Here's a complicated messy screenshot of my own project written in Qt. Mind the overuse of gradients and non-standard widgets - I get carried away. biggrin.png

 

 

wow, thats insane! So you made that whole program using Qt? Is all of the logic behind the scenes c++? The use of tabs and selectors etc is similar to how I want my GUI to look (although urs is a lot more complex)

 

So with QT it doesn't have to look like a typical windows program (for which I think of something like winRAR looks like...). Can the same effect be achieved with just the Win 32 API?

 

Thanks again for the info

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!