Sign in to follow this  
Followers 0
Holger

problem with focus on GUI

2 posts in this topic

So I don't know if anybody read this, so here are some deatils:

http://www.autoitscript.com/forum/index.php?showtopic=3447

The Problem is that the GUI doesn't get the focus 'right'.

So I tested it with the changing of the lines in the Show()-function of the GUI-part to this:

// we need to show the GUI
SetForegroundWindow(m_hWndGUI);
ShowWindow(m_hWndGUI, SW_SHOW);

What I found in the guibox.cpp was confusing me:

// we need to show the GUI
ShowWindow(m_hWndGUI, SW_SHOW);
ShowWindow(m_hWndGUI, SW_SHOW);

So maybe there was overwritten a command!?

But I tested it with the changed lines and the GUI now also has the focus on the taskbar...

What do you think? :D

Share this post


Link to post
Share on other sites



The main autoit window is minimized and hidden and this seems to be causing some strangeness (the GUI is a child window).

I've just tried this and it seems to work:

SetForegroundWindow(m_hWndGUI);      // Seems to make the taskbar entry for the GUI active
  ShowWindow(m_hWndGUI, SW_SHOW);    // Show the window
  g_oSetForeWinEx.Activate(m_hWndGUI);  // After showing the GUI WinActive() to make sure it is active

SetForegroundWindow() is unreliable under 2000/XP so the WinActivate() version is used.

The double ShowWindow() lines were just a previous attempt to fix the problem based on some notes in the ShowWindow docs (the first call may be ignored) - but it didn't work.

Share this post


Link to post
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
Sign in to follow this  
Followers 0