Hi dudes. Many thanks esp Aaron re the forms thingy. Well, it wasnt fixed as
I thought at first, so thanks Aaron for that additional info - my training
in Delphi has been very informal so it is refreshing to get that stuff.

Now, as for the parameter passing I found quite a nice unit which not only
checks for oneinstance, but also can pass messages to the first/second
instance.
The code uses API calls and was originally like this in the guts of it:
    MyPopup := GetLastActivePopup(LastFound);
    SendParam(MyPopup);                                //new
    BringWindowToTop(LastFound);
    if IsIconic(MyPopup)
      then ShowWindow(MyPopup, SW_RESTORE)
      else SetForegroundWindow(MyPopup);
    Halt;

But if the app was minized it failed to pass the message as the handle was
wrong so I changed it to take minized forms as well.
However (nothing aint bloody easy in this world, esp when you are not
getting paid for it) the enumwindows function, only looks at visible, or
minized windows, and cant do the system tray (bugger it) so any takers on
how to check out the system tray for myapp handle??
BTW the unit is on the Delphi Super page as maininst.zip

Alistair Grant George
mailto:[EMAIL PROTECTED]
Products:
http://v-share.com/~v_bigal/


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to