SYNOPSIS of Win32Lib Documentation:

BASIC INFO:

Win32Lib is a library of routines which make programming for Windows easier. To use the Win32Lib library you type:

include win32lib.ew

on a line all by itself at the beginning of your program. You can then use the routines defined in the library in your own Windows program. (Note: there is a separate IDE program available from user contributions at RDS to make this process easier.)


CORE CONCEPTS:

  • CONTROLS are the basic visual & useable elements of Windows programs. They are what you see, act upon, or set to perform actions. They include the main & other windows, timers, list boxes, buttons, status bars, etc. You can create them, query and change their Attributes, and write code to respond to Events which happen to them.        
  • ATTRIBUTES of Controls: Controls can have a variety of properties, such as size of the control, font size, font color, etc. Various routines let you inspect and alter attributes of controls.
  • EVENTS: In addition to creating controls and setting their attributes, Windows programming consists of writing routines to respond to various events, such as actions taken by the user of the application - mouse clicks, key presses, resizing windows, and so on. These response routines are called "Event Handlers". You must also refer a desired event on a specified control to the appropriate event handler routine, using the setHandler() routine. Note: These events must be events which are already predefined within Win32Lib itself.
  • MAIN EVENT LOOP : WinMain is the main processing loop for Win32Lib. You call WinMain at the VERY END of your program. This must be after ALL your controls have been declared, after all the routines you have written to handle all of the events you want to be responded to in your program, and after all the event handler statements which direct the program to the various appropriate event handler routines.

  • EVENT HANDLER STATEMENTS:

    In order to make your program respond to some known event, you must write an event handler statement, somewhere AFTER the routine you have written to respond to & handle the occurance of the event, like this:

            setHandler(controlID, eventType, routine_id("event_handler_name"))

    where controlID is a control you have created, eventType is a defined event, routine_id is typed in small letters, and the event_handler_name is the name of the procedure you made to handle the occurance of the event.

    example:

    -- event handling procedure:
    procedure onClick_btnToDoSomething()
        --do something
    end procedure

    -- event to respond to:
    setHandler(btnToDoSomething, w32HClick, routine_id ("onClick_btnDoSomething")


    IDE:

    There is an Integrated Development Environment program available from user contributions at RDS which utilizes Win32Lib to give Windows programmers the ability to easily create the visual elements of a Windows program by mouse clicks, like Visual Basic. It also allows event handlers to be easily created.


    FAQ:

    See also: some Frequently Asked Questions about using Win32Lib.


    WIN32LIB NAMED COLORS:

        Black           = rgb( 0, 0, 0 ),
        Blue            = rgb( 0, 0, 127 ),
        Green           = rgb( 0, 127, 0 ),
        Cyan            = rgb( 0, 127, 127 ),
        Red             = rgb( 127, 0, 0 ),
        Magenta         = rgb( 127, 0, 127 ),
        Brown           = rgb( 127, 127, 0 ),
        White           = rgb( 127, 127, 127 ),
        Gray            = rgb( 127, 127, 127 ),
        BrightBlue      = rgb( 0, 0, 255 ),
        BrightGreen     = rgb( 0, 255, 0 ),
        BrightCyan      = rgb( 0, 255, 255 ),
        BrightRed       = rgb( 255, 0, 0 ),
        BrightMagenta   = rgb( 255, 0, 255 ),
        Yellow          = rgb( 255, 255, 0 ),
        BrightWhite     = rgb( 255, 255, 255 )
    
    

    Optional, not pre-named in Win32Lib: SkyBlue = rgb( 0, 127, 255)