1. Re: Arwen questions
- Posted by "Juergen Luethje" <j.lue at gmx.de> Feb 04, 2004
- 503 views
Derek wrote: >> -----Original Message----- >> From: Juergen Luethje >> Sent: Thursday, 29 January 2004 8:00 AM >> >> >> Hi all, >> >> can anyone please tell me, how to change the background color of a >> MultiEditText control in Arwen? >> >> ----------=----------=----------=----------=----------=------- >> include arwen.ew >> without warning >> constant DEMO = create(Window, "Test", 0, 0, >> 300,150,300,350,{0,0}) >> constant EDIT = create(MultiEditText, "Hello", 0, DEMO, 30, >> 25,230,150, {0,WS_EX_CLIENTEDGE}) >> object Void Void = c_func(xSetBkColor, {EDIT, >> c_func(xGetSysColor, {COLOR_INFOBK})}) >> WinMain(DEMO, SW_NORMAL) >> ----------=----------=----------=----------=----------=------- >> >> The code above runs without an error, but the 5th line >> doesn't have any >> effect, i.e. the background remains white. > > You need to trap the WM_CTLCOLOREDIT message and process that for the > control. This needs to call xSetBkColor and return the appropriate brush > handle to Windows. (Win32lib does this automatically for you). > > >> And how can I change the program icon? It seems, that all >> Arwen programs use a red dot with a white cross inside by default. >> I've made my own .ICO file, and want to use that icon. > > You need to load the .ICO file into RAM and get the icon's handle then send > a couple of messages to the window. Something like ... > > atom psz_icon, icon_handle > > psz_icon = allocate(length(IconFileName)+1) > poke(psz_icon, IconFileName) > poke(psz_icon+length(IconFileName)+1,0) > icon_handle = c_func(xExtractIcon, {hWnd, psz_icon, lIconNum}) > VOID = c_func(xSendMessage,{hWnd, WM_SETICON, ICON_BIG, icon_handle ) > VOID = c_func(xSendMessage,{hWnd, WM_SETICON, ICON_SMALL, icon_handle > ) > free(psz_icon) > > (Win32lib does this automatically for you). Thanks for the advice, Derek. Well, there is a brand new Arwen version, which also makes it simple to change the program icon. Regards, Juergen