LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1
DO
FUNCDEF("CreateSolidBrush", "32u, 32u", "gdi32")
FUNCDEF("SelectObject", "32u, 32u, 32u", "gdi32")
rect = "32u, 32u, 32u, 32u"
FUNCDEF("FillRect", ", 32u, struct RECT, 32u", "user32")
FUNCDEF("DeleteBrush", ", 32u", "gdi32", "DeleteObject")
CATCH FAILURE
CONDITION('M')
RETURN
END
color = (100 * 65536) + (175 * 256) + 150
brush = createsolidbrush(color)
guiwindowdefaults(, , 0, 'VREDRAW|HREDRAW')
guicreatewindow('NORMAL')
again:
DO FOREVER
guigetmsg()
CATCH SYNTAX
CONDITION('M')
SIGNAL again
CATCH HALT
FINALLY
guidestroywindow()
deletebrush(brush)
END
RETURN
wm_erasebkgnd:
context = ARG(1)
guigetctlplacement(guiwindow, , , 'Width', 'Height')
temp = selectobject(context, brush)
rect.1 = 0
rect.2 = 0
rect.3 = width
rect.4 = height
fillrect(context, rect, brush)
selectobject(context, temp)
RETURN 1 |