How to detect (by EXE name) if a non-shelled process is running (32-bit) 
Author Message
 How to detect (by EXE name) if a non-shelled process is running (32-bit)

We are in the process of upgrading a vb3 application to vb5. The old
code used hMemcpy to copy a user defined type structure into a string
variable. This was done so that two user defined type structures could
be compared to see if there are differences. So the qusetion is: Is
there a replacement in the kernel32 for hMemcopy ? if not, is there a
way of comparing two user defined structures?

Any help will be appreciated.

Alex Livingston



Mon, 05 Mar 2001 03:00:00 GMT  
 How to detect (by EXE name) if a non-shelled process is running (32-bit)
We are in the process of upgrading a vb3 application to vb5. The old
code used hMemcpy to copy a user defined type structure into a string
variable. This was done so that two user defined type structures could
be compared to see if there are differences. So the qusetion is: Is
there a replacement in the kernel32 for hMemcopy ? if not, is there a
way of comparing two user defined structures?

Any help will be appreciated.

Alex Livingston



Mon, 05 Mar 2001 03:00:00 GMT  
 How to detect (by EXE name) if a non-shelled process is running (32-bit)
Alex,

There are two answers to your question.
1. As per Bruce McKinney's {*filter*} Visual Basic, this is the API
declaration:

#If Win32 Then

Declare Sub CopyMemory Lib KERNEL32 Alias RtlMoveMemory ( _

    lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)

#Else

Declare Sub CopyMemory Lib KERNEL Alias hmemcpy ( _

    lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)

#End If

2, The other thing you can do is use the VB intrinsic statement LSet to
copy bytes directly from one structure to another. This method is portable
between VB versions.

-Andy.



Quote:
> We are in the process of upgrading a vb3 application to vb5. The old
> code used hMemcpy to copy a user defined type structure into a string
> variable. This was done so that two user defined type structures could
> be compared to see if there are differences. So the qusetion is: Is
> there a replacement in the kernel32 for hMemcopy ? if not, is there a
> way of comparing two user defined structures?

> Any help will be appreciated.

> Alex Livingston



Mon, 05 Mar 2001 03:00:00 GMT  
 How to detect (by EXE name) if a non-shelled process is running (32-bit)
Thanks Greg.  Is there anyway to do this within VB (rather than C, which the
language the KB article uses).  Or is there an API call to get the EXE name
if the hWnd is known?

Quote:

>check out :
>http://support.microsoft.com/support/kb/articles/Q175/0/30.asp


>>I'm looking for a way to detect if a non-shelled application is running,
>and
>>if so, give focus to it.  In the 16-bit world I used GetModuleHandle
>>("notepad.exe"), which doesn't work in 32-bit. I won't know what the
window
>>caption/title will be, only the EXE name.  Any help would be *greatly*
>>appreciated.



Mon, 05 Mar 2001 03:00:00 GMT  
 How to detect (by EXE name) if a non-shelled process is running (32-bit)
I found my answer - it's in
http://support.microsoft.com/support/kb/articles/q187/9/13.asp


Quote:
>Thanks Greg.  Is there anyway to do this within VB (rather than C, which
the
>language the KB article uses).  Or is there an API call to get the EXE name
>if the hWnd is known?


>>check out :
>>http://support.microsoft.com/support/kb/articles/Q175/0/30.asp



Mon, 05 Mar 2001 03:00:00 GMT  
 How to detect (by EXE name) if a non-shelled process is running (32-bit)

EMail me for the source code.

It works like a charm, in VB.

Returns collection of all EXE's running (and DLL's), also returns PID's of each
found.  Can also get usage, threads, size, etc....



Sun, 11 Mar 2001 03:00:00 GMT  
 How to detect (by EXE name) if a non-shelled process is running (32-bit)

EMail me for example and source code.

Gets all EXE names and DLL's running, PID's, threads, and more.

All in VB 5 (SP3).



Sun, 11 Mar 2001 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. How to detect (by EXE name) if a non-shelled process is running (32-bit)

2. Waiting for a shell process to finish in 32 bit environment

3. How a 32-Bit App Can Determine When a Shelled Process Ends, Article ID: Q129796

4. How to Determine When a Shelled 32-bit Process Has Terminated

5. How a 32-Bit App Can Determine When a Shelled Process Ends

6. How a 32-Bit APP can Determine When a Shelled Process Ends - Q129796

7. Help: How a 32-Bit app can determine when a shelled process ends

8. Shell run 32-bit app in Win3.1?

9. Using API to detect if launched app is still running (VB4 32-bit)

10. Setup.exe for my application only runs once on 32-bit

11. Shell and Wait 16 bit apps from 32 bit VB 4.0

12. Make a 16 bit .exe from a 32 bit PC

 

 
Powered by phpBB® Forum Software