Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default question about FindWindow API call

Is FindWindow a reliable way to determine if a particular application
is currently running?

I had been using Tasklist.exe to do this, but this program does not
appear to be present on Windows XP Home systems.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default question about FindWindow API call

I can't imagine why it would not be a fast and reliable way to determine if
an app is open, providing you know it's window class name. FWIW much faster
than say GetObject (assuming that works with the app in question).

Function IsWordRunning() As Long
Dim hWin As Long
Const WORD_CLASSNAME As String = "OpusApp"
hWin = FindWindow(WORD_CLASSNAME, vbNullString)

IsWordRunning = hWin
End Function

However you can make your own TaskList with the following
http://support.microsoft.com/kb/q187913/

Regards,
Peter T




"xlrotor" wrote in message
...
Is FindWindow a reliable way to determine if a particular application
is currently running?

I had been using Tasklist.exe to do this, but this program does not
appear to be present on Windows XP Home systems.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default question about FindWindow API call

Thank you, Peter.

I am going to change my production code to use the API call.
FindWindow has worked just right in all the testing I've done. Which
is more than I can say for Tasklist.exe.

I looked at the microsoft page you mentioned, and I think FindWindow
looks like the best way to go.

Cheers,

Brian
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
On call calendar question CJC Excel Discussion (Misc queries) 1 November 21st 08 09:06 PM
Very easy question! (But not sure what to call it - maybe transpos Alexander Excel Worksheet Functions 3 September 4th 08 02:37 PM
APIs FindWindow and GetWindowText Dave D-C[_3_] Excel Programming 11 October 7th 07 03:44 AM
call stack question William Barnes Excel Programming 3 December 21st 04 12:27 AM
call stack question Dave Ring Excel Programming 2 October 4th 03 02:01 AM


All times are GMT +1. The time now is 11:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"