Re: 2-Instance prevention

new topic     » goto parent     » topic index » view thread      » older message » newer message

Will this do what you want?

  include win32lib.ew 
  if setAppName("Your Program's Name") != 0 then  
    abortErr("") 
  end if 


from Win32Lib doc:
[func] setAppName (sequence Name)
Sets the text used as a class name prefix for new Windows. Returns: Zero if the same application name is not already running Category: System Attributes

This needs to be run before the first Window is created in your application. The initial value is Win32Lib AppWindow

A non-zero return code is actually the Windows hWnd value for the other instance of the application.

Example

     if setAppName("Super Database") != 0 then 
         warnErr("Application is already running") 
     end if 

Dan

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu