Another way to avoid calling app multiple times
Posted: Tue Apr 04, 2017 11:41 pm
Time passes and with it we finish maturing the ideas, the techniques employed.
The example of using wapi_CreateMutex and IsExeRunning is pretty much the same.
The only difference I see is that one is called by the function in Harbour and the other by a function in C in the HMG.
Both in my opinion are expendable for practical use.
In my opinion, it does not make sense to check if the application is already running without taking such a limited action as telling the user that the application is already running only.
IsExeRunning function in HMG IMHO can be improved by adding a optional parameter that indicates if it wants to return the handle of the window that was already running. This way we could bring forward the window by restoring and making focus, after then to close the second instance.
It can even remains minimized and use FlashWindowEx function if we so desire.
I have prepared this example by comparing 4 options for your evaluation and who knows if the idea could be improved or at least be adopted for HMG:
<Attached files was removed because there is a newest version more ahead of this same topic>
What do you think ? (Run twice each option and compare)
Could you give me your opinion, which option would be most convenient to use ?
I have already chosen: #3
The example of using wapi_CreateMutex and IsExeRunning is pretty much the same.
The only difference I see is that one is called by the function in Harbour and the other by a function in C in the HMG.
Both in my opinion are expendable for practical use.
In my opinion, it does not make sense to check if the application is already running without taking such a limited action as telling the user that the application is already running only.
IsExeRunning function in HMG IMHO can be improved by adding a optional parameter that indicates if it wants to return the handle of the window that was already running. This way we could bring forward the window by restoring and making focus, after then to close the second instance.
It can even remains minimized and use FlashWindowEx function if we so desire.
I have prepared this example by comparing 4 options for your evaluation and who knows if the idea could be improved or at least be adopted for HMG:
<Attached files was removed because there is a newest version more ahead of this same topic>
What do you think ? (Run twice each option and compare)
Could you give me your opinion, which option would be most convenient to use ?
I have already chosen: #3