The Old New Thing

If only DLLs can get DllMain notifications, how can an EXE receive a notification when a thread is created (for example)?

When a DLL is loaded, it receives a notification, and when it is unloaded (or when the process terminates), it gets a notification. DLLs also receive notifications when a thread is created and notifications when a thread exits. But what if you are an EXE? EXEs don't have a , so there is no way to receive these notifications. The trick ...