A real gooooooood way to learn the win 32 bit APi
BAF

any good ways, i want to make a win32 allegro game. Any good tutorials for beginners? also, i am looking for a cheap copy of MSVC 6 +. Anny Suggs???:-/

23yrold3yrold

Go buy Charles Petzold's Programming Windows: Fifth Edition. Pricey, but you'll save money if you use MinGW instead of MSVC 6 :)

Maybe I should start a Win32 series in Pixelate ...

Synapse Jumps
23 said:

Maybe I should start a Win32 series in Pixelate ...

MAYBE!?

brain21
Quote:

Maybe I should start a Win32 series in Pixelate ...

I think that would be a great Idea!! I am now trying to do this, but finding it very slow.

Bobby Ferris: You can get a free learners copy of VC++ 6.0 from many "Learn how to program in C++" books. I have about 5 copies from the books I have.

23yrold3yrold
Quote:

MAYBE!?

Sorry; I had no idea you were so opposed to the idea ;)

EDIT: Heh heh ;D

StevenVI

I am opposed to the idea.
(Edit: nice one, 23 :P)

http://www.winprog.org/tutorial/

Also, I second the motion to buying Petzold's book. It's a wonderful book.

-Steve

Thomas Harte
Quote:

also, i am looking for a cheap copy of MSVC 6 +. Anny Suggs

As an owner of MSVC 5, I thought a nice way to save money would be to buy only the upgrade edition of 6 - which was £10 (about €7 / the same in US$) on ebay, less than 1/4 what people seem to pay for the non-upgrade edition.

Having done so, I discovered that buying the upgrade edition is a good way for everyone to save money. The box warns that proof 'may be required' of ownership of an earlier version, but in fact it is not required. I have installed MSVC 6 on a machine that has never had any MSVC before from only these discs. And you get all the hardcopy and MSDN stuff too, so...

BAF

nice! what books have the starter version? a am looking on ebay for it now too.

Thomas Harte

You don't need the starter version, as I said, but nevertheless I know that it comes with the more recent 'Secrets of the Game Programming Gurus' books.

A J

msdn.microsoft.com

StevenVI
Quote:

msdn.microsoft.com

Yes, MSDN has a wonderful section on learning win32 programming ::). Not to be lashing out here or anything, but how is MSDN gonna help someone learn Windows programming if they know squat about it? If you already know a function name and need the prototype with an explaination, yes, that'll help, but I fail to see how MSDN would be even remotely useful in learning how to write a win32 program. Follow the link I posted, or buy the book by Charles Petzold (or do both). Don't look to MSDN for anything helpful for a beginner.

-Steve

Thomas Fjellstrom

I learned from MSDN. And a few howtos on some of the tings I didnt quite get.. Like how to use the ListView. But thats it.

Synapse Jumps

I'm sure this has been asked before, but how do you make a radio button or check box in Win API, can someonone point me to a tutorial or give me a code snippit? I've been searching for a while and the only one I found used MFC, so if you know how, please let me know :)

23yrold3yrold

Radio buttons and check boxes are just the standard Win32 "button" class. You need to use the right 'button style'; BS_AUTORADIOBUTTON or BS_AUTOCHECKBOX, etc. when you create it. There's quite a few button styles; just search for keywords beginning in BS_ :)

Synapse Jumps

Can't I just put a radio button in while the window is being created? In my WindProc thing, when WM_CREATE is passed, like I do with my menus? Sorry, all this windows stuff is SOO confusing to me, and recourse scripts don't make much sense either...

23yrold3yrold

Yes, you pass the BS_* in the CreateWindow function. It's a Window style (like the WS_* styles) reserved for the button class. You can either pass it directly to CreateWindow when you call it (presumably during the WM_CREATE event) or use it in a resource script for dialog boxes.

I agree resource scripts are not well doc'ed IMHO. I will definitely devote a whole article to deciphering them ^_^

Thomas Fjellstrom

