Click here to Skip to main content
15,913,486 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVisual Studio 2005 application deployment Pin
bigdenny20010-Feb-07 14:28
bigdenny20010-Feb-07 14:28 
AnswerRe: Visual Studio 2005 application deployment Pin
Christian Graus10-Feb-07 14:49
protectorChristian Graus10-Feb-07 14:49 
AnswerRe: Visual Studio 2005 application deployment Pin
PJ Arends10-Feb-07 14:51
professionalPJ Arends10-Feb-07 14:51 
AnswerRe: Visual Studio 2005 application deployment Pin
bigdenny20011-Feb-07 0:00
bigdenny20011-Feb-07 0:00 
GeneralRe: Visual Studio 2005 application deployment Pin
Waldermort11-Feb-07 0:40
Waldermort11-Feb-07 0:40 
AnswerRe: Visual Studio 2005 application deployment Pin
bob1697211-Feb-07 5:52
bob1697211-Feb-07 5:52 
AnswerRe: Visual Studio 2005 application deployment Pin
Mark Salsbery11-Feb-07 7:58
Mark Salsbery11-Feb-07 7:58 
QuestionHow to prevent switch (or focus) to an application? Pin
Brooks Harris10-Feb-07 13:45
Brooks Harris10-Feb-07 13:45 
I'm trying to find a good way to programmatically prevent a user from switching to, or gaining focus on, a specific application.

I have an appication which writes large files. These are intended to be used by another application.

This "Other Application" is a large elaborate system, and one of the things it does is monitor a particular directory, continuously updating its own status about the contents of that directory.

This is the directory which my application would also like to write.

If this App is allowed to monitor this directory at the same time my app is writing to it there will be trouble, including potential lost of data, deadlock, or crash.

If this App is running, but does not have focus, it's monitoring stops, so my application can write to the "shared" directory as long as the user does not switch back to this other App.

So, I would like to prevent the user from switching to it (while allowing any other action). I've thought of a few ways to attempt this -

A) Inject code into the other app and hook its message loop (I don't really want to do it that way, as it risks creating instability).

B) Hook the desktop and trap user messages which would wake that App up (but I'm not exactly sure how to go about this).

C) Use SuspendThread() and ResumeThread() to turn it off and on.

Does anyone have suggestions or ideas about how to accompish this?

Thanks.

(If there is a better discussion area for this topic, please let me know)











Brooks

AnswerRe: How to prevent switch (or focus) to an application? Pin
Waldermort11-Feb-07 1:34
Waldermort11-Feb-07 1:34 
GeneralRe: How to prevent switch (or focus) to an application? Pin
Brooks Harris11-Feb-07 5:11
Brooks Harris11-Feb-07 5:11 
AnswerRe: How to prevent switch (or focus) to an application? Pin
Brooks Harris11-Feb-07 11:36
Brooks Harris11-Feb-07 11:36 
AnswerRe: How to prevent switch (or focus) to an application? Pin
Brooks Harris11-Feb-07 11:53
Brooks Harris11-Feb-07 11:53 
QuestionDevC++ Clock Pin
EagleAmerican1410-Feb-07 11:25
EagleAmerican1410-Feb-07 11:25 
AnswerRe: DevC++ Clock Pin
El Corazon10-Feb-07 14:25
El Corazon10-Feb-07 14:25 
AnswerRe: DevC++ Clock Pin
Christian Graus10-Feb-07 14:51
protectorChristian Graus10-Feb-07 14:51 
QuestionConfused about Mutex? Pin
nde_plume10-Feb-07 6:12
nde_plume10-Feb-07 6:12 
AnswerRe: Confused about Mutex? Pin
Waldermort10-Feb-07 6:17
Waldermort10-Feb-07 6:17 
GeneralRe: Confused about Mutex? Pin
nde_plume10-Feb-07 6:47
nde_plume10-Feb-07 6:47 
GeneralRe: Confused about Mutex? Pin
Waldermort10-Feb-07 7:05
Waldermort10-Feb-07 7:05 
QuestionDisplay settings Pin
Waldermort10-Feb-07 5:31
Waldermort10-Feb-07 5:31 
AnswerRe: Display settings Pin
Christian Graus10-Feb-07 11:05
protectorChristian Graus10-Feb-07 11:05 
GeneralRe: Display settings Pin
Waldermort10-Feb-07 11:25
Waldermort10-Feb-07 11:25 
QuestionDirect3D forum Pin
Waldermort10-Feb-07 3:45
Waldermort10-Feb-07 3:45 
AnswerRe: Direct3D forum Pin
Hamid_RT10-Feb-07 20:46
Hamid_RT10-Feb-07 20:46 
QuestionESP exception Pin
sanjutvm10-Feb-07 3:33
sanjutvm10-Feb-07 3:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.