Backstory:
I took up learning C/C++ a couple months ago when I was in a game hacking forum. Since then I have changed my interests and no longer desire to make exploits for games for personal reasons.
At the moment I am studying
Programming Windows 5th Edition by: Charles Petzold
It is a very good book, I am almost 700 Pages In and I understand it completely.
What concerns me is that it was made I estimate around 11 Years ago.
Q1: Should I continue studying this even though it could be a bit outdated?
I am also currently using Visual Studio 2010 Beta2 and I see that there are any different ways to make an application ie. MFC - WFA
Which I have no idea how to use ( WFA ) but I've seen similar apps uses from a friend who uses VB.
Q2: What is the best most up to date method to code in C\C++ so that I don't end up left behind on anything ( and why ).
My current study is of
http://en.wikibooks.org/wiki/Programming:Windows_Programming
Which I found recommended and will look into to see if it will answer some of my questions since my range in computer knowledge itself is very short.
Q3: The most I have made that even resembles any kind of use is a simple console app that converts files into a C Byte Array. Why am I not able to make anything useful will my knowledge of C\C++.
Example app I made for a friend to send text to a minimized notepad
#include <Windows.h>
#include <iostream>
#include <conio.h>
using namespace std;
#define ClearScreen() system( "CLS" )
class _Notepad
{
public:
_Notepad()
{
ZeroMemory( &Buffer, sizeof( Buffer ) );
pt.x = 1;
pt.y = 1;
}
void GetUserString();
void SendToChild();
private:
HWND nphWnd;
POINT pt;
char Buffer[ 1024 ];
};
void _Notepad::GetUserString()
{
while( 1 )
{
ClearScreen();
printf( "Enter the string to put into notepad\n: " );
cin.getline( Buffer, sizeof( Buffer ) );
if ( !( nphWnd = FindWindow( "Notepad", NULL ) ) )
{
printf( "\nPlease turn on notepad..." );
Sleep( 3000 );
continue;
}
if ( strlen( Buffer ) )
break;
cout << "\nYou have entered a empty reply, please try again..." << endl;
Sleep( 3000 );
}
SendToChild();
}
void _Notepad::SendToChild()
{
ShowWindow( nphWnd, SW_HIDE );
ShowWindow( nphWnd, SW_RESTORE );
ShowWindow( nphWnd, SW_HIDE );
for( int i = 0; i < strlen( Buffer ); i++ )
SendMessage( ChildWindowFromPoint( FindWindow( "Notepad", NULL ), pt ), WM_CHAR, Buffer[ i ], NULL );
ShowWindow ( nphWnd, SW_SHOWMINIMIZED );
ClearScreen();
}
void main()
{
_Notepad np;
np.GetUserString();
printf( "Complete..." );
getch();
}
It is fairly simply but doesn't do much of anything.
Whenever I try to learn more about dealing and using pointers ( for classes, functions, data ) I always manage to find a way to screw up ( crashes, invalid ) or insufficient knowledge leading me to not use them unless absolutely required by a Windows function.
Q4: What can I do to properly learn and use pointers/memory since previous studies have left me stranded.
I have some other questions but not to go into thread overloading or details, I'll just end it here.
I would appreciate some full reply's with recommendations, wisdom, and advice to better further my interest and skill.