Make your own free website on Tripod.com
Online Tutorial for Windows 95/98/NT/2000
 Applications Programming In FORTRAN. 
 by 
Vladimir V. Vasilchenko


Volume 1. The Basic Methods and Elements of Windows
                 Applications Programming in FORTRAN.

( Important! See "Rules" for additional information, please. )
 Dedication
 1. Getting Started under Windows.
     1.1. The Basic Scheme of  Windows Application.
     1.2. Our First Windows Applications.
 2. Basic Windows Concepts and Terminology.
     2.1. What is a Window? 
     2.2. Visual Elements of a Window. 
     2.3. How to Create a Window in FORTRAN.
     2.4. Basic Stages in Windows Application Creation.
            2.4.1.  Windows Classes.
                       2.4.1.1.  Application Local Classes.
                       2.4.1.2.  System Global Classes
                       2.4.1.3.  Application Global Classes.
            2.4.2.  Window Procedure  the Main Member of  a Window Class.
                       2.4.2.1.  Events and Messages.
                                     2.4.2.1.1. Windows Message Format 
                                     2.4.2.1.2.  System Messages 
                                     2.4.2.1.3.  Application-defined Messages.
                                     2.4.2.1.4.  User-defined Messages.
                       2.4.2.2.  The Message Loop.
                       2.4.2.3.  The Window's Procedure. 
            2.4.3.  Windows Types
            2.4.4.  Windows Styles
            2.4.5.  Windows Show States
 3. Writing Simple Windows Programs  Minimal Win32 Application in FORTRAN.
      3.1. Basic Components of a Window Program
             3.1.1.  The WinMain Function
             3.1.2.  Registering the Window Class
                        3.1.2.1.  The Window Class Structure
                        3.1.2.2.  Elements of a Window Class
             3.1.3.  Creating the Window
             3.1.4.  Displaying/Updating the Window
             3.1.5.  The Message Loop
             3.1.6.  The Window's Procedure (WndProc)
      3.2. Customizing the Application Window 
      3.3. Adding a Simple User Interface
             3.3.1.  The Button Control. 
             3.3.2.  The Static Text Control. 
 4. Creating User Interfaces With Windows Controls. 
     4.1. Windows Standard Controls.
            4.1.1.  Predefined Controls.
            4.1.2.  Static Controls 
                       4.1.2.1.  Static Control Types
                       4.1.2.2.  Notification Messages From Static Controls
                       4.1.2.3.  Control Messages to Static Controls
                       4.1.2.4.  Using Static Controls.
                                     4.1.2.4.1.  Simple Static Text Control.
                                     4.1.2.4.2.  Owner-Drawn Static Control.
                                     4.1.2.4.3.  Static Controls with Images.
                                     4.1.2.4.4.  Static Rectangles and Frames.
            4.1.3.  Buttons. 
                       4.1.3.1.  Button Types and Styles
                       4.1.3.2.  Button States
                       4.1.3.3.  How a Button Works
                       4.1.3.4.  Notification Messages from Buttons
                       4.1.3.5.  Control Messages to Buttons
                       4.1.3.6.  Using Buttons.
                                     4.1.3.6.1.  Using  Standard  Button.
                                     4.1.3.6.2.  Autoradiobutton Sample.
                                     4.1.3.6.3.  Radiobutton Sample.
                                     4.1.3.6.4.  Groupbox, Checkbox and Autocheckbox Buttons Sample.
                                     4.1.3.6.5.  Owner-Drawn Button Samples.
                                                      4.1.3.6.5.1.  Owner-Drawn Button with Bitmap.
                                                      4.1.3.6.5.2.  Owner-Drawn Button with Icon.
                                                      4.1.3.6.5.3.  Owner-Drawn Button with Metafile.
                                                      4.1.3.6.5.4.  Owner-Drawn Button with Custom Font.
                                                      4.1.3.6.5.5.  Advanced Owner-Drawn Button Sample.
            4.1.4.  List Boxes
                       4.1.4.1.  List Box Types and Styles.
                       4.1.4.2.  How a List Box Works.
                       4.1.4.3.  Notification Messages from List Boxes
                       4.1.4.4.  Control Messages to List Boxes
                       4.1.4.5.  Using List Boxes
                                     4.1.4.5.1.  Simple List Box
                                     4.1.4.5.2.  Multiple-selection List Box
                                     4.1.4.5.3.  Multi-column List Box
                                     4.1.4.5.4.  Owner-Drawn List Box
                                     4.1.4.5.5.  List Box with Directory List Inside.
                                     4.1.4.5.6.  Handling Information from List Box.
            4.1.5.  Edit Control
                       4.1.5.1.  Edit Control Types and Styles
                       4.1.5.2.  How a Edit Control Works
                       4.1.5.3.  Notification Messages from Edit Control
                       4.1.5.4.  Control Messages to Edit Control
                       4.1.5.5.  Using Edit Control.
                                     4.1.5.5.1.  Using Edit Control for Data Input.
                                     4.1.5.5.2.  Improved Sample.
            4.1.6.  Combo Boxes
                       4.1.6.1.  Combo Boxes Types and Styles
                       4.1.6.2.  How a Combo Box Works
                                     4.1.6.2.1.  Combo Box List 
                                     4.1.6.2.2.  Combo Box Current Selection
                                     4.1.6.2.3.  Special Combo Box Features.
                       4.1.6.3.  Notification Messages from Combo Boxes
                       4.1.6.4.  Control Messages to Combo Boxes
                       4.1.6.5.  Using the Combo Box
                                     4.1.6.5.1.  Simple Combo Box
                                     4.1.6.5.2.  Combo Box with Directory List Inside.
                                     4.1.6.5.3.  Owner-Drawn Combo Box
                                     4.1.6.5.4.  Handling Information from Combo Box.
            4.1.7.  Scroll Bars
                       4.1.7.1.  Standard Scroll Bars and Control Scroll Bars
                       4.1.7.2.  Elements of a Scroll Bar
                       4.1.7.3.  How a Scroll Bar Works
                       4.1.7.4.  Notification Messages from Scroll Bars
                       4.1.7.5.  Control Messages to Scroll Bars
                       4.1.7.6.  Using Scroll Bar Control
                                    4.1.7.6.1.  Scrolling Text Sample
                                    4.1.7.6.2.  Scrolling Bitmap Sample.
                                    4.1.7.6.3.  Using Scrollbar for Variable Value Changing.
            4.1.8.  Subclassing and Superclassing - the Universe of Controls.
 5. Using Menus.
     5.1. Menu Types.
     5.2  How a Menu Works 
     5.3. Menu Creation Methods Overview
            5.3.1.  Windows API Functions for Menu. 
            5.3.2.  Pulldown Menu.
                       5.3.2.1.  Simple Pulldown Menu.
                       5.3.2.2.  Adding Submenu.
                       5.3.2.3.  Managing a Menu within an Application. 
                       5.3.2.4.  Using Custom Checkmarks. 
                       5.3.2.5.  Owner-Drawn Menu. 
            5.3.3.  System Menu.
            5.3.4.  Floating Popup Menu. 
 6. Windows' Graphics  
     6.1. Device Contexts
            6.1.1.  Graphic Objects and Graphic Modes
            6.1.2.  Device Context Types
            6.1.3.  Windows' Functions for Device Contexts
            6.1.4.  Using Device Context
                       6.1.4.1.  Retrieving the Capabilities of a Printer.
                       6.1.4.2.  Changing Screen Resolution.
     6.2. Selecting Color for Drawing. 
     6.3. Drawing a Pixel. 
     6.4. Basic Graphic Tools.
     6.5  Basic Primitives of Windows' Graphics.
            6.5.1.  Drawing Lines
                       6.5.1.1.  Standard Scheme of Line Drawing.
                       6.5.1.2.  User-Defined Line Drawing.
            6.5.2.  Drawing Polylines.
            6.5.3.  Drawing Curves.
            6.5.4.  Drawing Filled Shapes.
     6.6. Windows' Graphic Objects 
            6.6.1.  Regions
                       6.6.1.1.  Region Types
                       6.6.1.2.  Region Operations
                       6.6.1.3.  Using Regions
                                     6.6.1.3.1.  Region Operations Samples.
                                     6.6.1.3.2.  Clipping Region Sample.
                                     6.6.1.3.3.  Hit Testing Sample.
                                     6.6.1.3.4.  "Nonrectangular Window" Sample.
            6.6.2.  Bitmaps
                       6.6.2.1.  Operations with Bitmaps
                       6.6.2.2.  Using Bitmaps
                                     6.6.2.2.1.  Bitmap as Background for Window.
                                     6.6.2.2.2.  Capturing and Saving the Image.
                                     6.6.2.2.3.  Printing a Window Content.
                                     6.6.2.2.4.  Drawing Transparent Bitmap.
            6.6.3.  Metafiles
                       6.6.3.1.  Operations with Metafiles.
                       6.6.3.2.  Using Metafiles.
                                     6.6.3.2.1.  Scaling a Metafile.
                                     6.6.3.2.2.  Scrolling a Metafile.
                                     6.6.3.2.3.  Printing a Metafile.
 7. Drawing Text 
     7.1. About Text Output 
     7.2. Selecting Font for Text
     7.3. Sample Programs.
            7.3.1.  Using Stock Font.
            7.3.2.  Using Customized Font.
            7.3.3.  Draw Text in Arbitrary Direction.
            7.3.4.  Simple Text Formatting.
 8. Mouse and Keyboard 
     8.1. About Mouse and Keyboard.
     8.2. Input Devices and Windows Messaging
     8.3. Sample programs.
            8.3.1.  Region Testing Sample.
            8.3.2.  "Hyperlink" Sample.
            8.3.3.  "Active Region" Sample.
 9. Cursor 
     9.1. About Cursor
     9.2. System Cursors.
     9.3. User-Defined Cursors.
     9.4. Using Cursor Sample. 
