0
votes
Vote UpVote

How to: Set a Thread Name in Native Code

The Wiert Corner – This is what the Delphi TThread.NameThreadForDebugging is based on: // // Usage: SetThreadName (-1, "MainThread"); // #include <windows.h> const DWORD MS_VC_EXCEPTION=0x406D1388; #pragma pack(push,8) typedef struct tagTHREADNAME_INFO { DWORD dwType; // Must be 0x1000. LPCSTR szName; // Pointer to name (in user addr space). DWORD dwThreadID; // Thread ID (-1=caller thread). DWORD dwFlags; // Reserved for future use, must be zero. } THREADNAME_INFO; #pragma pack(pop) void SetThreadName( DWORD dwThreadID, char* threadName) { THREADNAME_INFO info; info.dwType = 0x1000; ...
Favorite? Off-Topic? jpluimers @ 2016-06-15 07:00

Statistics

Visits: 1480
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)