Silverfrost Logo About Us | Contact Us

Using the handle of a resource

ClearWin+ controls that take the name of a bitmap, icon, or cursor resource, can be given a string consisting of a decimal integer enclosed in curly brackets (with no embedded spaces), for example {21542}. The number should be the decimal value of a Windows handle to an object of the appropriate type. If the handle is invalid the results will be unpredictable.

For example:

CHARACTER*32 icon(32),handle
WRITE(handle,'(i10.10)') make_icon@(icon)

For %bm, %ic, %mi, %cu, and %dc it is easier to use a grave accent, supplying the handle as an integer argument. However, the above technique is useful for other format codes (e.g. %bi, %ti, %tb, %tv) and when format strings must be constructed dynamically under program control.



Copyright © 1999-2017 Silverfrost Limited