SYSTEM
Bring an application to the foreground
Go talk to the Process Manager. FN GETFRONTPROCESS will get you the ProcessSerialNumber for the currently frontmost process. FN SETFRONTPROCESS notes that a process is to be brought to the front, and switches it on the next event.
Using these two functions you can rearrange the app list to your satisfaction.
Try this
LOCAL MODE
LOCAL FN SetFrontProcess (@psnPtr&)
DIM osErr%
`
` SUBQ.L #2,sp ;clear space for osErr
` MOVE.L ^psnPtr&,-(sp) ;push psn ptr on stack
` DC.W $3F3C,$003B,$A88F ;trap number
` MOVE.W (sp)+,^osErr% ;D0 = osErr
END FN = osErr%
This is an extract from a screen saver I wrote some time ago. If you want the whole source then email me directly.
|