how to make you app active when it is not?

So here I go my first MAC question, please excuse me if I don’t use the correct terminology

I have an app which uses a timer to check the mouse position, if the mouse is up the very top of the screen and the mouse button is down then it should show a window.

Now this works fine on a PC and will work fine once the user selected the app from the dock on a MAC , however, how can you make your app the active app from within your program
When the timer fires I can check everything and insert a break point to double check that the mouse is in the correct arrea so I know the program is trying to show the window, it just never makes it to the screen.

I have tried

window1.show
window1.visible = true
window1.setfocus

none do the trick.
The window will show as soon as the user clicks on the app icon “in the dock” , however I want the window to show even if they are in the “Finder” or another app.

Thanks
Damon

if anyone ever finds this the answer is a lot of trial and error.

The window has to be a “Metal Window” , pops straight up :slight_smile:

[code] declare function NSClassFromString lib “Cocoa” ( className as CFstringRef ) as Ptr
declare function sharedApplication lib “Cocoa” selector “sharedApplication” ( classRef as Ptr ) as Ptr
Dim appRef as Ptr = sharedApplication( NSClassFromString( “NSApplication” ) )

declare sub activateIgnoringOtherApps lib “Cocoa” selector “activateIgnoringOtherApps:” ( appRef as Ptr, flag as boolean )
activateIgnoringOtherApps( appRef, ignoreOtherApps )[/code]

Written in the forum, so I haven’t tested the code.

app.FrontmostMBS = True
if you have our plugins in use.

thanks guys