Yup. You can create windows (using CreateWindow(), CreateWindowEx(), CreateMenu(), etc...) whenever/whereever you feel like.

As for resource scripts, they can be handy, allowign you to keep the layout for your dialogs, your menu layout, localized text for widgets, Icons, bitmaps, any kind of resource really. IMO its best to get a graphical resource editor... I still haven't bothered to learn all the ins and outs of resource files. (thier syntax etc..)

Synapse Jumps

I know this sounds newbish... because it is, completley newbish, but how do I do that? Like when I created the menus in my WM_CREATE event I used functions, could you please just point me to the functions I should use? Thanks!!

23yrold3yrold

Menus should be declared in the resource file since it's so much easier and cleaner (unless you have a really compelling reason not to) ...

And check out the link Harry posted. Should help a little ...

Thomas Fjellstrom

Synapse: How do you create windows? CreateWindow, or CreateWindowEx. I told you that in my last post.

23: I have a reason, I don't know the syntax. :P

23yrold3yrold

Ignorance is no excuse ;) Menus are probably the easiest resource to "script"; you can see here how to make menus several ways, including the method you probably use. I think we can agree the scripts are much less ugly :P

Thomas Fjellstrom

I have another reason: In my filfilter project thing, each plugin gets a menu item under the "plugins" menu. :) All nice and dynamical.

23yrold3yrold

Okay, that's a good enough reason ;) Not sure if you can so easily manipulate scripted menus, but anyway I doubt SJ is doing anything like that.

Synapse Jumps

Yea, umm... I didn't even know that this was possible, but the compiler says I have a parse error in my resource file. Here is the line where the error is:

STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU

And in case it matters, here's the entire resource file, since it's short:

911 DIALOG DISCARDABLE  0, 0, 100, 50
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Controls One"
FONT 8, "MS Sans Serif"
BEGIN
    LTEXT           "Filename to be generated: ",IDC_STATIC,7,10,14,8
    EDITTEXT        1,25,7,120,14,ES_AUTOHSCROLL

    LTEXT           "Include at least ",IDC_STATIC,10,30,23,8
    EDITTEXT        2,75,27,21,14,ES_NUMBER
    LTEXT           "% of directrory.", IDC_STATIC,80,30,23,8

END

I pretty much just stole that and guessed at the values... :)
EDIT: I know that usually things are defined, but I really don't need to, I only have two objects and I only use them once so... As for the dialog, I define it in the .c file

23yrold3yrold

Try losing DS_CENTER. It's the only one I don't immediately recognize, and my help file says it's Win95 only (if that matters). Not like it's a really important style ;D

Any you aren't defining the dialog in the .c file; you're defining it right there. The numbers are the location and dimensions of the windows. All you have to do is write a WndProc function for it and call DialogBox() to create it.

Synapse Jumps

I'm dumb!, I build it and now Dev C++ is stuck... Gayness! How do I just compile with a .rc without haveing to go thorugh all that dumb stuff of making a project in Dev C++?

23yrold3yrold

I edited my post ... anyway ...

Use SciTE and makefiles :) Dev-C++ is for mental defects.

Synapse Jumps

I am just doing that. I mean defining it like:
#define My_dialog 911
And, WHAT THE FUCK. THIS IS FUCKING SHIT! I JUST WANNA MAKE A FUCKING WINDOWS APPLICATION I DONT WANNA FUCKING JUMP THROUGH ALL OF THESE FUCKING HOOPS! WHAT THE FUCK! SHIT MAN! FUCK! I JUST WANNA BE ABLE TO FUCKING DO THIS SHIT. FUCK YOU DEV C++ I'M ON A CRUSADE TO FUCKING KILL YOUR STUPID FUCKING BITCH ASS!

Oh and it still says that there's a parse error in the resource, and I took that DS_CENTER out.

23yrold3yrold

Oh! Make sure you have these lines at the top of your resource file ...

   #include <windows.h>
   #include "resource.h" // or whatever

