Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2005

Tip: Looking for answers? Try searching our database.

Find out if application is running

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GeorgeMar - 27 Feb 2005 01:23 GMT
I have an Access application that runs a VB application called "SISComm.exe".
I want to prevent users from running the VB appliction if it is already
running.

I am using FindWindow  API from the Microsoft explanation in Knowledge Base.

I have lpWindowName set as a const="SISComm"

I keep getting 0 even when the application is open.

Microsoft lists the Class Name and Application Name for its Windows
applications, what is the lpClassName or lpWindowName for my application?

Many thanks
george
Douglas J. Steele - 27 Feb 2005 12:17 GMT
Take a look at http://www.mvps.org/access/api/api0013.htm at "The Access
Web" for how to determine the class name of all running applications. Use
that when SISComm is running, and you should be set.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have an Access application that runs a VB application called
>"SISComm.exe".
[quoted text clipped - 13 lines]
> Many thanks
> george
GeorgeMar - 27 Feb 2005 19:19 GMT
Thank you Doug

It is working fine now in my Access apps.

However, when I try the same thing in my VB apps, I get the
Compile error:  Constants,fixed-lengths strings, arrays, user-defined types
and Declare statements not allowed as Public members of object modules.

I created a new class module and put the Declare FindWindow after Option
Explicit as I have done in Access.

Any suggestions
george

> Take a look at http://www.mvps.org/access/api/api0013.htm at "The Access
> Web" for how to determine the class name of all running applications. Use
[quoted text clipped - 17 lines]
> > Many thanks
> > george
Douglas J. Steele - 27 Feb 2005 21:18 GMT
Odd. I don't see anything public in that code (other than the fEnumWindows
function).

Do you have to use a class module, or can you use a regular module instead?

Otherwise, you're probably better off asking in one of the VB groups. (I
don't have VB installed on this machine, so I can't test anything for you)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Thank you Doug
>
[quoted text clipped - 33 lines]
>> > Many thanks
>> > george
GeorgeMar - 28 Feb 2005 02:01 GMT
Thank you Doug

I moved everything into a module and it works fine.

regards
george

> Odd. I don't see anything public in that code (other than the fEnumWindows
> function).
[quoted text clipped - 41 lines]
> >> > Many thanks
> >> > george
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.