Path: utzoo!attcan!uunet!mcsun!hp4nl!gouldnl!colin@gouldnl.encore.nl From: colin@gouldnl.encore.nl (Colin Smale) Newsgroups: comp.sys.acorn Subject: Re: Changing window titles Keywords: windows riscos arc title bar Message-ID: <12899@gouldnl.encore.nl> Date: 31 Jan 91 11:53:44 GMT References: <6482@ecs.soton.ac.uk> Sender: Colin Smale Organization: Encore Computer BV, Maarssenbroek, Holland Lines: 21 In <6482@ecs.soton.ac.uk> rhh88@ecs.soton.ac.uk (Heywood RH) writes: >I have a problem. I need to change the title of a window at quite >regular periods but whatever I seem to do the title remains unchanged. >I have tried changing the indirected pointer to the title to a new >message and then reopening the window but it does not seem to work. > I have do a tempary bodge job of the problem so I can get the rest of >the program done that involves creating a new window with the correct >title, opening that and deleteing the old window (YUUUKKKKKKKK!!!!!) The neatest way of doing it is to force a redraw of the title bar. This can be accomplished by using Wimp_GetWindowOutline (???) to get the overall outline of the window (including title bar etc), Wimp_GetWindowState to get the visible work area coordinates and calling Wimp_ForceRedraw with physical screen coordinates (window handle=-1) using the x-coordinates from either call above, ymin=top of visible work area and ymax=top of window outline. Alternatively you can cheat a bit by knowing that the title bar is always a constant height (64?). This works at least for the case of changing the CONTENTS of the window title buffer; you are actually changing the buffer address itself. Try allocating a static buffer for the title and copying into it.