home *** CD-ROM | disk | FTP | other *** search
/ stazsoftware.com / www.stazsoftware.com.tar / www.stazsoftware.com / futurebasic / sample-code / BringWindowsForward.sit / bring_forward next >
Text File  |  2003-09-01  |  1KB  |  68 lines

  1.  
  2. '~'A
  3. '                       Runtime : Rntm Appearance.Incl
  4. '                           CPU : Carbon
  5. '                      Debugger : Off
  6. '               DIM'd Vars Only : On
  7. '              No Re-DIM'd Vars : On
  8. '                    CALL Req'd : Off
  9. '                 Register Vars : On
  10. '                MacsBug Labels : On
  11. '           Ary Bounds Checking : Off
  12. '                     QB Labels : Off
  13. '                 Optimize STR# : On
  14. '         Make Line Start Table : Off
  15. '                 Show Warnings : On
  16. '~'B
  17.  
  18. /*
  19.  
  20.      this example show how to bring all of an application's window's to the
  21.      front at one time. to test it, send the application to the background,
  22.      bring another layer over it, then try to bring only one of the 
  23.      windows to the foreground.
  24.  
  25. */
  26.  
  27.  
  28. local fn bringAllWindowsForward
  29. '~'9
  30. dim psn as ProcessSerialNumber
  31. dim err as OSErr
  32. beep
  33.  
  34. long if fn GetCurrentProcess( psn ) = _noErr
  35. err = fn SetFrontProcess( psn )
  36. end if
  37. end fn
  38.  
  39.  
  40. local fn handleDialog
  41. '~'9
  42. dim action as long
  43. dim reference as long
  44.  
  45. action    = dialog( 0 )
  46. reference = dialog( action )
  47.  
  48. select action
  49. case _mfevent
  50. select reference
  51. case _mfresume
  52. fn bringAllWindowsForward
  53. end select
  54. end select
  55.  
  56. end fn
  57.  
  58.  
  59.  
  60. window 1
  61. window 2
  62.  
  63. on dialog fn handleDialog
  64.  
  65. do
  66. handleEvents
  67. until 0
  68.