Click here to Skip to main content
16,004,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: get the desktop(monitor) width and height using win32 Pin
Jonathan [Darka]12-Jul-06 23:29
professionalJonathan [Darka]12-Jul-06 23:29 
AnswerRe: get the desktop(monitor) width and height using win32 Pin
Naveen12-Jul-06 23:24
Naveen12-Jul-06 23:24 
AnswerRe: get the desktop(monitor) width and height using win32 Pin
NiceNaidu12-Jul-06 23:26
NiceNaidu12-Jul-06 23:26 
AnswerRe: get the desktop(monitor) width and height using win32 Pin
Hamid_RT13-Jul-06 0:08
Hamid_RT13-Jul-06 0:08 
GeneralRe: get the desktop(monitor) width and height using win32 Pin
kk_mfc13-Jul-06 0:31
kk_mfc13-Jul-06 0:31 
QuestionCatching Exceptions thrown by a process Pin
Pavan Rao12-Jul-06 22:54
Pavan Rao12-Jul-06 22:54 
AnswerRe: Catching Exceptions thrown by a process Pin
Jonathan [Darka]12-Jul-06 23:04
professionalJonathan [Darka]12-Jul-06 23:04 
AnswerRe: Catching Exceptions thrown by a process Pin
Stephen Hewitt13-Jul-06 1:20
Stephen Hewitt13-Jul-06 1:20 
This is an unusual scenario and, without knowing exactly what you’re up to, I feel safe saying it is probably a bad design decision. That said it is possible. When you use the CreateProcess API you can pass the DEBUG_PROCESS or DEBUG_ONLY_THIS_PROCESS flags (the second is probably what you’re after) in the ‘dwCreationFlags’ parameter. This flag is used by debuggers, as you probably guessed by the name, and results in exceptions thrown in the child process being reported to the parent. The information is passed to the parent process via the WaitForDebugEvent API. There is more to it that that obviously and, as I said, I don’t recommend using this technique. If you don't know exactly what you're doing you'll make a mess. Also throwing an exception becomes much more expensive for the child as it now results in a context switch to the parent and back to the child again. The child my also behave slight differently in some aspects; for example the ghost window[^] feature will not work in the process being debugged (the child). That said there are protection schemes, such as Armadillo, which use this technique and the software which uses it seems to work ok and when a developer is making an app it works in the debugger. Also note that as a process can only have one debugger attached to it you will probably not be able to use your debugger on it and even debuggers which can work under these conditions (such as WinDBG) will not be as powerful under this environment.

Steve
GeneralRe: Catching Exceptions thrown by a process Pin
Pavan Rao13-Jul-06 18:57
Pavan Rao13-Jul-06 18:57 
GeneralRe: Catching Exceptions thrown by a process Pin
Pavan Rao13-Jul-06 21:27
Pavan Rao13-Jul-06 21:27 
QuestionFindFile in website Pin
includeh1012-Jul-06 22:37
includeh1012-Jul-06 22:37 
AnswerRe: FindFile in website Pin
eusto13-Jul-06 0:50
eusto13-Jul-06 0:50 
GeneralRe: FindFile in website Pin
Hamid_RT13-Jul-06 1:16
Hamid_RT13-Jul-06 1:16 
GeneralRe: FindFile in website Pin
eusto13-Jul-06 3:15
eusto13-Jul-06 3:15 
GeneralRe: FindFile in website Pin
Hamid_RT13-Jul-06 3:24
Hamid_RT13-Jul-06 3:24 
Questioni want to use menu in dialog box. Pin
Amit Agarrwal12-Jul-06 22:17
Amit Agarrwal12-Jul-06 22:17 
AnswerRe: i want to use menu in dialog box. Pin
*Dreamz12-Jul-06 22:28
*Dreamz12-Jul-06 22:28 
GeneralRe: i want to use menu in dialog box. Pin
Amit Agarrwal12-Jul-06 23:10
Amit Agarrwal12-Jul-06 23:10 
GeneralRe: i want to use menu in dialog box. Pin
*Dreamz12-Jul-06 23:29
*Dreamz12-Jul-06 23:29 
AnswerRe: i want to use menu in dialog box. Pin
_AnsHUMAN_ 12-Jul-06 22:32
_AnsHUMAN_ 12-Jul-06 22:32 
GeneralRe: i want to use menu in dialog box. Pin
Amit Agarrwal12-Jul-06 23:08
Amit Agarrwal12-Jul-06 23:08 
GeneralRe: i want to use menu in dialog box. Pin
_AnsHUMAN_ 12-Jul-06 23:28
_AnsHUMAN_ 12-Jul-06 23:28 
AnswerRe: i want to use menu in dialog box. Pin
wlwlxj12-Jul-06 23:18
wlwlxj12-Jul-06 23:18 
AnswerRe: i want to use menu in dialog box. Pin
Hamid_RT13-Jul-06 0:08
Hamid_RT13-Jul-06 0:08 
QuestionSystem Uptime Pin
Metal_Knight12-Jul-06 22:14
Metal_Knight12-Jul-06 22:14 

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.