IUP/Windows - características

IUP - Portable User Interface

Win32 Driver 

This driver was designed for the modern Microsoft Windows in 32 bits (98/2000/XP).

Environment Variables


When this variable is set, IUP generates a message indicating the driver's version when initializing.

Exclusive Attributes

HINSTANCE (global)

This attribute returns a handle (HINSTANCE) that identifies the application in the native system. It is a verification-only attribute.


Return respectively a text with a description of the system language.


Stores the name of the default font used in the interface controls.

SHIFTKEY (global)

Returns the state of the Shit keys (left and right). Possible values: "ON" or "OFF".


Returns the state of the Control keys (left and right). Possible values: "ON" or "OFF".


This attribute is still used to maintain compatibility with previous versions. Use attribute FONT.

This attribute's value must be a string with the following format:


name: The name the user will see (Times New Roman, MS Sans Serif, etc.).
attributes: Can be empty, or a list separated by commas with the following names: BOLD ITALIC UNDERLINE STRIKEOUT
size: Size in pixels


"Times New Roman::10"
"Ms Sans Serif:ITALIC:20"
"Courier New:BOLD,STRIKEOUT:15"

Differentiated Attributes


This attribute's value must be a string with the name of a Iup image or an icon in a Windows resource file linked to the application. This icon will be used when the dialog is minimized.

If a Iup image with a name associated to this attribute exists, it will be used to define the dialog's icon. The Iup images used as icons must necessarily have 32x32 points. If there is no Iup image whose name was passed to the attribute, Iup will look for a native icon (Windows) linked to the program.


This attribute returns a handle (HWND) that identifies the window in the native system. It is a verification-only attribute, only available after the control is mapped.

Exclusive Callbacks


Callback called when a file is "dragged" to the application. When several files are dragged, the callback is called several times, once for each file. The callback must return IUP_DEFAULT to be called again for each of the dragged files. Returning IUP_IGNORE, the process is interrupted.

int function(Ihandle *self, char* filename, int numFile, int posx, int posy)

self: Indicator of the element that received the file drop.
filename: Name of the dragged file.
numFile: Number of the dragged file. If several files are dragged, numFile counts the number of dragged files up to zero.
posx: X coordinate of the point where the user released the mouse button.
posy: Y coordinate of the point where the user released the mouse button.

Note: The callback must be set before the element is mapped.

Generating Applications

To link applications, libraries iup.lib, ole32.lib and comctl32.lib (the last two provided with the compilers) must be added.

The iup.rc resource file must be included in the application's project/makefile so that HAND, IUP, PEN and SPLITH cursors can be used.


To use DLL, it is necessary to link the application with the IUP.lib and IUPSTUB.lib libraries (for technical reasons, these libraries cannot be unified). Note that IUP.lib is a library specially generated to work with iup.dll, and is usually distributed in the same directory as iup.dll. the IUP DLL depends on the MSVCRT.DLL, that it is already installed in Windows.

For the program to work, IUP.dll must be inside a PATH directory. Usually the program does not need to be relinked when the DLL is updated.

Debug Versions 

While using the debug version, two types of fatal errors can occur:

1) Protection errors: "Unhandled exception: access violation"
2) Assertive errors: "Assertion failed!"

In the second type, a dialog is shown with buttons Abort, Retry and Ignore, as well as a number of information, among which:

+ Name of the font file where the error occurred
+ Line number

The bug-correction process (if it exists) becomes a lot faster when this information is provided. Therefore, if you receive such error, please send this information along in the e-mail.


  • On Windows a common error occurs: "Cannot find function InitCommonCtrl()" This error occurs if you forgot to add the comctl32.lib library to be linked with the program. This library is not usually in the libraries list for the Visual C++, you must add it.