Application vs. proces

G

Guest

Hi,

I've made a program runs in the background, ie not shown on the task bar but
only with a tray icon next to the watch. If I use Alt+Tab its possible to
select the program from the list of running applications. Is it possible to
remove the program from the list of running applications?
In the task manager the first tab page lists applications and the second
lists running processes. Is it possible to make mu program a process instead
of an application?

rgds
Jesper.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

P/Invoke is the answer :)

// Api functions
[DllImport("user32.dll",EntryPoint="SetForegroundWindow")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern int SetWindowLong( IntPtr window, int index, int
value);
[DllImport("user32.dll")]
public static extern int GetWindowLong( IntPtr window, int index);

const int GWL_EXSTYLE = -20;
const int WS_EX_TOOLWINDOW = 0x00000080;
const int WS_EX_APPWINDOW = 0x00040000;

int windowStyle = GetWindowLong(Handle, GWL_EXSTYLE);
SetWindowLong(Handle, GWL_EXSTYLE, windowStyle | WS_EX_TOOLWINDOW);



cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top