Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Books for learning windows APIs and windows programming?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Sun Apr 09, 2017 6:10 pm    Post subject: Books for learning windows APIs and windows programming? Reply with quote

Hey everyone, I am trying to learn windows APIs, and then make some PC apps using C++. However, I can only find this relevant book "Programming Windows 5th Edition (Charles Petzold)", which is pretty old, it was written in 1998.

I have made some simple windows programs using C#, but I want to learn C++ and get to know windows more, such as messages.

Are there any newer resources that suit my need? Or is the one that I have mentioned above still a good source to learn from? Thanks a lot.

_________________
**************

A simple example is better then ten links. Very Happy


Last edited by Dr.Disrespect on Sun Apr 09, 2017 8:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Sun Apr 09, 2017 7:09 pm    Post subject: Reply with quote

MSDN is Microsofts official documentation for the Win32 API.
You can find it here, as an example for SendMessage:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx

Use the search to locate other APIs or examples for what you need. Most of the API includes example usage below or in a link under the description.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Sun Apr 09, 2017 8:05 pm    Post subject: Reply with quote

atom0s wrote:
MSDN is Microsofts official documentation for the Win32 API.
You can find it here, as an example for SendMessage:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx

Use the search to locate other APIs or examples for what you need. Most of the API includes example usage below or in a link under the description.


Thanks for the link, atom0s.

I would also like to know about the "big picture". For example, if I resize the window of my program, how are messages sent from the beginning to the end?

Is it something like this:

1. Windows(OS) notices the size change and sends a message to the application through "DispatchMessage";

2. The application receives the message through WndProc, and align the content of the controls on it;

3. Then what? The application tells the Windows(OS) that the message has been successfully handled?

4. New event detected by Windows(OS), and repeat 1-3?

Edit:
5. Is "SendMessage" less used because usually Windows(OS) calls WndProc?

_________________
**************

A simple example is better then ten links. Very Happy


Last edited by Dr.Disrespect on Sun Apr 09, 2017 9:07 pm; edited 2 times in total
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Apr 09, 2017 8:25 pm    Post subject: Reply with quote

You can learn a lot of things from the Windows API Index. For information specifically about messages, see this page.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Sun Apr 09, 2017 8:34 pm    Post subject: Reply with quote

ParkourPenguin wrote:
You can learn a lot of things from the Windows API Index. For information specifically about messages, see this page.


Thanks a lot, Penguin. I will check them out.

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Mon Apr 10, 2017 2:16 pm    Post subject: Reply with quote

fmanager wrote:

Thanks for the link, atom0s.

I would also like to know about the "big picture". For example, if I resize the window of my program, how are messages sent from the beginning to the end?


As ParkourPenguin pointed out for 'Messages', they have article pages that cover an overview of the topic for most things on MSDN that will give a bit more detail on what's going on with the API. I don't think you will find a site that covers everything you want to know about every single API though in terms of in-depth under the hood workings, but you can Google for various other developers analysis of things if someone has done any type of deep-dive on the given API your are interested in.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Thu Apr 13, 2017 11:22 am    Post subject: Reply with quote

atom0s wrote:
fmanager wrote:

Thanks for the link, atom0s.

I would also like to know about the "big picture". For example, if I resize the window of my program, how are messages sent from the beginning to the end?


As ParkourPenguin pointed out for 'Messages', they have article pages that cover an overview of the topic for most things on MSDN that will give a bit more detail on what's going on with the API. I don't think you will find a site that covers everything you want to know about every single API though in terms of in-depth under the hood workings, but you can Google for various other developers analysis of things if someone has done any type of deep-dive on the given API your are interested in.


Thank you, atom0s.

I am trying to make a basic application with various controls, such as buttons, progress bars, listview, labels, menu,etc., so it's not complicated.

Therefore, I think the examples on MSDN, and the information in a book written by Charles Petzold(Programming Windows, 5th) will suffice. Right?

Last question: is the book, Programming Windows, 5th Edition, still relevant? I think it's still useful after reading couple chapters, but since I am a newbie, I may very well be wrong.

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Thu Apr 13, 2017 5:45 pm    Post subject: Reply with quote

I don't use programming books so I can't help you there, personally I saw them as a waste of money when all the information in majority of them is available on the internet for free. If you plan to make a full blown program with a UI, I wouldn't recommend going with pure C++ and Win32 calls. While you can do it, it's a lot of stuff to code for each control, its sub-classing for messages etc. You are better off using a framework that is already made for UI based things such as wxWidgets or similar.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Fri Apr 14, 2017 11:44 am    Post subject: Reply with quote

atom0s wrote:
I don't use programming books so I can't help you there, personally I saw them as a waste of money when all the information in majority of them is available on the internet for free. If you plan to make a full blown program with a UI, I wouldn't recommend going with pure C++ and Win32 calls. While you can do it, it's a lot of stuff to code for each control, its sub-classing for messages etc. You are better off using a framework that is already made for UI based things such as wxWidgets or similar.


Thanks, atom0s. You just saved me a lot of time. Smile

I did consider using wxWidgets, but I wasn't sure if it was a good source to go with. Now, since you recommend it, I will definitely use it.

PS:
Just to make sure that I am on the right track:

For this app, I wish I can use C#. But since the app has to encrypt and store some of my passwords (I have different passwords for different websites), I don't want it to be decompiled so easily, like the ones written in C#. Therefore, I have no choice but to go with C++ to make things a little safer.
At least, a newbie cannot just download some free programs online and decompile an app written in native C++ as he can do with apps written in C# , right?

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Fri Apr 14, 2017 12:15 pm    Post subject: Reply with quote

If you are concerned with safety, you could always write the encryption/password stuff in a C++ DLL then import that into a C# application and just make the UI in C#. Have the UI interact with the C++ DLL as needed to do whatever it is you are looking to do.

Things like IDA with HexRays exists which lets people decompile native code to somewhat readable source, but it is nothing like reflecting C# back to its original code since they are two separate types of languages and such. Regardless of how you code something, there will always be someone capable of reversing it to get what they need out of it.

wxWidgets is not something I like personally, but it is the only long-lasting UI library out there that most have conformed to. To me, things like that have too much overhead and require you to distribute so many DLLs with the end result that I tend to avoid it. I personally make all my UI based apps in WPF (C#) and code the backend stuff in C++ DLLs as needed.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Fri Apr 14, 2017 12:45 pm    Post subject: Reply with quote

atom0s wrote:
If you are concerned with safety, you could always write the encryption/password stuff in a C++ DLL then import that into a C# application and just make the UI in C#. Have the UI interact with the C++ DLL as needed to do whatever it is you are looking to do.

Things like IDA with HexRays exists which lets people decompile native code to somewhat readable source, but it is nothing like reflecting C# back to its original code since they are two separate types of languages and such. Regardless of how you code something, there will always be someone capable of reversing it to get what they need out of it.

wxWidgets is not something I like personally, but it is the only long-lasting UI library out there that most have conformed to. To me, things like that have too much overhead and require you to distribute so many DLLs with the end result that I tend to avoid it. I personally make all my UI based apps in WPF (C#) and code the backend stuff in C++ DLLs as needed.


Thanks for your advice. Smile You offered great help as always.

I will look more into existing C++ encryption libraries, and make UI with WPF.

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites