Documentation for Win32lib v0.60.6
Table of Contents

System Attributes

These are routines that let you inspect and alter attributes of various system-wide elements.


  • proc classAutoSelect( object type, integer Flag )   Turns on and off edit controls' default auto-selection property.
  • func classDefaults(integer class, sequence pData)   Used to change the default values for style and extended style flags.
  • func clientToClient(integer id1, integer id2, sequence xy)    Converts a point in id1 to a relative point in id2
  • func ClientToScreen(integer id, integer x, integer y)   Converts a point in a control to screen-based coordinates.
  • func convPctToPixel(integer id, object x, object y, object width, object height)   Converts relative coordinates to pixel coordinates.
  • func findWindow(sequence ClassName, sequence WindowTitle)   Looks to see if the named window exists in the system.
  • func getActiveWindow()    Returns the id of the control that the user is working on.
  • func getAppName()   Gets the application's name.
  • func getClassName(integer id)   Gets the Windows Class name for the control.
  • func getHandle(integer controlID OR sequence {TVid, TVItemID} )   Returns the Windows Handle of the specified control
  • func getHWND(integer controlID)   Returns the Windows Handle of the specified control
  • func getId( object hWnd )    Finds the control/window ID given a Window Handle.
  • func getIdName(integer controlID)   Returns the name of a control, given it's id.
  • func getKeyState(atom key)    Gets the depressed stats of the key.
  • func getMainWindow()   Gets the id of the main window for this application.
  • func getNameId(sequence Name)   Returns the id of a control, given it's name.
  • func getNameIdInContext(sequence Name, integer Parent)   Returns the id of a control, given it's name and parent control.
  • func getSysColor( window, color )   Return atom with value of a system color.
  • func getSystemMetrics( object Code )   Allows you to get miscellaneous information about the Windows system your application is running on.
  • func getUserName()   Fetches the id of the currently logged in user.
  • func getWinVersion()   Gets the version information of the windows platform you are running in.
  • func loadIconFromFile( object iconfile )   Get an icon from a file.
  • func manageToolTip( integer pAction, integer pNewControl)   Helps manage the ToolTip controls.
  • func ScreenToClient(integer id, integer x, integer y)   Converts a point on a screen to control-based coordinates.
  • func setAppName(sequence Name)   Sets the text used as a class name prefix for new Windows.
  • func setAutoFocusLabels(integer NewValue)   Sets whether or not a '&' in labels set focus to subsequent edit field.
  • func setCreateFont( sequence faceName, atom points, object attrib, atom color )   sets the font used for controls when they are created.
  • func setEndAction(integer code)   Sets the exit code and behaviour at application closure.
  • proc setIdName(integer controlID, sequence Name)   Sets the name of a control, given it's id.
  • func setMainWindow(integer New)   Used to tell the library which window is the primary one.
  • func validId(object id)   Tests to see if the specified id is a valid one.
  • proc WinMain( window, style )   Run event loop.

    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    classAutoSelect
    ( object type, integer Flag )

    Turns on and off edit controls' default auto-selection property.

    Category: System Attributes

    If flag is w32True, controls of type are set to have Auto-Selection, otherwise they do not have Auto-Selection behaviour by default when created.

    type can be either a single control type or a list of types in a sequence.

    Auto-selection means that when the edit control gets focus, all its contents is selected automatically for you.

    Example:

          -- Set the default for EditText fields.
          classAutoSelect(EditText, w32True)
    

    See Also: classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    classDefaults
    (integer class, sequence pData)

    Used to change the default values for style and extended style flags.

    Returns: The current values of these flags prior to changing them.

    Category: System Attributes

    class is the type of control whose defaults you want to change.
    pData is a sequence that contains zero or more sub-sequences. Each sub-sequence must have two elements, the first is the type of flag being changed, and the other is the new value for the flag. The flag value can be either an atom with all the flags or'd, or a sequence of individual flags.
    The types of flags that can be changed are:

  • CCflags - Standard control flags
  • CCexflags - Extended control flags
  • CCwinstyle - Only applies to Window - the class style flags.

    Note, if pData is an empty sequence, the current flags are returned. example:

       sequence oldFlags
       -- Make LText initially hidden and have a border when displayed.
       oldFlags = classDefaults(LText, {
                       {CCflags, {WS_CHILD, ES_LEFT}},
                       {CCexflags, WS_EX_CLIENTEDGE}
                          })
       -- Change the default class flags for windows.
       oldFlags = classDefaults(Window, {
                       {CCwinstyle, {CS_HREDRAW,CS_DBLCLKS}}
                          })
    

    See Also: classAutoSelect, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    clientToClient
    (integer id1, integer id2, sequence xy)

    Converts a point in id1 to a relative point in id2

    Returns: SEQUENCE: {X, Y}

    Category: System Attributes

    xy is a sequence in the format { X, Y} which specifies a point in the control id1. This value is transformed so that it is relative to the control id2.

    Example

          sequence mXY
          -- Find where the point 2,-4 relative to the editbox is
          -- relative to the label.
          mXY = clientToClient(MyEditBox, MyLabelText, {2, -4 })
    

    See Also: classAutoSelect, classDefaults, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    ClientToScreen
    (integer id, integer x, integer y)

    Converts a point in a control to screen-based coordinates.

    Returns: SEQUENCE: {screenX, screenY}

    Category: System Attributes

    Example

          sequence sPosn
          -- Find the screen position of the window's top left corner.
          sPosn = ClientToScreen(myWindow, 0, 0)
          printf(o, "Window is at %d, %d", {sPosn[1], sPosn[2]})
    

    See Also: classAutoSelect, classDefaults, clientToClient, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    convPctToPixel
    (integer id, object x, object y, object width, object height)

    Converts relative coordinates to pixel coordinates.

    Returns: SEQUENCE: 4-element list {Left, Top, Width, Height}

    Category: System Attributes

    This is used internally by create() and a number of other routines to convert things like %values to pixels.

    Each dimension can be expressed as either...
    a) an integer >= 0, in which case it is not touched.
    eg. 50 (= 50 pixels)
    b) an atom in the range > 0 and < 1, which is taken to be a %
    of the control's parent dimension.
    eg. 0.50 (= 50% of parent's size)
    c) The constant w32Edge which signifies the parent's extreme
    client edge for the dimension. That is, either the rightmost or
    bottom most edge, as appropriate.
    d) a sequence of two elements, the first as in (b) or (c) above, and
    the other a pixel offset. The offset is added after converting.
    eg. {0.50, -3} ( = 50% of parent size less 3 pixels)
    eq (w32Edge, -10} ( = right/bottom pixel less 10 pixels)
    e) a sequence of three elements, the first two as in (d), and
    the other a two-element sequence containing the minimum and
    maximum allowable values. These can be a percentage or a
    pixel amount.
    eg. {0.50, -3, {0.2, 300}} ( = 50% of parent size less
    3 pixels, and a minimum of 20 pixels and a
    maximum of 300 pixels)
    Example:

           sequence BBox
           BBox = convPctToPixels( myEditBox, 0.30, {w32Edge,-40}, {0.1,4}, 35)
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    findWindow
    (sequence ClassName, sequence WindowTitle)

    Looks to see if the named window exists in the system.

    Returns: SEQUENCE: {0,0} if not found otherwise {id, hWnd} if found.

    Category: System Attributes

    ClassName can be zero or a string containing the registered classname of the window you are looking for.
    WindowTitle can be zero or a string containing the sought after window's caption text.

    Note: You must supply at least one non-zero parameter.

    Example

          sequence h
          h = findWindow(0, "Super Database")
          if equal(h, {0,0}) then
              -- not found
          else
              if h[1] > 0 then
                  -- A control in my running app
              else
                  -- A window belonging to another app
              end if
          end if
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getActiveWindow
    ()

    Returns the id of the control that the user is working on.

    Returns: INTEGER: The id of the window or 0 if the app does not have an active window.

    Category: System Attributes

    You can use this to find out if the application is currently the active one.

    Example:

          integer ActiveID
          ActiveID = getActiveWindow()
          if ActiveID = 0 then
              -- No window for this app is active
          else
              -- I have an active window.
          end if
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getAppName
    ()

    Gets the application's name.

    Returns: SEQUENCE: The application's name as set by setAppName

    Category: System Attributes

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getClassName
    (integer id)

    Gets the Windows Class name for the control.

    Returns: SEQUENCE: The class name string

    Category: System Attributes

    Example

          sequence lName
          lName = getClassName( fld1 )
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getHandle
    (integer controlID OR sequence {TVid, TVItemID} )

    Returns the Windows Handle of the specified control

    Returns: The control's hWnd

    Category: System Attributes

    This aborts the application if the specified id is invalid.

    This can also return the handle of a treeview item by using the syntax {tv, tvitem}

    Example

          atom hWnd, hTV
          hWnd = getHandle(myWindow)
          hTV = getHandle( {myTreeView, Itemx} )
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getHWND
    (integer controlID)

    Returns the Windows Handle of the specified control

    Returns: The control's hWnd

    Category: System Attributes

    This function is almost the same as getHandle except that it does not validate the controlID value supplied to it, and it cannot be used to get the handle of a Treeview item.
    You would use this function if you already knew that the controlID was valid and you needed a faster routine than getHandle.

    Example

          atom hWnd
          hWnd = getHWND(myWindow)
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getId
    ( object hWnd )

    Finds the control/window ID given a Window Handle.

    Returns: INTEGER: The Id corresponding to the hWnd supplied.

    Category: System Attributes

    If the supplied hWnd is invalid or not belonging to a control created by win32lib, this function will return zero.

    Note 1 this can be used to find a TreeView Item's Id from it's handle by using the syntax: id = getId( {TV, hTVI} )

    Note 2 if hWnd is the special value w32GetMainWindow, it will return the Id of the main window as used in the MainWin() routine. This is useful if you are writing an add-on library to this one.

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getIdName
    (integer controlID)

    Returns the name of a control, given it's id.

    Returns: SEQUENCE: The control's name or INTEGER: No name available.

    Category: System Attributes

    Also see: setIDName and newUIObj

    A return of "" means that the controlID was not valid.
    A return of 0 means that the controlID has no name.

    Example

          sequence name
          name = getIdName(myWindow)
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getKeyState
    (atom key)

    Gets the depressed stats of the key.

    Returns: INTEGER: w32True if the key is pressed otherwise w32False

    Category: System Attributes

    Example:

          if getKeyState( VK_NUMPAD0) then
              cmd = kStop
          elsif getKeyState( VK_NUMPAD2) then
              cmd = kDown
          elsif getKeyState( VK_NUMPAD4) then
              cmd = kLeft
          elsif getKeyState( VK_NUMPAD6) then
              cmd = kRight
          elsif getKeyState( VK_NUMPAD8) then
              cmd = kUp
          else
              cmd = 0
          end if
          processCmd(cmd)
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getMainWindow
    ()

    Gets the id of the main window for this application.

    Returns: INTEGER: ID of main window.

    Category: System Attributes

    Example

          win = getMainWindow()
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getNameId
    (sequence Name)

    Returns the id of a control, given it's name.

    Returns: SEQUENCE: The control's ID.

    Category: System Attributes

    Also see: setIdName, getIdName and newUIObj

    A return of zero indicates that the name was not found.
    If more than one control has the same name, the result is still returned but it may be any of those controls. In this case it might be better to use getNameIdInContext().

    Example

          integer id
          id = getNameId("Prime Window")
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getNameIdInContext
    (sequence Name, integer Parent)

    Returns the id of a control, given it's name and parent control.

    Returns: SEQUENCE: The control's ID.

    Category: System Attributes

    Also see: setIdName, getNameId, getIdName and newUIObj

    A return of zero indicates that the name was not found.

    Example

          integer id
          id = getNameIdInContext("AcceptButton", CustomerWindow)
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getSysColor
    ( window, color )

    Return atom with value of a system color.

    Returns: ATOM:Returns the RGB value of the specified system color.

    Category: System Attributes

    The system colors in Windows are:

  • COLOR_SCROLLBAR
  • COLOR_BACKGROUND
  • COLOR_DESKTOP
  • COLOR_ACTIVECAPTION
  • COLOR_INACTIVECAPTION
  • COLOR_MENU
  • COLOR_WINDOW
  • COLOR_WINDOWFRAME
  • COLOR_MENUTEXT
  • COLOR_WINDOWTEXT
  • COLOR_CAPTIONTEXT
  • COLOR_ACTIVEBORDER
  • COLOR_INACTIVEBORDER
  • COLOR_APPWORKSPACE
  • COLOR_HIGHLIGHT
  • COLOR_HIGHLIGHTTEXT
  • COLOR_BTNFACE
  • COLOR_BTNSHADOW
  • COLOR_GRAYTEXT
  • COLOR_BTNTEXT
  • COLOR_INACTIVECAPTIONTEXT
  • COLOR_BTNHIGHLIGHT
  • COLOR_3DDKSHADOW
  • COLOR_3DLIGHT
  • COLOR_INFOTEXT
  • COLOR_INFOBK
  • COLOR_HOTLIGHT
  • COLOR_GRADIENTACTIVECAPTION
  • COLOR_GRADIENTINACTIVECAPTION
  • COLOR_MENUHILIGHT
  • COLOR_MENUBAR

    Example:

              -- Set the window to the button color
               setWindowBackColor( MyWindow, getSysColor( COLOR_BTNFACE ) )
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getSystemMetrics
    ( object Code )

    Allows you to get miscellaneous information about the Windows system your application is running on.

    Returns: Depends on the input Code.

    Category: System Attributes

    Note that Code can be an atom for single requests or a sequence of atoms for multiple requests in one call.
    The codes and their return values are...

    SM_CYMIN
    SM_CXMIN
    SM_ARRANGE
    How the system arranges minimized windows. This consists of a starting position and a direction. The starting position can be one of the following values.
    ARW_BOTTOMLEFT Start at the lower-left corner of the screen (default position).
    ARW_BOTTOMRIGHT Start at the lower-right corner of the screen.
    ARW_HIDE Hide minimized windows by moving them off the visible area of the screen.
    ARW_TOPLEFT Start at the upper-left corner of the screen.
    ARW_TOPRIGHT Start at the upper-right corner of the screen.
    The direction in which to arrange can be one of the following values.
    ARW_DOWN Arrange vertically, top to bottom.
    ARW_LEFT Arrange horizontally, left to right.
    ARW_RIGHT Arrange horizontally, right to left.
    ARW_UP Arrange vertically, bottom to top.
    SM_CLEANBOOT
    Value that specifies how the system was started:
    0 Normal boot
    1 Fail-safe boot
    2 Fail-safe with network boot
    SM_CMOUSEBUTTONS
    Number of buttons on mouse, or zero if no mouse is installed.
    SM_CXBORDER
    Width, in pixels, of a window border. This is equivalent to the SM_CXEDGE value for windows with the 3-D look.
    SM_CYBORDER
    Height, in pixels, of a window border. This is equivalent to the SM_CXEDGE value for windows with the 3-D look.
    SM_CXCURSOR
    Width, in pixels, of a cursor.
    SM_CYCURSOR
    Height, in pixels, of a cursor.
    SM_CXDOUBLECLK
    SM_CYDOUBLECLK
    SM_CXDRAG
    SM_CYDRAG
    SM_CXEDGE
    SM_CYEDGE
    SM_CXFIXEDFRAME
    SM_CYFIXEDFRAME
    SM_CXFRAME
    SM_CYFRAME
    SM_CXFULLSCREEN
    SM_CYFULLSCREEN
    SM_CXHSCROLL
    SM_CYHSCROLL
    SM_CXHTHUMB
    SM_CXICON
    SM_CYICON
    SM_CXICONSPACING
    SM_CYICONSPACING
    SM_CXMAXIMIZED
    SM_CYMAXIMIZED
    SM_CXMAXTRACK
    SM_CYMAXTRACK
    SM_CXMENUCHECK
    SM_CYMENUCHECK
    SM_CXMENUSIZE
    SM_CYMENUSIZE
    SM_CXMINIMIZED
    SM_CYMINIMIZED
    SM_CXMINSPACING
    SM_CYMINSPACING
    SM_CXMINTRACK
    SM_CYMINTRACK
    SM_CXSCREEN
    SM_CYSCREEN
    SM_CXSIZE
    SM_CYSIZE
    SM_CXSIZEFRAME
    SM_CYSIZEFRAME
    SM_CXSMICON
    SM_CYSMICON
    SM_CXSMSIZE
    SM_CYSMSIZE
    SM_CXVSCROLL
    SM_CYVSCROLL
    SM_CYVTHUMB
    SM_CYCAPTION
    SM_CYKANJIWINDOW
    SM_CYMENU
    SM_CYSMCAPTION
    SM_DBCSENABLED
    SM_DEBUG
    SM_MENUDROPALIGNMENT
    SM_MIDEASTENABLED
    SM_MOUSEPRESENT
    SM_MOUSEWHEELPRESENT
    SM_NETWORK
    SM_PENWINDOWS
    SM_SECURE
    SM_SHOWSOUNDS
    SM_SLOWMACHINE
    SM_SWAPBUTTON

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getUserName
    ()

    Fetches the id of the currently logged in user.

    Returns: SEQUENCE: The user ID

    Category: System Attributes

    Example:

          sequence lUser
          lUser  = getUserName()
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getWinVersion
    ()

    Gets the version information of the windows platform you are running in.

    Returns: SEQUENCE: {WinVer, VariantString, BuildNo}

    Category: System Attributes

    WinVer return value can be one of ...

    VariantString is a service pack name.
    BuildNo is the operating system's build number.

    Example

          sequence winver
          winver = getWinVersion()
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    loadIconFromFile
    ( object iconfile )

    Get an icon from a file.

    Returns: ATOM: A handle to an icon

    Category: System Attributes

    iconfile is the name of an icon file. This can be a ICO, EXE, or DLL file. However, this will only fetch the first icon in that file. Some icon files can contain multiple icons. To use one of the other icons in a multi-icon file, you need to use the syntax {filename, icon#}. The icon# is the number of the icon to use. The first icon is 1, the second is 2, etc...

    Example:

          -- get the icon from a file
          hIcon = loadIconFromFile("euphoria.ico" )
    

    -- get the 3rd icon from a file hIcon = loadIconFromFile({"applib.ico", 3} )

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    manageToolTip
    ( integer pAction, integer pNewControl)

    Helps manage the ToolTip controls.

    Returns: The current tooltip control id.

    Category: System Attributes

    Use this to activate or deactivate the current tooltip control, or to just get the id of the current tooltip control.

    Set pAction to 1 to activate tooltips or 0 to deactivate them. Any other value has no effect.
    In all cases, the id of the current tooltip control is returned.

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    ScreenToClient
    (integer id, integer x, integer y)

    Converts a point on a screen to control-based coordinates.

    Returns: SEQUENCE: {ControlX, ControlY}

    Category: System Attributes

    Example

          sequence cPosn, mXY
          -- Find where the mouse is relative to the window.
          mYX = getPointerPos()
          cPosn = ScreenToClient(myWindow, mXY[1], mXY[2])
          printf(o, "Mouse is at %d, %d", {cPosn[1], cPosn[2]})
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    setAppName
    (sequence Name)

    Sets the text used as a class name prefix for new Windows.

    Returns: Zero if the same application name is not already running

    Category: System Attributes

    This needs to be run before the first Window is created in your application. The initial value is Win32Lib AppWindow

    A non-zero return code is actually the Windows hWnd value for the other instance of the application.

    Example

         if setAppName("Super Database") != 0 then
             warnErr("Application is already running")
         end if
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    setAutoFocusLabels
    (integer NewValue)

    Sets whether or not a '&' in labels set focus to subsequent edit field.

    Returns: Returns INTEGER: The current value of the flag.

    Category: System Attributes

    By default, this is set to w32False. Which means that any '&' in label captions is ignored as far as setting focus to a subsequently defined input field.
    If you set this to w32True then the '&' notation will cause focus to move to the next input field defined after the label.

    Example:

          integer lPrevFlag
          . . .
          -- Make labels focus on its input field.
          lPrevFlag = setAutoFocusLabels(w32True)
          -- The '&N' in the caption means that Alt-N will
          -- set focus to the next input field.
          lblX = create(LText, "&Name", Win, 5, 5, 40, 25, 0)
          fldX = create(Editbox, "", Win, 5, 30, 120, 25, 0)
          -- Set the flag back to whatever it was.
          lPrevFlag = setAutoFocusLabels(lPrevFlag)
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setCreateFont, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    setCreateFont
    ( sequence faceName, atom points, object attrib, atom color )

    sets the font used for controls when they are created.

    Returns: SEQUENCE: The previous values for the creation font.

    Category: System Attributes

    When controls are created, they need to have a font associated with them. By default Win32lib initially uses "ms sans serif, 8 point, Normal. You can use this function to set a different font for new controls rather than change the font after they are created.

    Example

          sequence oldFont
          -- Set a special font to use.
          oldFont = setCreateFont("Times New Roman", 14, Normal, Black)
          -- Create some controls
          fldA = create(Editbox, ...
          fldB = create(Editbox, ...
          fldC = create(List, ...
          -- Restore fot to initial one.
          VOID = setCreateFont(oldFont[1], oldFont[2], oldFont[3], oldFont[4])
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setEndAction, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    setEndAction
    (integer code)

    Sets the exit code and behaviour at application closure.

    Returns: INTEGER: Current value of the exit code

    Category: System Attributes

    This is used to signal what is to happen when the main window is closed. At that time, if the last use of setEndAction() uses a code less than zero, control returns to the application from the WinMain() call. However, a code of zero or higher causes the library to call the standard Euphoria abort() routine using the value of code.

    Example

          integer CurrentVal
          -- Set the app to end when the main window is closed.
          CurrentVal = setEndAction(0)
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setIdName, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setIdName
    (integer controlID, sequence Name)

    Sets the name of a control, given it's id.

    Category: System Attributes

    Also see: getIDName and newUIObj
    This routine ensures that only alphanumeric and '_' characters are in the name. All other characters stripped off the Name parameter.

    Example

          sequence name
          setIdName(myWindow, "Prime Window")
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setMainWindow, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    setMainWindow
    (integer New)

    Used to tell the library which window is the primary one.

    Category: System Attributes

    This is only used if you wish to change the default window that is set by calling WinMain().

    Example

          integer CurWin
          CurWin = setMainWindow( AltWindow )
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, validId, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    validId
    (object id)

    Tests to see if the specified id is a valid one.

    Returns: w32True if valid, w32False otherwise.

    Category: System Attributes

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, WinMain


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    WinMain
    ( window, style )

    Run event loop.

    Category: System Attributes

    This is the main processing loop for Win32Lib. Call WinMain after all the controls and their handlers have been defined for the initial running of the application.

    The main window is set to window. When window is closed, the application is shut down. Note that if window is -1 then the first window defined is used as the primary window.

    If you wish to have an application that has no window under the control of win32lib, but still wish to use its Windows Message loop, then set window as 0.

    The style flag is one of the following:

  • Normal: Original size.
  • Minimized: Minimized into the task bar.
  • Maximized: Fills the client area of the screen.

    The WinMain function will open the application's main window.

    It it possible to specify the control that will get the initial focus when the window opens. See openWIndow for details.

    For example:

          -- set MyWindow as main window, open normally
          -- with the initial focus on the Login button.
           WinMain( {MyWindow, btnLogin}, Normal )
    

    See Also: classAutoSelect, classDefaults, clientToClient, ClientToScreen, convPctToPixel, findWindow, getActiveWindow, getAppName, getClassName, getHandle, getHWND, getId, getIdName, getKeyState, getMainWindow, getNameId, getNameIdInContext, getSysColor, getSystemMetrics, getUserName, getWinVersion, loadIconFromFile, manageToolTip, ScreenToClient, setAppName, setAutoFocusLabels, setCreateFont, setEndAction, setIdName, setMainWindow, validId