1 | | if i use GUICtrlCreateTreeView my app start and get activate before become visible; it is a problem to start without being activated. |
| 1 | The following code steals focus from the active application even though the GUI isn't visible immediately: |
| 2 | {{{ |
| 3 | #cs ---------------------------------------------------------------------------- |
| 4 | |
| 5 | AutoIt Version: 3.3.0.0 |
| 6 | Author: TayouFabrice |
| 7 | |
| 8 | After creating a GUICtrlTreeView the GUI take focus it is a problem for an app |
| 9 | whish start on Background and dosn't want ot get focus before being visible |
| 10 | i have put sleep ( ) at line 21 to shaw that gui is not visible but has allready |
| 11 | focus. This problem is serious |
| 12 | #ce ---------------------------------------------------------------------------- |
| 13 | |
| 14 | |
| 15 | #include <GUIConstantsEx.au3> |
| 16 | #include <TreeViewConstants.au3> |
| 17 | #include <WindowsConstants.au3> |
| 18 | #Region ### START Koda GUI section ### Form= |
| 19 | $Form1 = GUICreate("Form1", 633, 447, 192, 215) |
| 20 | ConsoleWrite ( "> GUI is created but have no focus"&@CRLF) |
| 21 | Sleep ( 6000) |
| 22 | $TreeView1 = GUICtrlCreateTreeView(96, 32, 345, 273) |
| 23 | ConsoleWrite ( "> GUI has already focus"&@CRLF) |
| 24 | Sleep ( 6000) |
| 25 | GUISetState(@SW_SHOW) |
| 26 | #EndRegion ### END Koda GUI section ### |
| 27 | |
| 28 | While 1 |
| 29 | $nMsg = GUIGetMsg() |
| 30 | Switch $nMsg |
| 31 | Case $GUI_EVENT_CLOSE |
| 32 | Exit |
| 33 | |
| 34 | EndSwitch |
| 35 | WEnd |
| 36 | }}} |