Holger Posted August 23, 2004 Share Posted August 23, 2004 Here is a part of the GUI-init:void CGuiBox::Init(HINSTANCE hInstance, HWND hWndParent) { // Store the instance (rather than using a global) m_hInstance = hInstance; m_hWndParent = hWndParent;Now my question:Where does the parameter hWndParent come from?Yeah, you know, I'm asking myself so long why the gui starts not set active in the taskbar!?So I tested changing the line in CreateGUI:A = CreateWindowEx(Exstyle,AUT_GUICLASS,Caption,Style,X,Y,rect.right-rect.left,rect.bottom-rect.top,m_hWndParent,NULL,m_hInstance,NULL);toA = CreateWindowEx(Exstyle,AUT_GUICLASS,Caption,Style,X,Y,rect.right-rect.left,rect.bottom-rect.top,NULL,NULL,m_hInstance,NULL);and the result was that the focus now works right.Can anybody tell me for what the hWndParent is and why it is not defined?I think at the moment it is undefined.Or is there something again that I don't understand?Thanks and regardsHolger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
Valik Posted August 24, 2004 Share Posted August 24, 2004 The parent is AutoIt's window, I think (The hidden one). If a window doesn't have a parent, it can NEVER be removed from the taskbar (Except when the window is hidden via SW_HIDE). There are times where it is useful to have a visible window, but not one with a taskbar entry, thus, it's necessary that the GUI have a parent. Link to comment Share on other sites More sharing options...
Holger Posted August 24, 2004 Author Share Posted August 24, 2004 (edited) Yeah, it could maybe the hidden main-autoit-window cause I saw a call to this with the parameter "g_hWnd".That is confusing...without this there is no problem and with the focus is not working. I know there was a problem in the past with this hidden window but I can't find/ don't know anything more about this.Maybe it could be possible to give the focus from the parent-window to the child window automatically...I don't know...really confusing Thanks for your answer valik Edit: I read that if the parent window is set to "NULL" then the desktop window becomes the new parent window!I think thatswhy it works with NULL and interacts normally with the "desktop"-taskbar Hmmm....Or what if we use in CreateGUI():if (Exstyle & WS_EX_APPWINDOW) A = CreateWindowEx(Exstyle,AUT_GUICLASS,Caption,Style,X,Y,rect.right-rect.left,rect.bottom-rect.top,NULL,NULL,m_hInstance,NULL); else A = CreateWindowEx(Exstyle,AUT_GUICLASS,Caption,Style,X,Y,rect.right-rect.left,rect.bottom-rect.top,m_hWndParent,NULL,m_hInstance,NULL);What interesting is (in the current unstable version too):cause the mainwindow is normally hidden, if you minimize all desktop windows then sometimes the GUI will disappear when you click on the free desktop - I think it will 'move' to the hidden mainwindow (with "GUITaskbarEntry" set to "0")... Edited August 24, 2004 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
Administrators Jon Posted August 24, 2004 Administrators Share Posted August 24, 2004 (edited) It's important for the cleanup code that the gui is a child of g_hWnd so that when DestroyWindow is called on AutoIt it's children are destroyed first. The hidden main window causes loads of problems. I used to have it minimized but then it pops up at odd times. Currently it is simply hidden. Try disabling it too so that it can't have focus (even hidden windows can have focus...) Edited August 24, 2004 by Jon Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now