My application hides its window (and hence the task bar button) and stays only in the notification area, with the following code:
Form1.Hide;
When I click on the notification icon, the window shows itself with the following code:
Form1.Show;
Application.Restore;
But I want to show the window when the second instance is executed. I can pass any data from first instance to the second using "file mapping". So far I have only managed how to show the window if it is only minimized (the task bar button exists), with this code:
if IsIconic(FirstInstanceApplicationHandle) then ShowWindow(FirstInstanceApplicationHandle, SW_RESTORE);
SetForegroundWindow(FirstInstanceApplicationHandle);
So how I make visible first instance window from the second instance?