EDIT : If Visual Studio says something like "hWnd is being used without being initialized", remove it's declaration and at MessageBox call use NULL as the first parameter. Example : MessageBox(NULL, //The rest of the stuff). Or you could use HWND_DESKTOP and the message box's owner would be the desktop.
Here's the link to Code::Blocks, the IDE used : http://downloads.sourceforge.net/codeblocks/codeblocks-8.02mingw-setup.exe .
As I've said earlier the MessageBox takes the following parameters : HWND owner, text, caption and unsigned int's determining the buttons and the icon. Since we declared an HWND variable we can use it as HWND owner. The replacements for MB_ICONERROR are MB_ICONHAND and MB_ICONSTOP.
Same applies to the warning box except that we use MB_ICONWARNING or MB_ICONEXCLAMATION.
If you don't know what a function or a return value is please refer to a C book. Based on what button the user presses the MessageBox function returns IDOK or IDNO.
Here's a list with all the MessageBox icons buttons and return values : http://msdn.microsoft.com/en-us/library/ms645505(VS.85).aspx .
Everybody, please read the description and especially the EDIT !
Win32APICProgrammer 3 years ago
GREAT! I'm looking forward to watching your tutorials...
I'm using VC++ Express 2008. I got some problems in my vista, so i lost many system files. I will re-install my Vista as well as VC++ Express 2008...
SaihatAlhaq 3 years ago
Right now, I'm using Vista Ultimate x32, and I don't even get to boot up, cuz Avira starts saying that EXCEL.exe is virused and something about temp files, ZOMFG !
Win32APICProgrammer 3 years ago
THANKS...
SaihatAlhaq 3 years ago
On my 3rd tutorial I'll show how to clear the screen in command line using Win32API and how to make your own "dir"; it enumerates all the files or folders in a folder. So, we're going to do some console stuff too, but it's still Win32API. Out of curiosity, what IDE are you using ? Cuz, I'd seriously recommend Visual C++ 2008 (the Express edition).
Win32APICProgrammer 3 years ago