Small and usefull patch (especially for Pocket PC where
almost every application is a single-instance).
It just adds a necessary API and hello application
could be:
int SmartWinMain( Application & app )
{
HelloWinClass * testHello = new HelloWinClass;
if( !Application::IsAppAlreadyRunning() )
{
testHello->initAndCreate();
return app.run();
}
else
{
testHello->ActivatePreviousInstance();
return 0;
}
}
Quite easy to understand and it is flexible too.
Please feel free to include to 2.0 version.
Logged In: YES
user_id=868615
This is really great Dmitry! :)
In fact a couple of weeks ago my collegue asked me if we
could include this type of functionality in our Pocket PC
client since sometimes you run the risc of hiding the main
window without any other ways to "showing" it then going to
running programs and choose activate.
This made people often without realizing it fire up a second
instance of our application...
This will go directly into not only the CVS but also as a
feature in my Pocet PC application in my "commercial" life! :)
.t
Logged In: YES
user_id=868615
Howdy, I think you forgot to sen in the diff for the
Application.cpp...??
.t
Logged In: YES
user_id=134416
Oh, I forgot to include all the patch, so here is a new one.
Thanks, it is great to hear that this patch will be in smartwin.