So your resource script knows about all the defines (your own, and the Windows ones). And you don't have to define My_dialog or whatever; in fact, I just do this:

   TilemapEditor DIALOG DISCARDABLE  0, 0, 130, 167
   // ... blah blah

and then pass "TilemapEditor" to DialogBox. Just call it by name :)

Nice nonsensical filtered post btw ;)

Thomas Fjellstrom

Synapse: Those hoops are built into the Win32 API. You'll HAVE to jump through them, unless you use another API.

Synapse Jumps

I'm dumb!, yea that helps to include those 23. But now it says that this line is wrong:
LTEXT "Filename to be generated: ",IDC_STATIC,7,10,14,8
WTH!? Stupid parse errors. Do I need ; in resource files?

TF: Yea, that's cuz microsoft sucks [edited out rest].

23yrold3yrold

No, it's because using a good GUI API is complicated. Don't like it? Go use Allegro's ;)

You don't need ';' and I don't see any error in that code ...

EDIT: I forgot! IDC_STATIC is undefined; add this to your header:

   #define IDC_STATIC -1

Should'a noticed that right off :)

Synapse Jumps

I'm dumb!, my friend just found it. I dont have IDC_STATIC defined :)
EDIT: Jynx!

Thomas Fjellstrom

Yup. I don't like it. I'll use QT thank you :P

Synapse Jumps

Okay, last question, I promise!
What are the numbers?
like here:

LTEXT           "Include at least " /*I got this*/,IDC_STATIC/*and this*/,0,30,90,30 // what are the rest
EDITTEXT        2/*got this*/,91,30,10,7,ES_NUMBER

THANKS!

23yrold3yrold

I already told you ::) The first two are the (x, y) coordinates of the upper left corner of the control, and the next two are the width and height. It's the bounding box, if you will.

Synapse Jumps

Sorry, I'm dumb. I don't remember important stuff, just dumb shit... like every line to every Simpsons ever!
EDIT: Alright, last question ever, I swear! After this I'm gonna release my completeley useless utility to the world! Okay, how do I make it so that a radio button is set as a default? I'd assume it's something in WM_INITDIALOG, but what function and such?
EDIT AGAIN: Never mind, I learned :)

IronBob

it took me a damn long while to get used to win32. but once i did and i got as good as i am now with it i found out how powerful it really is. ya its not portable but most commercial game buyers these days have windows. really the only reason linux is so popular with programmers is because its open source. thats great but really what is some 5 year old kid that only plays games going to want with an operating system's source code. not like he would understand a single line of it anyway. anyways pretty much ALL games these days are made for windows. you see linux some and mac a bit too. but sometimes you gotta admit that windows is just too wide spread for anyone to do anything about it. i dont mean to be cocky but i think ive gotten really good with win32 and now i understand it. but if you want to get good with win32 the book i used is Sams Teach Yourself Game Programming in 24 Hours. i know the title doesnt sound very professional high-level but the author i thought was rather good at game programming and explained many aspects of win32 and game programming both very well. the games are not high level at all but great examples for a beginner at either game programming or just win32. its also really fun and super easy to hack the highscores.

BAF

what does the bs in BS_* stand for, ?

Thomas Fjellstrom

Um... Button Style maybe? Just as the WS in WS_* stands for Window Style? And WM_ is Window Message, you'll probably come accross a BM_ for Button Message.. And so forth.

BAF

thanks for telling me that allegro automatically handles win32api! [/sarcasm] that is all i wanted it for:P

so i don't neede to learn it.

oh, i found a free AUTHORIZED chm download for Petzold's book, so i will read it anywhy!;D

23yrold3yrold
Necro-boy said:

thanks for telling me that allegro automatically handles win32api!

It what? The Win32 API does loads Allegro can't ... I don't follow.

schwarzung

Quote:

oh, i found a free AUTHORIZED chm download for Petzold's book

