473,394 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to do a Task Manager 'Switch To'?

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
Nov 20 '05 #1
2 6042
Hi Niall,

In case you're not watching the thread, there's an answer to your previous
post under the topic "Starting and Ending Processes from a program".

Regards,
Fergus
Nov 20 '05 #2
You can get the idea how to make your app not on the tast bar from MSDN:

http://msdn.microsoft.com/library/de...us/shellcc/pla
tform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp

The Shell creates a button on the taskbar whenever an application creates a
window that isn't owned. To ensure that the window button is placed on the
taskbar, create an unowned window with the WS_EX_APPWINDOW extended style.
To prevent the window button from being placed on the taskbar, create the
unowned window with the WS_EX_TOOLWINDOW extended style. As an alternative,
you can create a hidden window and make this hidden window the owner of
your visible window.

If you want to send a message to your application on the same computer, the
easiest way is to send/post a user-defined message to one window of your
application, and your application could handle this message and do what it
need to do.

Hope it will resolve your problem

Thanks
Lifeng
Microsoft VB team.

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: N M | last post by:
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...
1
by: Alice | last post by:
Hi all How can i change the status bar icon for my website Or The icon shown in user's Task Manager for the browser process fetching my website Thanks in Advance Alic
6
by: rodchar | last post by:
hey all, i'm trying to use Windows' Task Manager to kick off my win form. Am I correct to say that this is not going to work because everytime it runs I see it task manager but no window ever...
6
by: Marcus | last post by:
Hi, I am a newbie at C#. Here is my current problem: I want my application to iterate through the list of tasks presented in task manager. I want it to look at the task names and if a certain...
4
by: Strah | last post by:
Is there a way to catch the event of terminating the application from the the processes tab in task manager? I have created windows app, and if a user termintates the app in the task manager,...
1
by: nkoranda | last post by:
I have been running into an issue that I just cant figure out. I have created an ActiveX EXE and in the Project Properties I have the Thread Model set to Thread Pool = 1. If I create an instance of...
3
by: Inbox.Mirror.Orbisoft | last post by:
In the last 1-3 weeks, we have had numerous users of Task Manager 2007 (www.orbisoft.com) complain that they can no longer export certain reports (Task Manager 2007 uses a Sagekey.com Access 97...
0
by: Inbox.Mirror.Orbisoft | last post by:
In the last 1-3 weeks, we have had numerous users of Task Manager 2007 (www.orbisoft.com) complain that they can no longer export certain reports (Task Manager 2007 uses a Sagekey.com Access 97...
3
by: =?Utf-8?B?U3RldmUgQmFya2Vy?= | last post by:
Hi guys, I know this post isn't strictly related to the forum topic, but it's such a general question that I didn't know where else to post it! Feel free to suggest a more suitable alternative!...
0
by: waldihuber | last post by:
Hello, i can't find a solution to hide my C# application in task manager under application and the task switch (ALT+TAB) like Winamp and Trillian when I tell them to appear only in the tray. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.