video of my test
Looking the video you will see an application running, and several windows.
You do not know that it is multithread, if I do not talk about it.
All working ok, except last window closed.
And EXE running gtwvg, hmg extended and hwgui.
This is a test only.
With the single change on this post, multithread focus was solved.
Change resource too, to be for each thread, change STATIC aResources to THREAD STATIC aResources
I do not have knowledge to know if there is needed more changes, it is a test only.
At momment, last needed change is about do not close application when close first window on thread.
I do not know how to do that.
As I said before, I have few knowledge about windows API, and no knowledge about C language.
But I can contribute with "let's change it and see what happens" test.
I've been using multithread in my application for a few years, and I base my tests on situations i've encountered before.
Wheter it's right or wrong, I can't say, but it has worked.
I began to use multithread with gtwvg, to have several windows, and to open dbf in separate threads without needing any extra control over aliases, indexes, order, filter, this is very useful when working with dbf and multiple windows.
And GUI is this: multiple windows, why not multithread?
Maybe a heavy application becames light if each thread takes care of part of application.
Maybe multithread is like open source.
Main thread do not needs to make all job alone, when threads can help main thread.
José M. C. Quintas