I have a window where I paint the background a custom color. When I use the guisay popup window, the background color of my window turns to gray as i move the guisay window around. When the guisay window if closed, my background is grayed and is not redrawn. It's as if it is getting erased but not repainted.
My scripts contains the following:
DO /* Define functions for paining windows */ 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")
/* Register GetStockObject so we can grab one of the preset brushes for drawing text. */ FUNCDEF("GetStockObject", "void, 32u", "gdi32")
/* Register SetBkColor so we can change the background color for text. */ FUNCDEF("SetBkColor", "32u, void, 32u", "gdi32")
/* Register SetTextColor so we can change the foreground color for text. */ FUNCDEF("SetTextColor", "32u, void, 32u", "gdi32")
/* Register Paint so I can show my pretty logos */ paintstruct = "32u, 32u, 32, 32, 32, 32, 32u, 32u, char[32]" FUNCDEF("BeginPaint", "32u, void, struct PAINTSTRUCT stor", "user32") FUNCDEF("EndPaint", "32, void, struct PAINTSTRUCT", "user32")
CATCH FAILURE
CONDITION("M") RETURN END
...
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
/* Called when the window needs to be redrawn. */ WM_PAINT: /* Erase the background and get a device context */ hdc = BeginPaint(GuiWindow, ps)
DO
/* Draw the picture object at an XY position of (136, 38) */ IF EXISTS("PicObject") THEN GuiPicture("PicObject", hdc, 400,15)
FINALLY /* End paint */ EndPaint(GuiWindow, ps) END
/* Don't let Rexx Gui process this event. */ RETURN ""Chuck Simmons |