Web Development

General discussion


How do I get Task ID

By PWS442 ·
How do I get my own Task ID in VB6. (I know I can use Shell to start and retrieve one, I just want my own!)

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Check out the App object

by ChuckSomerville In reply to How do I get Task ID

Um... "Task ID"?

App.ThreadID returns the thread ID.

App.hInstance returns the instance handle. (Not very useful in Win32 - See Dan Appleman's "Visual Basic Programmer's Giude to the Win32 API", page 1104.)

If you mean the Process ID (as shown in Task Manager, and as used by the kill command at a command prompt), then declare the following API call...

Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long

...(note this may have wrapped in your browser window), and call it thus...

LabelPID.Caption = Str(GetCurrentProcessId())

- Cheers,

Chuck Somerville, Dayton Ohio

Related Discussions

Related Forums