M
Matt
Hi
I have an app that runs without a main form, just a notification icon, when
the user clicks the icon the form is shown, and when the form is minimized
it's hidden.
This all works great, and I have implemented single instance so that when
another instance is run, an event gets signalled in the 1st instance, and
what I would like to do is to show the form. I can do this using Form.Invoke
to show the form in most cases, however at startup of my app the form isn't
shown and if the user runs the app again, I can't use Form.Invoke as there
isn't a valid window handle.
How can I call my code to show the form in the context of the UI thread? If
I call Form.Show from the thread that is waiting on the event (which is from
the threadpool) the form doesn't show properly and all hell breaks loose
Thanks in advance!
Matt
I have an app that runs without a main form, just a notification icon, when
the user clicks the icon the form is shown, and when the form is minimized
it's hidden.
This all works great, and I have implemented single instance so that when
another instance is run, an event gets signalled in the 1st instance, and
what I would like to do is to show the form. I can do this using Form.Invoke
to show the form in most cases, however at startup of my app the form isn't
shown and if the user runs the app again, I can't use Form.Invoke as there
isn't a valid window handle.
How can I call my code to show the form in the context of the UI thread? If
I call Form.Show from the thread that is waiting on the event (which is from
the threadpool) the form doesn't show properly and all hell breaks loose
Thanks in advance!
Matt