Jump to content

__IELockSetForegroundWindow($nLockCode) Not working for Forms


Recommended Posts

Ok, I've tried to get __IELockSetForegroundWindow($nLockCode) (an internal routine in ie.au3) that is meant to lock the active window so a new window does not steal the focus.

I tested it with a MSGBOX and it works as advertised, even though it seems to return a code 0, which means it failed. Not sure what that's about. The MSGBoX appears but the current focus stays put.

But when I tried this on a form created with GUICreate, the form grabs the focus despite a call to the locking routine.

Has anyone dealt with this issue, I'd like the form to popup , but not steal the focus from whatever app has it.

Link to comment
Share on other sites

From MSDN: LockForegroundWindow

The system automatically enables calls to SetForegroundWindow if the user presses the ALT key or takes some action that causes the system itself to change the foreground window (for example, clicking a background window).


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...