home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
stazsoftware.com
/
www.stazsoftware.com.tar
/
www.stazsoftware.com
/
futurebasic
/
sample-code
/
BringWindowsForward.sit
/
bring_forward
next >
Wrap
Text File
|
2003-09-01
|
1KB
|
68 lines
'~'A
' Runtime : Rntm Appearance.Incl
' CPU : Carbon
' Debugger : Off
' DIM'd Vars Only : On
' No Re-DIM'd Vars : On
' CALL Req'd : Off
' Register Vars : On
' MacsBug Labels : On
' Ary Bounds Checking : Off
' QB Labels : Off
' Optimize STR# : On
' Make Line Start Table : Off
' Show Warnings : On
'~'B
/*
this example show how to bring all of an application's window's to the
front at one time. to test it, send the application to the background,
bring another layer over it, then try to bring only one of the
windows to the foreground.
*/
local fn bringAllWindowsForward
'~'9
dim psn as ProcessSerialNumber
dim err as OSErr
beep
long if fn GetCurrentProcess( psn ) = _noErr
err = fn SetFrontProcess( psn )
end if
end fn
local fn handleDialog
'~'9
dim action as long
dim reference as long
action = dialog( 0 )
reference = dialog( action )
select action
case _mfevent
select reference
case _mfresume
fn bringAllWindowsForward
end select
end select
end fn
window 1
window 2
on dialog fn handleDialog
do
handleEvents
until 0