473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dev Ashish function not recognized. Need advice quick.

Hi folks,

I copied Dev Ashish's code below to a module in Access 2K. No mater
what I do, Access will not recognize the function. What have I
overlooked?

I know I'm going to feel like an idiot when I hear the answer.

All responses appreciated.
'***************** Code Start ***************
'This code was originally written by Dev Ashish.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
'Code Courtesy of
'Dev Ashish
'
Private Const SW_HIDE = 0
Private Const SW_SHOWNORMAL = 1
Private Const SW_NORMAL = 1
Private Const SW_SHOWMINIMIZED = 2
Private Const SW_SHOWMAXIMIZED = 3
Private Const SW_MAXIMIZE = 3
Private Const SW_SHOWNOACTIVATE = 4
Private Const SW_SHOW = 5
Private Const SW_MINIMIZE = 6
Private Const SW_SHOWMINNOACTIVE = 7
Private Const SW_SHOWNA = 8
Private Const SW_RESTORE = 9
Private Const SW_SHOWDEFAULT = 10
Private Const SW_MAX = 10

Private Declare Function apiFindWindow Lib "user32" Alias _
"FindWindowA" (ByVal strClass As String, _
ByVal lpWindow As String) As Long

Private Declare Function apiSendMessage Lib "user32" Alias _
"SendMessageA" (ByVal Hwnd As Long, ByVal Msg As Long, ByVal _
wParam As Long, lParam As Long) As Long

Private Declare Function apiSetForegroundWindow Lib "user32" Alias _
"SetForegroundWindow" (ByVal Hwnd As Long) As Long

Private Declare Function apiShowWindow Lib "user32" Alias _
"ShowWindow" (ByVal Hwnd As Long, ByVal nCmdShow As Long) As Long

Private Declare Function apiIsIconic Lib "user32" Alias _
"IsIconic" (ByVal Hwnd As Long) As Long

Function fIsAppRunning(ByVal strAppName As String, _
Optional fActivate As Boolean) As Boolean
Dim lngH As Long, strClassName As String
Dim lngX As Long, lngTmp As Long
Const WM_USER = 1024
On Local Error GoTo fIsAppRunning_Err
fIsAppRunning = False
Select Case LCase$(strAppName)
Case "excel": strClassName = "XLMain"
Case "word": strClassName = "OpusApp"
Case "access": strClassName = "OMain"
Case "powerpoint95": strClassName = "PP7FrameClass"
Case "powerpoint97": strClassName = "PP97FrameClass"
Case "notepad": strClassName = "NOTEPAD"
Case "paintbrush": strClassName = "pbParent"
Case "wordpad": strClassName = "WordPadClass"
Case Else: strClassName = vbNullString
End Select

If strClassName = "" Then
lngH = apiFindWindow(vbNullString, strAppName)
Else
lngH = apiFindWindow(strClassName, vbNullString)
End If
If lngH <> 0 Then
apiSendMessage lngH, WM_USER + 18, 0, 0
lngX = apiIsIconic(lngH)
If lngX <> 0 Then
lngTmp = apiShowWindow(lngH, SW_SHOWNORMAL)
End If
If fActivate Then
lngTmp = apiSetForegroundWindow(lngH)
End If
fIsAppRunning = True
End If
fIsAppRunning_Exit:
Exit Function
fIsAppRunning_Err:
fIsAppRunning = False
Resume fIsAppRunning_Exit
End Function
'******************** Code End ****************

Nov 13 '05 #1
4 1868

"Lauren Wilson" <pr*****@nospam.com> wrote in message
news:8o********************************@4ax.com...
Hi folks,

I copied Dev Ashish's code below to a module in Access 2K. No mater
what I do, Access will not recognize the function. What have I
overlooked?


Lauren Wilson,

May I ask what you mean by "Access will not recognize"?
Sincerely,

Chris O.
Nov 13 '05 #2
On Thu, 3 Feb 2005 21:01:25 -0800, "Chris2"
<ra******************@GETRIDOF.luminousrain.com> wrote:

"Lauren Wilson" <pr*****@nospam.com> wrote in message
news:8o********************************@4ax.com.. .
Hi folks,

