Solved

Checking MS Access instance ??

Posted on 1999-01-10
6
121 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 3

Accepted Solution

by:
Sendoh earned 50 total points
Comment Utility
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
Comment Utility
I hope you have try my proposed code (with the custom "declare").

It works fine for me (win95 / vb6)

0
 

Author Comment

by:Rukawa
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now