Windows Programming in C under DevC++

L

Luc The Perverse

Hello!

I am looking for a beginners tutorial on how to program for windows in C.
I guess this is windows API?

I have never written outside of VC++ for windows, and can't find any
examples. I don't think that this is a DevC++ specific question.

I have written a simple application which locates duplicate files; it first
compares file sizes, and then runs an SHA-256 (might switch to Adler 32)
hash on the file to see if it matches. (I realize that this has been done
before, I am doing this as a learning project.)

For this project, I am going to need a window, buttons, intercept keystrokes
(for shortcuts), a list box with checkmarks, message boxes (perhaps nested
in a listbox), child windows (just modal dialogs), progess bars, and the
actual detection and scanning part will have to run in its own thread.

GUIs have never been my forté. I cut and paste whenever I can, and
Microsoft makes it worse by requiring that you learn very little about how
the system works.

After I get it working in Windows, then I am going to try again in Linux -
and try to get better at identifying which functions can be identical and
which functions need to be seperate.

I have also considered writing my real functions in C and then using Java as
my front end to eliminate the majority of porting issues. I would still of
course want my EXE file to have an Icon, and I wouldn't know how to do this.

Please point me to some beginners tutorials, or tell me what I should be
searching for on Google.

I will go to Java NG and ask about using Java as a C front end, as I think
this is quite a different question.
 
M

Malcolm

Luc The Perverse said:
I will go to Java NG and ask about using Java as a C front end, as I think
this is quite a different question.
Java provides facilities for linking to C, but you cannot call Java from C,
normally, and certainly not from ANSI stnadard C.

AS for how to use the devC++ libraries, you need to find some documentation.
I don't actually know what devC++ is - it may or may not use Microsoft's
standard Windows API.
 
P

Pacher R. Dragos

Dev Cpp is one of my favourite IDE, among with .NET, but you should be
careful using it because the last beta version is quite instable, after
8 hours working on my project it started to paste code by himself
mangling my code, so take care.
But to answer your question you may try C Builder 5 for developing
GUI's.

A nice windows tutorial can be found in Lcc standard documentation. Or
search any warez site, and you'll find some!
 
P

pemo

Luc The Perverse said:
Hello!

I am looking for a beginners tutorial on how to program for windows in C.
I guess this is windows API?

I have never written outside of VC++ for windows, and can't find any
examples. I don't think that this is a DevC++ specific question.

I have written a simple application which locates duplicate files; it
first compares file sizes, and then runs an SHA-256 (might switch to Adler
32) hash on the file to see if it matches. (I realize that this has been
done before, I am doing this as a learning project.)

For this project, I am going to need a window, buttons, intercept
keystrokes (for shortcuts), a list box with checkmarks, message boxes
(perhaps nested in a listbox), child windows (just modal dialogs), progess
bars, and the actual detection and scanning part will have to run in its
own thread.

GUIs have never been my forté. I cut and paste whenever I can, and
Microsoft makes it worse by requiring that you learn very little about how
the system works.

After I get it working in Windows, then I am going to try again in Linux -
and try to get better at identifying which functions can be identical and
which functions need to be seperate.

I have also considered writing my real functions in C and then using Java
as my front end to eliminate the majority of porting issues. I would
still of course want my EXE file to have an Icon, and I wouldn't know how
to do this.

Please point me to some beginners tutorials, or tell me what I should be
searching for on Google.

I will go to Java NG and ask about using Java as a C front end, as I think
this is quite a different question.

Um, this is 'off topic' here - and you'll get slapped for asking such
things!

This is a 'standard C' discussion - so, go out and seek a Win32 group.

Tip:

1. go to bed with 'Petzold' (or 'Morris': he of 'Windows: Advanced
Programming and Design')
2. go to bed with a copy of the Win32 API docs

Tip tip - don't shag 'em, read 'em.
 
J

jacob navia

Pacher R. Dragos a écrit :
Dev Cpp is one of my favourite IDE, among with .NET, but you should be
careful using it because the last beta version is quite instable, after
8 hours working on my project it started to paste code by himself
mangling my code, so take care.
But to answer your question you may try C Builder 5 for developing
GUI's.

A nice windows tutorial can be found in Lcc standard documentation. Or
search any warez site, and you'll find some!
Lcc-win32 doesn't only provide a tutorial but also a compiler,
a resource editor (there is noone under devC++) and a windowed
debugger. A wizard generates the skeleton of the windows
application for you saving a lot of typing.

But the language is C, not C++. There are some extensions to C
like operator overloading and generic functions but nothing like C++.

http://www.cs.virginia.edu/~lcc-win32

P.S. Do not go to the "warez" sites to get software that
is free anyway. It doesn't make much sense
 
M

Mabden

pemo said:
Tip:

1. go to bed with 'Petzold' (or 'Morris': he of 'Windows: Advanced
Programming and Design')

Charles Petzold. Programming Windows.

You should consider moving forward into the year 2000 and get his latest
book: Programming Microsoft Window with c# (note that he has had to put
the M$ word in the title, now). You'll need to install the .NET
Framework freebie and the free compiler, and any machine you run your
program on will need to have .NET installed for it to work. But the
benefits are many, as you can write object oriented code, the CLR (the
"interpreter" that runs your code) will let you write in any language MS
has deemed acceptable - so your Java skills can work in .NET, or if you
know VB, Perl, or whatever, they all "compile" into a form that the CLR
can run.

A lot of "old Windows" headaches go away with C# - no more COM COM+ DCOM
ATL crap. I'm just learning it myself, but it seems to be the new way to
turn wiggling your fingers into gold.
 
R

Richard Heathfield

Mabden said:
Charles Petzold. Programming Windows.

You should consider moving forward into the year 2000

That would be a retrograde step, not a forward move.
and get his latest
book: Programming Microsoft Window with c#

This, however, is 2005, not 2000. C# is no longer flavour-of-the-month. C,
however, remains flavour of the millennium.
(note that he has had to put
the M$ word in the title, now). You'll need to install the .NET
Framework freebie

Cruel, cruel. Doesn't Windows slow his machine down enough already?
 
M

Mabden

Richard Heathfield said:
Mabden said:


That would be a retrograde step, not a forward move.

Ah. Not a Conan O'Brien fan, eh? He does this great bit that he started
around 1997 or so that "looks into the future - all the way to the Year
2000!" It became even funnier when he kept doing it after 2000. On a
personal note, I always use the word modren when I talk about things
that are super-new and sure to be super-outdated almost immediately.
Like, everytime someone shows you their great new phone - "Wow! that's
really modren!" I would probably call .NET modren technology.
This, however, is 2005, not 2000. C# is no longer flavour-of-the-month. C,
however, remains flavour of the millennium.

C# is the job-of-the-month. You WILL get interviews by saying you have
@+ years of C#. Bet on it. (The @+ was supposed to be 2+, but I liked
the way it looked and I'll probably use it - especially in modren posts
like this one!)
Cruel, cruel. Doesn't Windows slow his machine down enough already?

That's what Intel is FOR. The old IBM philosophy: "Hardware will catch
up!" or "Shit rolls downhill!" or something...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top