Robert Purves wrote: > > On Tuesday, September 23, 2003, Bernie Wylde wrote: > >> After creating a window, is it possible to change that window's id >> without closing it and re-building it from scratch with the new id? > > > > > // requires Appearance runtime > local mode > local fn ChangeWndID( oldWndID as long, newWndID as long ) > '~'1 > dim wRefCon as ^^FBwindowDescription > dim as WindowRef @ wRef > > get window oldWndID, wRef > if ( wRef ) then wRefCon = fn GetWRefCon( wRef ) > if ( wRefCon) then wRefCon..FBwRef = newWndID > end fn > > > window 1, "The First Window" > fn ChangeWndID( 1, 2 ) > window 1, "Another Window" > window 2 > > do > HandleEvents > until 0 > It should be safer to use _clear_ local mode above because wRefCon might end up holding a random value. Alain