Code Red > .NET

[NSIS] How to check if AutoCAD is running and locking my files?

(1/1)

simor:
I'm doing an NSIS installer and want to check if AutoCAD (2008) is running. I was trying to use FindWindow but it seems that AutoCAD's window has a variable class name..


--- Code: ---Afx:00400000:8:00010011:00000000:xxxxxxxx
--- End code ---

The last part is changing at every startup so I can't use it. I tried googling it, found this:
http://mail.python.org/pipermail/python-win32/2007-February/005559.html
Unfortunately I think he was guessing because I couldn't confirm his theory with the parent class name.

Trying to find acad.exe in running processes is a bit messy under NSIS, haven't tried it yet and I'm not sure that I can find the window caption by process. Will be investigating this...

I don't want to go through all open windows checking their class name and caption nor trying to rename acad.exe to find if its locked or not :ugly:

Any ideas?

TonyT:

--- Quote from: simor on October 17, 2008, 08:04:22 AM ---Any ideas?

--- End quote ---

   COM ?

FengK:
Google for AutoItX, a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. It has a "ProcessExists" method.
http://www.autoitscript.com/autoit3/docs/functions/ProcessExists.htm

simor:

--- Quote from: TonyT on October 18, 2008, 08:33:49 AM ---   COM ?

--- End quote ---

I'm not sure how to do that in NSIS.. if it's even possible, I didn't find any mention of COMs in the manual :| but it would be some solution...


--- Quote from: xycadd on October 18, 2008, 06:33:49 PM ---Google for AutoItX, a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. It has a "ProcessExists" method.
http://www.autoitscript.com/autoit3/docs/functions/ProcessExists.htm

--- End quote ---

I mentioned search for the process (eg. using this) but if I find acad.exe I won't know if it's AutoCAD 2008 or a different one... right (?)


simor:
I ended up with two solutions, I found a script to look for variable window class names which requires one simple change and can look for variable window captions.. but the second solution is way better: LockedList plug-in. First you feed it with names of files and then it checks if they are in use by any running application and lists those apps in a listbox. Which is really what I was after..
Cool or what..  ^-^

Navigation

[0] Message Index

Go to full version