Windows programming links
Getting Started
This thread is intended to act as a quick reference for getting started with programming with the windows application programming interface(api, win32api, winapi).
Primary reference
Tutorials/how-tos/faqs
Platform Software Development Kit (PSDK)
This is not normally necessary if using Borland compilers, MinGW (dev-cpp, or, probably, code::blocks). It is essential for windows api programming with microsoft compilers.
Note that although the psdk does contain mfc (Microsoft Foundation Classes) it is for 64bit platforms only and their use is restricted; check the licence for details.
Some Non-MFC C++ Class Libraries/Widgets(controls)
Books
- Programming Windows, 5th edition, Charles Petzold (ISBN: 1-57231-995-X)
- Programming Applications for Microsoft Windows, 4th edition, Jeffrey Richter (ISBN: 1-57231-996-8)
(For mfc: Programming Windows with MFC, 2nd edition, Jeff Prosise(ISBN: 1-57231-695-0))
Compiler Specific:
Error Early On In This Tutorial
Referring to the above mentioned tutorial...
Quote:
C and C++ languages can use Windows API directly. Other languages use intermediary libraries. These libraries have been created in C or C++. So other languages call the Windows API indirectly. There is one exception. It is the Java Swing library.
Completely false. I code directly to the Windows Api using PowerBASIC every day. Coding using that language is exactly as in C. For example, here is a CreateWindow() call..
Code:
hWnd=CreateWindow(szAppName,"Form1",%WS_OVERLAPPEDWINDOW,200,100,325,300,0,0,hIns,ByVal 0)
The link to User32.dll is through a declare such as this...
Code:
Declare Function CreateWindowEx Lib "USER32.DLL" Alias "CreateWindowExA" _
( _
BYVAL dwExStyle AS DWORD, _
lpClassName AS ASCIIZ, _
lpWindowName AS ASCIIZ, _
BYVAL dwStyle AS DWORD, _
BYVAL x AS LONG, _
BYVAL y AS LONG, _
BYVAL nWidth AS LONG, _
BYVAL nHeight AS LONG, _
BYVAL hWndParent AS DWORD, _
BYVAL hMenu AS DWORD, _
BYVAL hInstance AS DWORD, _
lpParam AS ANY _
) As Dword
That's about as direct as you can get, and isn't through 'intermediary libraries'. Perhaps I'm just nitpicking. Everything else I read sounded OK.