Re: [lazarus] Re: Detecting user cancel

2006-05-19 Thread Arí Ricardo Ody

At 10:39 19/5/2006, you wrote:
Hmm. I see.  There is nothing you can do if the interpreter accepts

input only from files. It's a shame that you can't pass the sources to the
interpreter through pipes.

Just curious: what interpreter is it ?

--
Adrian Maier


A guy here develop an application using que macro language o 
Mansfield's Kedit editor(www.kedit.com). The interpreter runs under Kedit.
It has a powerful language and you can mix editor commands in the 
macro programs. But it's a high CPU usage.
I wrote a front end in Lazarus that allow the user to select a list 
of input files. The front end remains starting KEDIT once for each input file.


[ ]

Ricardo 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Re: Detecting user cancel

2006-05-19 Thread Adrian Maier

On 19/05/06, Arí Ricardo Ody <[EMAIL PROTECTED]> wrote:

My Lazarus application will manage a list of programs to be converted
and will run a tool(once for each file of the list) that uses an
interpreter to execute sources that would "writed" in a ramdrive. I
have no way of establish a communications with the interpreter in the
way it takes the sources from a buffer of memory and not from a
"real" drive. If you know what I mean...


Hmm. I see.  There is nothing you can do if the interpreter accepts
input only from files. It's a shame that you can't pass the sources to the
interpreter through pipes.

Just curious: what interpreter is it ?

--
Adrian Maier

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Re: Detecting user cancel

2006-05-19 Thread Arí Ricardo Ody

At 10:15 19/5/2006, you wrote:


Hello,

My feeling is that deleting that information when the program is
killed would only partially solve the problem , and would only
give a false feeling of security.  For instance:
- since it's a long-running operation,   it might be possible to
 copy the sensitive information before the processing ends ?
 (we are talking about some temporary files , right ? )
- someone might run the program inside a debugger,  and stop the
 execution of the program just before the privileged information
 is deleted   - giving that person enough time to inspect
 all the secrets.


First, thank you for you considerations. I think that people that 
would handle the application have no expertise to do the things you 
suggest above. This is my hope. I'll put the sources in a (local) 
ramdrive. This may difficult these actions. At least for access the 
information thru the network.




Perhaps it would be better to keep that information in memory in some
kind of buffer ?  that memory would be freed after the application is
killed ;   (again - i'm assuming that you are currently storing  the
information in some temporary files).


My Lazarus application will manage a list of programs to be converted 
and will run a tool(once for each file of the list) that uses an 
interpreter to execute sources that would "writed" in a ramdrive. I 
have no way of establish a communications with the interpreter in the 
way it takes the sources from a buffer of memory and not from a 
"real" drive. If you know what I mean...




Cheers,
--
Adrian Maier

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Re: Detecting user cancel

2006-05-19 Thread Adrian Maier

On 5/19/06, Arí Ricardo Ody <[EMAIL PROTECTED]> wrote:

Suppose computer is doing a long processing.
Then, someone that can copies some information
that is available only during this processing,
tries to interrupt the processing. I want to
detect this and delete the privileged
information(that otherwise would be encripted ->
sources of a interpreted language).


Hello,

My feeling is that deleting that information when the program is
killed would only partially solve the problem , and would only
give a false feeling of security.  For instance:
- since it's a long-running operation,   it might be possible to
 copy the sensitive information before the processing ends ?
 (we are talking about some temporary files , right ? )
- someone might run the program inside a debugger,  and stop the
 execution of the program just before the privileged information
 is deleted   - giving that person enough time to inspect
 all the secrets.

Perhaps it would be better to keep that information in memory in some
kind of buffer ?  that memory would be freed after the application is
killed ;   (again - i'm assuming that you are currently storing  the
information in some temporary files).

Cheers,
--
Adrian Maier

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Re: Detecting user cancel

2006-05-19 Thread Alexander Todorov

On 5/19/06, Arí Ricardo Ody <[EMAIL PROTECTED]> wrote:

Suppose computer is doing a long processing.
Then, someone that can copies some information
that is available only during this processing,
tries to interrupt the processing. I want to
detect this and delete the privileged
information(that otherwise would be encripted ->
sources of a interpreted language).


If it is Windows only application then it should be receiving some
sort of WM message.
e.g. when the user logs off WM_QUERYENDSESSION is sent (IIRC).


>you can be sure by checking your program with spy++ and see if it recieves
>any message,
>also maybe global hooking can do something for you.

I know nothing of this matter. May you develop, please?


Try to find the appropriate WM and then use Windows hooks to insert
your code before this message is processed. See SetWindowsHookEx /
UnhookWindowsHookEx / CallNextHookEx Win32 API functions.

Hope this will help you.
If you need a sample code using hooks please send me a private message.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Re: Detecting user cancel

2006-05-19 Thread Arí Ricardo Ody

At 08:56 19/5/2006, you wrote:

On Fri, 19 May 2006 15:00:38 +0330, Arí Ricardo Ody
<[EMAIL PROTECTED]> wrote:
If you mean cancelled as kill task by windows task manager,no i really
doubt that.
becouse it is use is to force killling of a task,mostly when program is
hung,


Suppose computer is doing a long processing. 
Then, someone that can copies some information 
that is available only during this processing, 
tries to interrupt the processing. I want to 
detect this and delete the privileged 
information(that otherwise would be encripted -> 
sources of a interpreted language).



you can be sure by checking your program with spy++ and see if it recieves
any message,
also maybe global hooking can do something for you.


I know nothing of this matter. May you develop, please?

Thanks a lot

Ricardo 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Re: Detecting user cancel

2006-05-19 Thread roozbeh gholizadeh
On Fri, 19 May 2006 15:00:38 +0330, Arí Ricardo Ody  
<[EMAIL PROTECTED]> wrote:


Is there a way that I can detect if a Lazarus application was cancelled  
by the windows task manager?


For example: Does the Destroy event of the main occurs(And then I can  
intercept)?


I want to detect this situation and do some special processing.

Greetings from S�o Paulo - Brazil

Ricardo

If you mean cancelled as kill task by windows task manager,no i really  
doubt that.
becouse it is use is to force killling of a task,mostly when program is  
hung,
you can be sure by checking your program with spy++ and see if it recieves  
any message,

also maybe global hooking can do something for you.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives