Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powerbuilder and API functions

Status
Not open for further replies.

b2kphfd

Technical User
Oct 10, 2003
2
US
I seen many examples of checking for application open using the FindWindow API call, but I'm interested in a way to find if an .exe is running that is not associated with my powerbuilder application. I would like to be able to query the task manager to see if an .exe is open. I've tried GetModuleHandle but can only get a return on DLL's not .exe??
 
function long OpenProcess(long dwDesiredAccess, long bInheritHandle, long dwProcessId) library "kernel32"
 
mexicomeat

Thanks for the reply, but can you show me code to use this function to determine if a .exe is running. In my application all I know is the .exe names (i.e. winword.exe).

These functions need the handle ID and I can't seem to find
a function that returns the handle ID with the input being an .EXE name??

I'm new to using API functions so please forgive if these are basic questions.

In my application I'm checking each client machine that has .exe's running from the client machine and some running off the server.


 
long ll_PROCESS_ALL_ACCESS, ll_ret
ll_PROCESS_ALL_ACCESS = 2035711 // 0x1f0fff
ll_ret = OpenProcess(ll_PROCESS_ALL_ACCESS, 0,ll_pID ) weher ll_pid is the process id of your application
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top