Solved

Checking MS Access instance ??

Posted on 1999-01-10
6
124 Views
Last Modified: 2010-05-03
Hi !
May I know how to check whether any MS Access in running background on Win95 as well as winnt using WINAPI ??
I'd tried using "Findwindow" but it always return 0.
Any idea ??
0
Comment
Question by:Rukawa
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:chabaud
ID: 1455279
for 50 points try this code:

Option Explicit

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As Long) As Long

Private Sub Command1_Click()

    If FindWindow("OMain", 0) Then
        MsgBox "Access is running"
    Else
        MsgBox "Access is not running"
    End If

End Sub

0
 

Author Comment

by:Rukawa
ID: 1455280
Hi !
Thanks for you answer, I'd actually tried out above code on my machine(win95) as well as nt workstation 4.0.
It doesn't work. The findwindow API always return me "0".
I'd tried out on MSVC++ as well and its works to detect MSAccess.

0
 

Author Comment

by:Rukawa
ID: 1455281
Hi !
Thanks for you answer, I'd actually tried out above code on my machine(win95) as well as nt workstation 4.0.
It doesn't work. The findwindow API always return me "0".

0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 3

Accepted Solution

by:
Sendoh earned 50 total points
ID: 1455282
Rukawa :
Try compile this working MSVC++ functions as another DLL and it should work. I'd experienced this before !! ^_^
0
 
LVL 4

Expert Comment

by:chabaud
ID: 1455283
I hope you have try my proposed code (with the custom "declare").

It works fine for me (win95 / vb6)

0
 

Author Comment

by:Rukawa
ID: 1455284
Hi chabaud.
I did tried (Win95/VB5.0). But don't know what are the reason its doesn't work.
Since this is urgent to me and Sendoh's answer works. So I'd decide to give him/her the points !!

Thanks for you answer anyway !!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question