Where should I start the windows programming

Hi there I've learned c# for 3 years and now I want to write code for windows with c++ like RAT and key logger and generally for windows . But I don't know where should i start learning and I don't know what should I learn to . I searched in udemy for c++ programming tutorial but it just has about basic tools programming like oop or array and etc ...
closed account (E0p9LyTq)
Start with the basics, Win32. It is old, but still works for desktop apps.

theForger's Win32 API Tutorial is a good place to start:

http://winprog.org/tutorial/

Win32 API is C, not C++. You can still compile it as C++.

If you want strictly C++ usage, MFC. The Microsoft Foundation Classes.

I don't know of any online tutorials for MFC.

A couple of oldies, but still good references for programming Windows:

Programming Windows®, Fifth Edition (Developer Reference) (1998)
https://www.amazon.com/Programming-Windows%C2%AE-Fifth-Developer-Reference/dp/157231995X/

Programming Windows with MFC, Second Edition (1999)
https://www.amazon.com/gp/product/1572316950/

There has been a lot of changes to the Win32 API structure since Petzold's book was published, you will have to tweak some of the example code to get them to compile.

For me that was a good learning experience, trying to figure out what was outdated and needed to be fixed.
closed account (z05DSL3A)
Take a look at...
Get Started with Win32 and C++
https://docs.microsoft.com/en-us/windows/desktop/learnwin32/learn-to-program-for-windows
closed account (E0p9LyTq)
@Grey Wolf, I looked at the lesson you linked, and it is lacking a lot of details. It says to download another tutorial's source, but when you try the link is deader than a dodo.
closed account (z05DSL3A)
FurryGuy, I'm not overly surprised that the links for downloading source for sample applications are broken...they keep moving things around. :0)

As to 'it is lacking a lot of details'...it's a suggestion for additional resources to help someone getting started, I personally didn't like Forger's (at least the last time I looked at it), I'm a Petzold man...but I'm not sure how much I would recommend it for a beginner over something maybe less detailed but more 'modern'.
closed account (E0p9LyTq)
Petzold and his C/C++ approach to Win32 is really outdated. 1998 is the publication date of his 5th edition, his 6th edition is all C# and windows 8.

Your link probably worked great when Visual Studio 2010 was the latest MS offering.

MS has newer tutorials, primarily geared to using Visual Studio 2017.

The "Create a C++ console app" tutorial is more in-depth, including how to debug within the IDE.
https://docs.microsoft.com/en-us/cpp/get-started/tutorial-console-cpp?view=vs-2017

For those who want to know how to create a GUI app there is
https://docs.microsoft.com/en-us/cpp/windows/walkthrough-creating-windows-desktop-applications-cpp?view=vs-2017

There are other walkthrough tutorials available (VS2017):

Walkthrough: Creating a Standard C++ Program
https://docs.microsoft.com/en-us/cpp/windows/walkthrough-creating-a-standard-cpp-program-cpp?view=vs-2017

(which includes how to compile a native C++ program on the command line using VS 2017)
https://docs.microsoft.com/en-us/cpp/build/walkthrough-compiling-a-native-cpp-program-on-the-command-line?view=vs-2017

Walkthrough: Creating and Using a Static Library (C++)
https://docs.microsoft.com/en-us/cpp/windows/walkthrough-creating-and-using-a-static-library-cpp?view=vs-2017

Walkthrough: Create and use your own Dynamic Link Library (C++)
https://docs.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp?view=vs-2017

And let's not forget the importance of debugging:
https://devblogs.microsoft.com/visualstudio/introduction-to-debugging/

FYI, VS2109 is already available in release candidate status, full release expected April 2nd.

(There's a missed April Fool! joke there)

closed account (z05DSL3A)
"Get Started with Win32 and C++" is where you get to from following current links on Microsoft dev and doc sites, they obviously think it is still relevant.

The reason I point people to Microsoft docs site is because of all the good walkthrough/tutorials that they can discover there...but you have to start somewhere.

When I say I'm a Petzold man...I learned from the 3rd edition when it was new...and still bought the 4th, 5th, and 6th editions.
Petzhold is still relevant, and there is code chaper by chaper on Github to download revised code.

there was even C++ version of the code on github somewhere but can't find it any more.
closed account (E0p9LyTq)
The Windows API has undergone revision and updating since his 5th edition was printed.

Not least are the changes for creating 64-bit apps. Eliminating the need for malloc and other C memory management routines is another.

A lot of his 1998 code included with the 5th edition will compile fine with a few minor tweaks for 64-bit.

There are code examples that require a lot of updating to work. I've beat my head against that brick wall repeatedly on those.

His reliance on C# and .NET for the 6th edition is a bit off-putting for me.
closed account (E0p9LyTq)
there is code chaper by chaper on Github to download revised code.

there was even C++ version of the code on github somewhere but can't find it any more.
I've looked, a lot, and like you I can't find any updated code for the 5th edition either. That puts recommending the 5th edition for beginning Windows programmers not high on my list.

If it were easily found I would withdraw my conditional non-approval of his 5th Edition for beginners to learn using C/C++ for Windows programming.


+=======+

Updated code for the 5th edition has been found! Updated to work with Visual Studio 2017 Community. A few moments ago tested one of the updated examples that crashed and burned on execution with the original 1998 code and now after being revised it works! (The environment strings example in chapter 9)

https://github.com/recombinant/petzold-pw5e

When using the revised and updated code I recommend 100,000% learning how to program Windows desktop apps using Petzold's book.

Most of the code worked without the need for updating, just a few aspects of how Petzold used the Win32 API caused VS2017 (and 2015) heartburn.

I even wrote a rant about the problem the original 5th edition code had with VS2015. Though I was completely wrong about the problem was using malloc/calloc.
http://www.cplusplus.com/forum/lounge/186935/
Last edited on
I'd recommend learncpp.com - Great website and the author updates it for newer C++ updates.

C# is similar to C++ so the learning curve wont be huge I imagine. Just recently picked up C#
closed account (E0p9LyTq)
The OP apparently is looking for how to program Windows apps in C/C++, after doing it with C#. LearnCPP is a great tutorial for C++, not for Win32.

Grey Wolf wrote:
The reason I point people to Microsoft docs site

The examples I linked are also from the MS Docs website as well. They have all the code/IDE setup needed to create a working example in Visual Studio.

I took a different route on the Docs main page, digging down through the Visual Studio sub-site vs. the Windows sub-site.

Topic archived. No new replies allowed.