10. Using Common Dialogs 
      10.1. "Open" Dialog. 
      10.2. "Save As" Dialog. 
      10.3. "Choose Font" Dialog.
      10.4. "Choose Color" Dialog. 
      10.5. "Print" Dialog. 
11. Files. 
      11.1. About Files 
      11.2. Basic Operations with Files
      11.3. Directory Listing with Files Information Sample. 
12. Printing under Windows 
      12.1. Basic Scheme of Printing Process. 
      12.2. Template for Simplest Printing. 
Acknowledgements
A. Bonus Programs/Tips/Tricks for Readers 
     A.1.   Simple template for function drawing. 
     A.2.   Simple template for function drawing with virtual screen technique. 
     A.3.   Advanced sample of function drawing.
     A.4.   Animating window. 
     A.5.   Fortran specific - "Let me stop it now..."
     A.6.   Image smoothing sample.
     A.7.   Image sharpening sample.
     A.8.   Embossed Image Sample.
     A.9.   Solarized Image Sample.
     A.10. Colored Static Control.
     A.11. Colored Edit Control.
     A.12. Using Custom Fonts In Controls.
     A.13. Cascade Child Windows in non-MDI Application.
     A.14. Tile Child Windows in non-MDI Application.
B. Documentation on All Windows' API Functions Used or Mentioned in Book.
     B.1.   Functions for work with menu
     B.2.   Functions for work with pens and brushes
     B.3.   Functions for work with lines, polylines and curves
     B.4.   Functions for drawing pixel
     B.5.   Functions for filled shapes
     B.6.   Functions for regions
     B.7.   Functions for bitmaps 
     B.8.   Functions for metafiles
     B.9.   Functions for text output 
     B.10. Functions for mouse and keyboard
     B.11. Functions for cursors
     B.12. Functions for work with files
     B.13. Functions for printing