Author Topic: Windows API  (Read 6892 times)

0 Members and 1 Guest are viewing this topic.

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Windows API
« on: June 02, 2009 »
...something I completely failed to learn when learning C/C++ for demo coding (thanks NeHe!!) :P !!

Anyways I've been looking heavily into SNES development and I want to create an IDE like VC++ or Dev. I know this is a really pointless task but I've never coded an IDE before and thought it might be a nice learning experience :) ...I made a window and menu bar and all that's pretty simple and straightforward, but I really don't know how to get much further.

Anyone know any good WinAPI learning resources, other than MSDN? n00b-friendliness isn't that much of an issue; I need something that covers alot of material.

Thanks :)
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Windows API
« Reply #1 on: June 02, 2009 »
The bible of windows API programming is in my eyes (and a lot of others)
are the windows programming booky by Charles Petzold. Have a search on
google and you find them. I have a book myself of him and think it was a
great reference on all fields of WinApi coding.

However, coding such a project with the WinApi only seems to me like
rather low-level programming. I would not under-estimate the work such
a project requires and probably go with some more high-level APIs and
framework like MFC or choose .NET platform.

Just some thoughts.  ::)
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Windows API
« Reply #2 on: June 02, 2009 »
Once your on the API / IDE bandwagon, you know your next step could be a new programming lingo!

I know that FBIDE was made with Visual Basic.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: Windows API
« Reply #3 on: June 02, 2009 »
Quote
I know that FBIDE was made with Visual Basic.

I didnt know that but I know now :P:)

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: Windows API
« Reply #4 on: June 02, 2009 »
If you are going to make an IDE you should look into Scintilla: http://www.scintilla.org/. This is a code editor with built-in syntax highlighting and many other features. This will make your life much easier.

You could also look at some of the open source editors out there and modify the existing source code. This will give you a good idea of what you need to do in an editor. You can find a list of free editors on the Free Country site:

http://www.thefreecountry.com/programming/editors.shtml

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Windows API
« Reply #5 on: June 02, 2009 »
Or write a plugin for Eclipse.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline stormbringer

  • Time moves by fast, no second chance
  • Amiga 1200
  • ****
  • Posts: 453
  • Karma: 73
    • View Profile
    • www.retro-remakes.net
Re: Windows API
« Reply #6 on: June 03, 2009 »
@Ferris: hmm.. writing a serious IDE can be very time consuming. I once wrote an assembler/editor for the SNES running on the Amiga. Back then I was highly inspired by the Asm One editor. Unfortunately the SNES scene died before my project could be released for others than me and my team mate from Frontline Assembly (out SNES group back then).

However if the scope is to learn how to write a good IDE, I strongly suggest that you dive in the Windows API using MSDN and take advantage of learning how to navigate through it. MSDN is the best resource ever for the Windows API. It's clean, well explained and constantly updated. Books are great of course, but sincerely they are always out of date and never cover properly the dark sides of the Win32 API. Micro$oft also often updates the MSDN with code snippets that are very valuable.

A good IDE has a fast and powerful editor as well as a great handling of the debugging mode. How far do you plan to go? are you planning to write your own assembler/macro assembler? how will the debugger work? through emulation?

I strongly suggest that you plan these things first as they are key to the success of your project.

Besides this, such a project is never pointless. You will learn much more about everything than with any small project. Even if you never finish it, the experience will be of great value for your future
We once had a passion
It all seemed so right
So young and so eager
No end in sight
But now we are prisoners
In our own hearts
Nothing seems real
It's all torn apart

Offline WidowMaker [retired]

  • %010101
  • Atari ST
  • ***
  • Posts: 134
  • Karma: 21
  • %010101
    • View Profile
Re: Windows API
« Reply #7 on: June 04, 2009 »
This will be a great task for any programmer to do.

I found it hard enough to make a magazine engine, let alone an editor where people can type things in and potentially break it :) This will develop lots of different skills in validating data, developing something that is intuitive to use and it will give you huge satisfaction if it takes off and people start using it in great numbers.

Historically in the scene, writing tools such as assemblers, packers etc gets you so much respect.
Good luck with it Ferris. I would echo Stormbringer about MSDN, you won't find anything better to get you into the Windows API, don't underestimate the task you are about to take on, but then I have seen some of your things already and I think you have the skill and determination do it.


Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Windows API
« Reply #8 on: June 04, 2009 »
Thanks guys :) And yes, MSDN is KILLER for this kind of stuff, no doubt.

