TO ALL APIS GURUS IN THE HOUSE 
Author Message
 TO ALL APIS GURUS IN THE HOUSE

Hi there , I need to monitor if an exe is running or not , how do I
accomplish this using APIS ... Ive tried using CreateMutex and
GetLastError to no avail .... I tried the following code but it does
seem to work for me ...

Inside GLOBAL MAP
  Module('Window API')
     CreateMutex(*CString,long,*Cstring),long,Pascal,raw
     GetLastError(),long,pascal,raw
  end

  CheckEXE ROUITNE
    DATA
  R:Null  string(1)
  R:Exe   cstring(20)
    CODE
    R:Null = ''
    R:Exe  = 'test'    
    mutexhandl# = CreateMutex(R:Null,TRUE,R:Exe)
    IF GetLastError() = 183  
       ! EXE Running
    ELSE
       ! EXE Not Running
    .

Any pointers on wot could be wrong would be much appreciated ....
TIA  
Best Regards
Miguel



Tue, 28 Jun 2005 19:40:52 GMT  
 TO ALL APIS GURUS IN THE HOUSE
Try changing R:Null to cstring('')


Quote:
> Hi there , I need to monitor if an exe is running or not , how do I
> accomplish this using APIS ... Ive tried using CreateMutex and
> GetLastError to no avail .... I tried the following code but it does
> seem to work for me ...

> Inside GLOBAL MAP
>   Module('Window API')
>      CreateMutex(*CString,long,*Cstring),long,pascal,raw
>      GetLastError(),long,pascal,raw
>   end

>   CheckEXE ROUITNE
>     DATA
>   R:Null  string(1)
>   R:Exe   cstring(20)
>     CODE
>     R:Null = ''
>     R:Exe  = 'test'
>     mutexhandl# = CreateMutex(R:Null,TRUE,R:Exe)
>     IF GetLastError() = 183
>        ! EXE Running
>     ELSE
>        ! EXE Not Running
>     .

> Any pointers on wot could be wrong would be much appreciated ....
> TIA
> Best Regards
> Miguel



Tue, 28 Jun 2005 21:21:35 GMT  
 TO ALL APIS GURUS IN THE HOUSE
Hi Miguel

Is this one of your own exes that you are trying to detect is running?

Cheers
Simon Burrows
MailMerge Templates - Add mailmerging facilities to your apps
VariView templates. - Display your variables and fields as you run your
application
WordSpell templates. - Seamlessly use MS Word's Spell checker in your apps.
Layout Manager templates - Let your customers change your screen layouts
and control properties to suit their needs at runtime.
List & Label Templates - Unlimited report layouts, defined by your user at
runtime in your Clarion application
Free template sets
http://www.solace-software.demon.co.uk


Quote:
> Hi there , I need to monitor if an exe is running or not , how do I
> accomplish this using APIS ... Ive tried using CreateMutex and
> GetLastError to no avail .... I tried the following code but it does
> seem to work for me ...

> Inside GLOBAL MAP
>   Module('Window API')
>      CreateMutex(*CString,long,*Cstring),long,pascal,raw
>      GetLastError(),long,pascal,raw
>   end

>   CheckEXE ROUITNE
>     DATA
>   R:Null  string(1)
>   R:Exe   cstring(20)
>     CODE
>     R:Null = ''
>     R:Exe  = 'test'
>     mutexhandl# = CreateMutex(R:Null,TRUE,R:Exe)
>     IF GetLastError() = 183
>        ! EXE Running
>     ELSE
>        ! EXE Not Running
>     .

> Any pointers on wot could be wrong would be much appreciated ....
> TIA
> Best Regards
> Miguel

-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
   http://www.newsfeed.com       The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----


Wed, 29 Jun 2005 01:27:05 GMT  
 TO ALL APIS GURUS IN THE HOUSE
http://groups.google.com/groups?q=createmutex+group:comp.lang.clarion...
lr=&ie=UTF-8&oe=UTF-8&selm=36921BB0.CB2A82FD%40also.spb.ru&rnum=4


Quote:
> Hi there , I need to monitor if an exe is running or not , how do I
> accomplish this using APIS ... Ive tried using CreateMutex and
> GetLastError to no avail .... I tried the following code but it does
> seem to work for me ...

> Inside GLOBAL MAP
>   Module('Window API')
>      CreateMutex(*CString,long,*Cstring),long,pascal,raw
>      GetLastError(),long,pascal,raw
>   end

>   CheckEXE ROUITNE
>     DATA
>   R:Null  string(1)
>   R:Exe   cstring(20)
>     CODE
>     R:Null = ''
>     R:Exe  = 'test'
>     mutexhandl# = CreateMutex(R:Null,TRUE,R:Exe)
>     IF GetLastError() = 183
>        ! EXE Running
>     ELSE
>        ! EXE Not Running
>     .

> Any pointers on wot could be wrong would be much appreciated ....
> TIA
> Best Regards
> Miguel



Wed, 29 Jun 2005 01:49:40 GMT  
 TO ALL APIS GURUS IN THE HOUSE
Hey Guys thanks for the response yeah , But I got a little confused
this works well if im workin with my own exe , I later figure this out
and went looking for some other API's which could help me Id other
exe's through thier window names ... Great Reponse time lads :)I
really do like this user group thing yeah ... until we help each out
again yeah ...
Best Regards
Miguel
Quote:

> Hi there , I need to monitor if an exe is running or not , how do I
> accomplish this using APIS ... Ive tried using CreateMutex and
> GetLastError to no avail .... I tried the following code but it does
> seem to work for me ...

> Inside GLOBAL MAP
>   Module('Window API')
>      CreateMutex(*CString,long,*Cstring),long,pascal,raw
>      GetLastError(),long,pascal,raw
>   end

>   CheckEXE ROUITNE
>     DATA
>   R:Null  string(1)
>   R:Exe   cstring(20)
>     CODE
>     R:Null = ''
>     R:Exe  = 'test'    
>     mutexhandl# = CreateMutex(R:Null,TRUE,R:Exe)
>     IF GetLastError() = 183  
>        ! EXE Running
>     ELSE
>        ! EXE Not Running
>     .

> Any pointers on wot could be wrong would be much appreciated ....
> TIA  
> Best Regards
> Miguel



Wed, 29 Jun 2005 23:29:17 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Is there a GpfREXX guru in the house?

2. Need guru help with Windows API

3. Attention API Gurus

4. Question for API Guru

5. Calling all WinAPI Gurus: Help me make a list of Useful API functions for CW programmers

6. awk gurus in the house? Please help!!

7. API Question: API Menues...

8. Serial Communication (API-calls) and possible error in CW API-Viewer

9. Abstracted GUI APIs (was: RANT: Ruby GUI API)

10. API calls missing from readline API

11. NYC: Smalltalk for SW development Product House

12. House in need of repairs?

 

 
Powered by phpBB® Forum Software