[futurebasic] Re: [FB] Getting window number from window pointer

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2002 : Group Archive : Group : All Groups

From: Alain Pastor <pixmix@...>
Date: Thu, 26 Sep 2002 20:59:44 +0200

Brian Stevens wrote:
> The following code appears to successfully walk the window list and 
> retrieves the pointer for all open windows, but the call to 
> FBGetWndNumber always returns zero (which normally indicates the window 
> is not an FB window). Same results with APPEARANCE WINDOW statement and 
> using std basic or appearance runtime. R7. OS 9.1 Clues appreciated.
> Thanks....Brian

Your code seems to work for me on Mac OS 9.2.2 FR with R7

WINDOW 1
/*
EDIT FIELD 1,"test text 1",(  13,  35)-( 195, 139), 4,_leftJust
EDIT FIELD 2,"test text 2",(   7,   3)-( 200,  23), 7,_centerJust
*/

window 2
/*
EDIT FIELD 1,"test text 3",(  13,  35)-( 195, 139), 4,_leftJust
EDIT FIELD 2,"test text 4",(   7,   3)-( 200,  23), 7,_centerJust
*/

local mode
local fn looklist
dim wPtr as WindowRef
dim wnum as long

wPtr   = fn frontwindow
while wPtr
wnum = FN FBGetWndNumber(wPtr)
#if carbonlib
wPtr = fn GetNextWindow(wPtr)
#else
wPtr = wPtr.NextWindow&// Next Window in list
#endif
print wnum
wend
end fn

fn looklist

do

handleevents
until gFBquit

-- 
Cheers,

A. Pastor
Pix & Mix
9, rue Pierre Curie
95360 Montmagny - France
Tel.: +33 1 34 17 90 15
Fax : +33 1 39 84 36 61