Thread: Programming Windows API in C++

  1. #1
    *this
    Join Date
    Mar 2005
    Posts
    498

    Programming Windows API in C++

    I am interested in learning the windows API in c++, ultimatly I want to learn openGL but I figured since most books and tutorials will probably require prior windows API programming knowledge, I might as well learn it.

    What is the easiest way to learn how to create windows using c++, not c?

    What are effective books that could teach me the basics to programming windows?

    Thanks,
    Josh

  2. #2
    Registered User
    Join Date
    Mar 2005
    Posts
    16
    well the windows api works in C or C++ so it doesn't use any C++ specific stuff such as classes etc. However, you can write C++ programs with classes etc. and still use the Windows API inside them.

    Also, windows can be encapsulated inside classes (the most famous example being MFC). however, MFC only works with Visual C++, which costs an obscene amount of $$$.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    >>I am interested in learning the windows API in c++...
    The Win32 API is implemented within DLL's that expose "C style" API's. In C++ code, this equates to C functions.

    >>...ultimatly I want to learn openGL but I figured since most books and tutorials will probably require prior windows API programming knowledge
    The few OpenGl books I own are 99% platform agnostic.

    If you want to learn OpenGl, you don't necessarily need to learn Windows first. As far as tutorials and books for Win32 programming go, "we" usually give out:
    http://www.winprog.org/tutorial/ and
    Programming Windows, 5th Ed.

    If you have your heart set on learning GUI programming using pure C++, then there a few C++ "wrapper" libries that you can choose from.

    If you've purchased a MS Visual Studio product, then you should have MFC, which is a C++ wrapper and framework for the Windows API. Borland has a similiar product called OWL. Most other downloadable libraries are designed to be platform agnostic (which is a good thing). Here are a few that I know of (some of which are built on top of OpenGl and GLUT):
    wxWidgets
    FOX Toolkit
    FLTK
    GLUI

    For OpenGl tutorial and books, I'll defer to the OpenGl nerds ;

    gg

  4. #4
    *this
    Join Date
    Mar 2005
    Posts
    498
    thanks for the clarification and help.

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    Quote Originally Posted by ubergeek
    however, MFC only works with Visual C++, which costs an obscene amount of $$$.

    not really:

    http://www.microsoft.com/downloads/d...displaylang=en
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  6. #6
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Quote Originally Posted by misplaced
    That doesn't come with MFC.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. win32 api MDI windows
    By TheNewOne in forum Windows Programming
    Replies: 5
    Last Post: 03-20-2009, 09:11 PM
  2. Use windows API functions in a GTK+ program?
    By Jake.c in forum Windows Programming
    Replies: 19
    Last Post: 01-23-2009, 06:40 AM
  3. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:00 AM
  4. Windows messenger API
    By GanglyLamb in forum Windows Programming
    Replies: 0
    Last Post: 07-10-2005, 02:52 AM
  5. Future of Windows API programming ?
    By Dev in forum Windows Programming
    Replies: 7
    Last Post: 04-22-2003, 11:21 PM