473,388 Members | 1,496 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,388 software developers and data experts.

Global application interrupt

I need the way to interrupt (freeze) ANY program currenlty running at the
computer, then to activate the application and return the previous
applications state after my application execution. Is any way to do it
managed?

TNX

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
Nov 16 '05 #1
7 1544
"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in
news:uZ**************@TK2MSFTNGP09.phx.gbl...
I need the way to interrupt (freeze) ANY program currenlty running at the
computer, then to activate the application and return the previous
applications state after my application execution. Is any way to do it
managed?


What exactly does "freeze" mean to you?
You could probably set your thread priority to highest or realtime, that way
the thread scheduler shouldn't allocate any time slices to other threads as
long as your one is busy. However, I somehow doubt this is a good idea...

What are you trying to acchieve? Why isn't it enough to make your
application topmost?

Niki
Nov 16 '05 #2
I have to run my application ANYWAY, by interrupting (pausing) anything
running currently on the computer. EG. The user playing game. The
application should popup and leave ne option to using, but do anything in
the application. After this will be done the game previously player will be
resumed.

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

"Niki Estner" <ni*********@cube.net> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in
news:uZ**************@TK2MSFTNGP09.phx.gbl...
I need the way to interrupt (freeze) ANY program currenlty running at the
computer, then to activate the application and return the previous
applications state after my application execution. Is any way to do it
managed?


What exactly does "freeze" mean to you?
You could probably set your thread priority to highest or realtime, that
way the thread scheduler shouldn't allocate any time slices to other
threads as long as your one is busy. However, I somehow doubt this is a
good idea...

What are you trying to acchieve? Why isn't it enough to make your
application topmost?

Niki

Nov 16 '05 #3
"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in
news:%2****************@tk2msftngp13.phx.gbl...
I have to run my application ANYWAY, by interrupting (pausing) anything
running currently on the computer. EG. The user playing game. The
Windows is a multitasking OS, so your application *will* run anyway. Why do
you have to interrupt other applications, and how are you going to find out
what applications to interrupt? Interrupting anything (including system
services) will likely cause the PC to crash.
application should popup and leave ne option to using, but do anything in
the application. After this will be done the game previously player will
be resumed.


I doubt you'll have much luck with that: There's no way to prevent the
CTRL-ALT-DEL combination, and using task manager the user will be able to
close your app.

What are you writing? A virus? I doubt users would like what you're
planing...

Niki
Nov 16 '05 #4
Let's say anything other then Windows Services . Applications the user
currently running in his username account

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

"Niki Estner" <ni*********@cube.net> wrote in message
news:u6*************@TK2MSFTNGP11.phx.gbl...
"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in
news:%2****************@tk2msftngp13.phx.gbl...
I have to run my application ANYWAY, by interrupting (pausing) anything
running currently on the computer. EG. The user playing game. The


Windows is a multitasking OS, so your application *will* run anyway. Why
do you have to interrupt other applications, and how are you going to find
out what applications to interrupt? Interrupting anything (including
system services) will likely cause the PC to crash.
application should popup and leave ne option to using, but do anything in
the application. After this will be done the game previously player will
be resumed.


I doubt you'll have much luck with that: There's no way to prevent the
CTRL-ALT-DEL combination, and using task manager the user will be able to
close your app.

What are you writing? A virus? I doubt users would like what you're
planing...

Niki

Nov 16 '05 #5
"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in
news:%2****************@TK2MSFTNGP11.phx.gbl...
Let's say anything other then Windows Services . Applications the user
currently running in his username account
You should be able to enumerate all processes using WMI, and suspend all
threads in these processes.

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

"Niki Estner" <ni*********@cube.net> wrote in message
news:u6*************@TK2MSFTNGP11.phx.gbl...
"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in
news:%2****************@tk2msftngp13.phx.gbl...
I have to run my application ANYWAY, by interrupting (pausing) anything
running currently on the computer. EG. The user playing game. The


Windows is a multitasking OS, so your application *will* run anyway. Why
do you have to interrupt other applications, and how are you going to
find out what applications to interrupt? Interrupting anything (including
system services) will likely cause the PC to crash.
application should popup and leave ne option to using, but do anything
in the application. After this will be done the game previously player
will be resumed.


I doubt you'll have much luck with that: There's no way to prevent the
CTRL-ALT-DEL combination, and using task manager the user will be able to
close your app.

What are you writing? A virus? I doubt users would like what you're
planing...

Niki


Nov 16 '05 #6
I'd using WMI in a couple of projects and notice about real differences
between OSes. Are there any other way?

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

"Niki Estner" <ni*********@cube.net> wrote in message
news:eW**************@TK2MSFTNGP12.phx.gbl...
"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in
news:%2****************@TK2MSFTNGP11.phx.gbl...
Let's say anything other then Windows Services . Applications the user
currently running in his username account


You should be able to enumerate all processes using WMI, and suspend all
threads in these processes.

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

"Niki Estner" <ni*********@cube.net> wrote in message
news:u6*************@TK2MSFTNGP11.phx.gbl...
"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in
news:%2****************@tk2msftngp13.phx.gbl...
I have to run my application ANYWAY, by interrupting (pausing) anything
running currently on the computer. EG. The user playing game. The

Windows is a multitasking OS, so your application *will* run anyway. Why
do you have to interrupt other applications, and how are you going to
find out what applications to interrupt? Interrupting anything
(including system services) will likely cause the PC to crash.

application should popup and leave ne option to using, but do anything
in the application. After this will be done the game previously player
will be resumed.

I doubt you'll have much luck with that: There's no way to prevent the
CTRL-ALT-DEL combination, and using task manager the user will be able
to close your app.

What are you writing? A virus? I doubt users would like what you're
planing...

Niki



Nov 16 '05 #7

"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:uU**************@tk2msftngp13.phx.gbl...
I'd using WMI in a couple of projects and notice about real differences
between OSes. Are there any other way?


There is no direct way to do this using Managed code nor WMI (well, you can
get a list of processes and threads using WMI), your only option is to use
unmanaged code, provided you have the necessary privileges to control other
processes/threads, here's what you have to do:
1. (Using WMI) Get a list of processes you need to suspend.
2. (Using WMI) For each in 1, get associated thread ID's.
3. Get thread handle from threadID by caling Win32 API OpenThread.
3. Call Win32 API SuspendThread using the thread handles from 2
4. Do your thing....
5. Call Win32 API ResumeThread using the same thread handles as in 3.

Willy.

Nov 16 '05 #8

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

Similar topics

35
by: whisper | last post by:
My question is whether it is better to use a global variable to hold a dynamically malloced multidim array or pass around pointers to it. The details are below (forgive the long winded explanation)...
2
by: bvermeersch | last post by:
Hi, Here I am again, just learning C# and always wanting to learn the hard things first. As you might already know from other posts I'm trying to convert c++ code to C#. The problem I'm...
6
by: fd123456 | last post by:
Er... Sorry to interrupt, but you CAN put methods and functions in the Global.asax file. You just have to make them static (Shared in VB). You can even use functions normally not available outside...
2
by: Alison | last post by:
Hi, All, I have a vb .net program that starts a process in the background and I wondered whether it is possible to pass Ctrl+C to interrupt (not to kill) the background process. I know the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.