I copied Dev Ashish's code below to a module in Access 2K. No mater
what I do, Access will not recognize the function. What have I
overlooked?


Lauren Wilson,

May I ask what you mean by "Access will not recognize"?
Sincerely,

Chris O.


Thanks for responding Chris. I guess I was not clear enough on that.
By "not recognize" I mean that Intellisense will not display the
function options and when I compile, Access says it's an unrecognized
function. I hope that's what you want to know.

Do you have a clue what I'm doing wrong?

Thanks a lot Chris.

Nov 13 '05 #3

"Lauren Wilson" <pr*****@nospam.com> wrote in message
news:95********************************@4ax.com...
On Thu, 3 Feb 2005 21:01:25 -0800, "Chris2"
<ra******************@GETRIDOF.luminousrain.com> wrote:

"Lauren Wilson" <pr*****@nospam.com> wrote in message
news:8o********************************@4ax.com.. .
Hi folks,

I copied Dev Ashish's code below to a module in Access 2K. No mater what I do, Access will not recognize the function. What have I
overlooked?
Lauren Wilson,

May I ask what you mean by "Access will not recognize"?
Sincerely,

Chris O.


Thanks for responding Chris. I guess I was not clear enough on

that. By "not recognize" I mean that Intellisense will not display the
function options and when I compile, Access says it's an unrecognized function. I hope that's what you want to know.

Do you have a clue what I'm doing wrong?

Thanks a lot Chris.


Lauren Wilson,

I'm not sure I'm going to be of much aid, but here goes.

I'm running Win2K SP-3; Access 2K SP-3; JET 4.0 SP-8.

I launched Windows Media Player, ran an mp3.

In the Access Visual Basic Editor, I opened the Immediate Window and
typed therein:

? fisapprunning("Windows Media Player")

It reported True.

I closed WMP.

I ran the function again.

It reported False.

The code appears to be working just fine.
Sincerely,

Chris O.
Nov 13 '05 #4
Lauren Wilson wrote:
Thanks for responding Chris. I guess I was not clear enough on that.
By "not recognize" I mean that Intellisense will not display the
function options and when I compile, Access says it's an unrecognized
function. I hope that's what you want to know.

Do you have a clue what I'm doing wrong?

Thanks a lot Chris.


Perhaps you have to make the function Public for your form's
intellisense to pick it up. BTW, wasn't there a name similar to Lauren
Wilson in a Video Professor commercial?

James A. Fortune

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
4
by: Berlin Brown | last post by:
I am parsing a C file and want to find the function names, is this python worthy or is Emacs-Lisp better for this. I have searched for some libraries but coming up null. I just need the function...
4
by: flipdog | last post by:
Hello all, I didn't know there is a thread on hash function started in this newsgroup so reposted my posting from another group. Hope I can have some feedbacks. I am new to hash table. I came...
1
by: aredo3604gif | last post by:
On Sun, 10 Apr 2005 19:46:32 GMT, aredo3604gif@yahoo.com wrote: >The user can dynamically enter and change the rule connection between >objects. The rule is a "<" and so given two objects: >a <...
9
by: laststubborn | last post by:
Dear All, We have a big concern in our Database system. We have 2000 transactions daily in our database. We need to replicate some how the database for our fail over setup. I tried transactional...
25
by: lovecreatesbeauty | last post by:
Could you talk something about the general rules on the interface (function) design in C program that recognized publically? Or introduce some good advice of yourself. How do you think about...
2
by: kev670 | last post by:
I'm creating a calendar calculator. i can't get my final function firstDayOfMonth to work. i have been able to calculate the amount of days between 2 dates but now i need to find where the first day...
4
by: Kelii | last post by:
Hi all, (WinXP Pro SP2, Access 2003) I'm using Dev Ashish's fRefreshLinks function from AccessWeb (http://www.mvps.org/access/tables/tbl0009.htm) to relink tables in my front end to one of...
22
by: DL | last post by:
Hi, What I wanted to do is to call a function from a newly created element. But it stumbled me. Here's the line that references the newly created element and I used the alert function for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.