The goals are pretty simple. I'm making a project file format to hold just a list of included .asm and .inc files. There are options for adding and removing files as well as simple project options, and the tool will generate the .link file automatically. As far as an assembler/emulator, the package will (hopefully) include WLA and ZSnes, but essentially my tool can link to any other emulator as I'll include editable path names. I already have a list of different keywords so a rich editor control should do well for a tabbed editor.

Basically it'll just be a vamped-up text editor with hotkeys for assembling etc, that's all, really...as far as an IDE it's minimalistic but exactly what i'll need.
« Last Edit: June 04, 2009 by Ferris »
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline stormbringer

  • Time moves by fast, no second chance
  • Amiga 1200
  • ****
  • Posts: 453
  • Karma: 73
    • View Profile
    • www.retro-remakes.net
Re: Windows API
« Reply #9 on: June 04, 2009 »
ok... this project is really exciting and can really be a nice one if you are serious about it. There are a couple of things that you should ask yourself about this project before starting it.

First of all, the Windows API is going to be the challenge. Most of the code of your IDE you will have to write yourself, the Win32 API will just help you to make it exist as a usable program.... For example on the Amiga in the early days, writing a file requester with Intuition was a real pain. Later we had the Requester library that helped a lot.. but still the challenge was really elsewhere.

Then you have to think about what you start with. Microsoft's IDEs have a layer of abstraction (just like EMACS has) for parsing source code files and formatting the text on screen. In other words parsing the source code is one of the major tasks. If plan to write your own assembler, then you need to plan your components properly, because the IDE and the assembler will eventually need those common components. For example, a good IDE can use math expressions for the debugger, breakpoints, etc. Just as in the source code.

After that you have to think about the mechanism to format the text on screen. The Win32 API provides you with some components to create quickly some basic text editors. The first one is the basic multiline text editor (just what Notepad.exe is), the second component is a RTF (rich text format) editor. The RTF component allows you to have different fonts, colors, etc existing in the same display. Both are painful to use because they are really not meant to edit source code. Also because of the common components I mentioned above, chances are that you will have a "dual" existence of the source code in memory... which is not good. Besides that they have memory limits for the text buffers. So I clearly suggest that you write your own display engine.

Writing your own rich text display means that you are able to parse the source code and look for keywords, etc in a dictionary that will hold the color of the text, etc. This capability is also required in the assembler. So again you need to plan your work correctly.

So my first advice is to forget a bit about the Windows API and answer the following questions:

1) are you going to use some already existing assembler or write your own? If you plan to write your own (which is the best sollution for the future IDE), then I suggest that you start with a desassembler first

2) do you have the knowledge about how to write a stream handler? you will need this to access the source code data down to the character level and have the ability to move back and forth in the stream. You also need to keep track of some positions in the stream. I can help with info on how to write a good one. You need to have this in order to have an abstraction between the source code (stream of characters) and the actual storage (file or memory buffer, or a mix).

3) you you have the knowledge about how to write a lexical scanner? you will need this to identify the keywords, etc

4) well... when you answer these 3 questions, we can move forward.

5) what about starting a thread here so we can all help and monitor the work? This is really an exciting project.

Let us know..


We once had a passion
It all seemed so right
So young and so eager
No end in sight
But now we are prisoners
In our own hearts
Nothing seems real
It's all torn apart

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Windows API
« Reply #10 on: June 05, 2009 »
Stormbringer: I defined all those questions in my previous post :D But thanks anyways :) It's cool to see someone so interested in this.

Also if it goes well I might also add a dialog for converting pcx or bmp to snes .inc if necessary. Depends on how hard that will be.

As of now my current task is getting a text editor control to work per-tab with different text each, which isn't hard...plus I already have a text file full of different keywords that I've been carrying around for notepad++ :) It has the whole 65c816 instruction set along with (I'm pretty sure of this:) ALL of WLA's directives. It also has the symbols for recognizing different types of numbers.

As far as a debugger, I don't think I'll be doing one anytime soon, as I've never used one since Blitz anyways and have no idea what to expect :P As it's not something I need it's in "maybe" status for now.
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Windows API
« Reply #11 on: June 05, 2009 »
Also to add, I've done all this in the WinAPI so far and it seems my first problem of finding good doc's is pretty much over...

I've started a new, more currently-relevant thread here:
http://www.dbfinteractive.com/forum/index.php/topic,4095.0.html

Thanks :)
« Last Edit: June 05, 2009 by Ferris »
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won: