N
N M
Hi all,
I've been scratching my head (to the bone) try to find a way of
switching from one .Net application to another. ie. I click a button
on a controller application and the other one is brought to the front.
I even have a Process object pointing to the application I want to
activate, but I can't seem to find any way of using this.
The purpose of the controller application is to provide a single
interface to launch/terminate/switch to a suite of programs without
having loads of applications in either the task bar or the system
tray.
Herein lies the problem. In order to hide the application when it is
minimised, I have to either sets its ShowInTaskBar property to false
or just hide it. The trouble is, when you do this you lose the handle
as there isn't a window anymore. I tried using the API calls
(ShowWindow or SetForegroundWindow) using the Process.MainWindowHandle
property, but as I mentioned it's set to 0 when the form is hidden.
Does anyone have any ideas how to proceed with this? The only other
way I thought of doing this was to send a message directly to the
hidden application telling it to make itself visible and restore its
window position. Now comes the second problem...how do I do this? I
don't want to get into sockets, etc. as it is all local to the one
machine. Message queues would be another alternative, but I'd prefer
to use something that doesn't have to be installed separately to a
standard framework installation.
There is a fair chance I'm missing something pretty obvious here, but
please...feel free to point it out.
Thanks in advance,
Neill.
______________________________________________
WORK: N M @ R C S S o f t w a r e . c o . u k
HOME: n e i l l . i m m o r t a l @ B T I n t e r n e t . c o m
WEB: www.neill.immortal.btinternet.com
I've been scratching my head (to the bone) try to find a way of
switching from one .Net application to another. ie. I click a button
on a controller application and the other one is brought to the front.
I even have a Process object pointing to the application I want to
activate, but I can't seem to find any way of using this.
The purpose of the controller application is to provide a single
interface to launch/terminate/switch to a suite of programs without
having loads of applications in either the task bar or the system
tray.
Herein lies the problem. In order to hide the application when it is
minimised, I have to either sets its ShowInTaskBar property to false
or just hide it. The trouble is, when you do this you lose the handle
as there isn't a window anymore. I tried using the API calls
(ShowWindow or SetForegroundWindow) using the Process.MainWindowHandle
property, but as I mentioned it's set to 0 when the form is hidden.
Does anyone have any ideas how to proceed with this? The only other
way I thought of doing this was to send a message directly to the
hidden application telling it to make itself visible and restore its
window position. Now comes the second problem...how do I do this? I
don't want to get into sockets, etc. as it is all local to the one
machine. Message queues would be another alternative, but I'd prefer
to use something that doesn't have to be installed separately to a
standard framework installation.
There is a fair chance I'm missing something pretty obvious here, but
please...feel free to point it out.
Thanks in advance,
Neill.
______________________________________________
WORK: N M @ R C S S o f t w a r e . c o . u k
HOME: n e i l l . i m m o r t a l @ B T I n t e r n e t . c o m
WEB: www.neill.immortal.btinternet.com