| |
| Publicado el 03,febrero 2015 - 16:30 |
| I need to open a window via button click using automated procedure (as secondary thread). The opening window contains ActiveX control. When I click the button I don't see the opened window but I know it is opened because the parent window is dimmed. I created a test window w/o any controls and tried to open it as described above. It is opened. Simple question... Why window w/o controls is visible but window with ActiveX no? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 03,febrero 2015 - 16:46 |
Hi,
a secondary thread is NEVER supposed to have ANY kind of interaction with the UI... only the main thread should act on the UI, and opening a window is definitely UI related
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 03,febrero 2015 - 17:55 |
Hi Arekusei,
Make sure you use ExecuteMainThread(), as explained in length in the previous forum thread "Work with threads".
Best regards, Alexandre Leclerc |
| |
| |
| | | |
|
| | |
| |
| Publicado el 03,febrero 2015 - 23:05 |
For clarification... I have a main thread and I also need another window with displaying some other information. Imagine floating toolbox that is used for some actions but the main window is still is accesible.
P.S. Alexandre, the secondary window (thread) is a separate entity. It does not update something on calling window. It lives by its own life. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,febrero 2015 - 11:57 |
For clarification :
the UI is the UI is the UI
there is no such thing as a secondary UI
only the MAIN thread can access the UI
it doesn't matter which window
All windows are part of the UI
Best regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,febrero 2015 - 13:59 |
Quote Fabrice Harari
only the MAIN thread can access the UI Yes.
By the way I don't see where I wrote about interacting with UI. The question was why window with ActiveX control is not opened in secondary thread via Open?
I will ask in another way... directly.
Here it is a snapshot of VLC Player...
The main window and the playlist window are opened. I can easily switch between windows and do any actions regarding to active window. I believe the playlist window is opened in secondary thread otherwise the playlist woulb block the main window. So I need the same, is it possible in WinDev? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,febrero 2015 - 14:18 |
Hi Arekusi,
You're creating some confusing by speaking of opening a window in a secondary thread. What you need, based on your description is to open a child window with OpenChild()
Regards, Piet |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,febrero 2015 - 14:24 |
Hi Arekusei,
I think you misunderstood what Fabrice told you. You can't open another window from a thread, period. This is UI element and no thread can interact with the UI except the main thread. So you would have to call the open function from a procedure in the main thread from the main thread (using ExecuteMainThread).
Now with this last post we understand better what you try to do. Using a thread in such a case is not the solution (nor possible - you would need another process altogether, like Google Chrome does: every window is a process by itself and have a data exchange method between the processes, etc).
If the only thing you want are two "free" windows simply open the second window from the main thread with OpenSister() and you will have what you want. No thread required.
I hope this helps and best regards, Alexandre Leclerc |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,febrero 2015 - 14:26 |
Thank you, Piet. Your answer is a brilliance... <img src="/NG2013_WEB/ui/smiley/6.gif" align=absmiddle border=0 alt=";)">
P.S. But it is still interesting why empty window is opened in automated procedure (thread mode) and window with ActiveX no... |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,febrero 2015 - 14:32 |
Hi Piet and Arekusei,
OpenChild() if you want the second window always over the calling window, otherwise OpenSister() to have two free windows. Both functions are good, it depends the desired behaviour.
Best regards, Alexandre Leclerc |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,febrero 2015 - 14:36 |
| |
| |
| | | |
|
| | |