PDA

View Full Version : Call DLL Function


mandark
12-18-2002, 12:04 AM
Hello,

I am trying to find if the application that I intend to install is already running on the system. For this I try to call the 'FindWindow' API from user32.dll.

Everytime I try to do so the OS gives me an error that that the program had performed an illegal operation and terminates.

DLL file name: %SysDir%\User32.dll
Function name: FindWindowA
Function parameters: "MyApp",""
Return value type: Long
Store return value in variable: %Found%
Default value: 0

Can any one help???

Darryl
12-19-2002, 01:53 PM
I'm not really sure about calling the User32.dll, however I just wanted to propose an alternate solution, depending upon what you intend to do once you get this information.

For example, if your intension was to have this application closed, you could use the "Close Program" action instead. Is that a possible solution for you?

mandark
12-20-2002, 03:54 AM
Hello,

Yes, indeed. I can use 'Close Program' action to find my program and close it.

But, this is a very simple example of what I would like to achieve.

What I really want is to find the value of Service Pack Version of Windows NT so that I can inform the user to install the requisite Service Pack prior to installing my software.

Thanks.

Darryl
12-20-2002, 01:43 PM
If I'm not mistaken, I think you can find service pack information in a Registry entry. Try the following location:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\CDSVersion

That may be what you are looking for.

mandark
12-20-2002, 10:26 PM
Thanks Darryl,

That's what I wanted. It did the trick !!!

Mandark.