![]() |
|
#1
|
|||
|
|||
ThreadI wrote a program that does the following:
My program spawns thread A and thread B. Thread A monitors thread B. Thread B runs another program called word.exe. I want Thread B to notify thread A, or thread A to realise when word.exe tries to open a .doc file. The .doc files in a specific folder are protected. I want to unprotect them when word.exe wants access to them. Does that make sense? Any idea as to how to notify thread A or thread B that word.exe is now requesting access to these files? |
|
#2
|
||||
|
||||
Re: ThreadNot really. The only way this could be done is if Word.exe notifies you it's opening a file. AFAIK, it doesn't.
__________________
Age is unimportant -- except in cheese |
|
#3
|
||||
|
||||
Re: ThreadQuote:
This is a most interesting question, regardless of the answer to "Word notifies you" issue. So: 1. You have thread A that monitors thread B. 2. You have an application, C. 3. You have a protected resource (one resource for simplicity), D. You want a user to use resource D with application C only if the request came from thread B. That's why you need another thread - A, which basically only tells you if the call to open D with C is permitted. Am I correct ? __________________
It's actually a one time thing (it just happens alot). |
|
#4
|
|||
|
|||
Re: Thread> You want a user to use resource D with application C only if the request came from thread B.
> That's why you need another thread - A, which basically only tells you if the call to open D with > C is permitted. > Am I correct ? Yip. You are. I dont think a monitor thread is necessary, but it might simplify things if you dedicate one thread to monitoring resources and unlocking them as required. I just basically need a way to notify thread A/B that Word.exe needs to open a certain file, so that I can unlock it. Basically when a request comes for file Z from word.exe, my thread must check to see if file Z is locked. If that is the case, it must be unlocked ONLY if word.exe is the requesting app. How on earth can I do this? -------------- More info: The problem is this. I have to write a copyright proggy that stops users from copying map files. These map files must be locked but still accesible in the sense that the user can click on File --> Open and then select the file. There is no way I can load these files into memory and show them to the user or something weird like that, because at the end of the day, the user will HAVE to scroll to the folder where the files are. I really cant think of any other way to help protect the map files. The main reason for this is because I am writing a program for a 3rd party app (called word.exe...). If I had the source for word.exe... I could somehow embed the files INSIDE the program. But alas, I do not! |
|
#5
|
||||
|
||||
Re: ThreadSo, The only way I can help you is by suggesting:
1. Lock the files with any mechanism you know as good (even consider using simple tools that requests for password to open the file). 2. Have the key to open those files only in one place (Like the File->Open menu). The other options that come into (my) mind are much complicated: 1. Monitor service (Thread). 2. Building your own Lock / Unlock mechanism (not simple at all !). __________________
It's actually a one time thing (it just happens alot). |
|
#6
|
|||
|
|||
Re: Thread1. Wont work because the people will then be able to copy the files to other PCs.
I just need a way to get a signal from word.exe that word.exe actually wants to open a file. And which one. is there any way to do that?!? |
|
#7
|
||||
|
||||
Re: ThreadQuote:
Well, if you want to work like that, I have nothing to add to Walt's original answer. __________________
It's actually a one time thing (it just happens alot). |
|
#8
|
||||
|
||||
Re: ThreadQuote:
Quote:
Quote:
Quote:
Alternate option. Replace word.exe with a program that does all the security crap, then passes an execute command with file name to the original word.exe. IT watches for word.exe to exit and cleans up the security. Many holes in this idea: 1) what happens after a crash. 2) the file is accessable while the original word.exe is running just to name 2 __________________
Age is unimportant -- except in cheese |
Recent GIDBlog
Meeting the populace by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Monitoring Thread Size | mark343 | MS Visual C++ / MFC Forum | 0 | 04-May-2006 09:09 |
| How to protect single thread in phpBB | iota | MySQL / PHP Forum | 0 | 20-Mar-2006 22:48 |
| Sending message to GUI thread that ISNT the main thread | mpviii | MS Visual C++ / MFC Forum | 1 | 20-Apr-2005 12:49 |
| The Official Birthday Wishes thread for jrobbio | JdS | Open Discussion Forum | 8 | 20-Nov-2003 18:21 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The