Announcement

Collapse
No announcement yet.

Call DLL Function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Call DLL Function

    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???

  • #2
    Re: Call DLL Function

    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?

    Comment


    • #3
      Re: Call DLL Function

      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.

      Comment


      • #4
        Re: Call DLL Function

        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.

        Comment


        • #5
          Re: Call DLL Function

          Thanks Darryl,

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

          Mandark.

          Comment

          Working...
          X