where? ;D

Specter Phoenix

Use MinGW? I have a book on Windows Game Programming that came with Genesis 3D, LightWave, MSVC++6 Intro, and a few other tools for game/font creation. I made a silly program from the book and it compiled and ran fine (minus the fact that it has a pop-up saying not to distribute the exe from it). I don't know what was wrong but when I tried to recompile it using MinGW32 and then MinGW32 with the Dev-C++ 4.9 IDE but got compile time errors. Side question: how good is Borland C++ 5.5 for windows programming?

BAF

i forgot where, but i will email it to you. it was a limited time download from microsoft press :) or i will post it on my site, you can download it , it is about 2 meg i think.

oh @23, i meant it will run my game under windows without a dos box:):o

StevenVI

Bobby: You've been tricked. No company would, for a limited time, give away their products for free. You most likely got it from an ebookz site, perhaps disguising itself as a legitimate one. Note: a site hosted on Geocities will not contain content that Microsoft is giving away out of the kindness of their hearts. If you read your pirated book, buy it and be an honest member of society. If you don't wanna buy an awesome book, then just go to the link that I posted ages ago in this thread... http://www.winprog.org/tutorial/

-Steve

BAF

it was from microsoft.com:o:o:o:o

Specter Phoenix

I prefer to buy all my books:P. Only books I have are the books Ceniza has on his web site. A good reference book is worth the price to get;D.I bought Gmax Bible, Teach Yourself C++ in 24 Hours, Teach Yourself C++ in 21 Days, Game Design Secrets of the Sages 2nd Ed., C++ Primer, C++ for DUMMIES, Teach Yourself Game Programming in 24 Hours, and Tricks of the Windows Game Programming Gurus. I plan to buy the Standard Template Library book some time in the distant future. I prefer text books over online docs cause computers can crash but unless you take terrible care of a book the book will last for a long time:).

But that still leaves my minor non-important question of is Borland C++ 5.5 compiler and command line tools good for programming Windows Programs?

Andrei Ellman

I learned the Win32 API by modifying and writing user-interfaces for 3D Studio MAX plugins. I think I may have also learned C++ that way too.

AE.

PS. MFC is a bee-hatch! Just stick with Win32 for the time being.

PPS.

23yrold3yrold said:

Oh! Make sure you have these lines at the top of your resource file ...

#include <windows.h>
#include "resource.h" // or whatever

So your resource script knows about all the defines (your own, and the Windows ones).

Tip of the day for anyone creating resource-scripts in MSVC and who also wants to use them in MinGW if they don't have MFC for MinGW installed:
In MSVC, from the View menu, select "Resource Includes". In the "Read only symbol directives" box, delete the '#include "afxwin.h"' line (it should be the only one there), and add '#include "windows.h"'. If you want to rename your resource-file header, you can do so in the "symbol header file" field. Now you may use the same .rc file in both MSVC and MinGW. This assumes you are using the standard Win32 API and not MFC. I just learned this today.

Specter Phoenix

Which book are you referring to though?

  • Programming Windows® with MFC, Second Edition

  • Programming Windows®, Fifth Edition

  • Programming Microsoft® Windows® with C#

[edit]Oh I didn't see that you said fifth edition earlier Chris.[/edit]

Hard Rock
Quote:

i forgot where, but i will email it to you. it was a limited time download from microsoft press or i will post it on my site, you can download it , it is about 2 meg i think.

Its more than that, I downloaded it, but i gave up trying to read the stuff off the monitor and just bought it.(i mean 1000+pages on the monitor is a real pain, and my monitor is 5 years old and blurry).

If you want to download the full version its not hard to find, it took me a while at first, but looking ive found several sites that have it, even the official dev-c++ site links to where you can find a copy.

23yrold3yrold

The CD that comes with the book has an electronic version, so I guess that's been floating around. I have it installed at work and read it on break :)

Thread #270106. Printed from Allegro.cc