Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Prevent the main thread from closing the application?

Featured Replies

Posted

Will blocking ExitProcess() prevent the main thread from shutting down the application when it ends?

I ask because I am working on a dll which is injected into a target application. And I don't want the application to be exited before the dll is finished and ready to exit.

If you are certain the main thread is calling ExitProcess to close/terminate the application, you could hook it and call WaitForSingleObject with your threads handle to force the application to wait for your thread to finish. Then let ExitProcess continue as normal.

I think once the main thread returns to kernel32.dll, t calls ExitProcess, at least on XP...

However, it's not very safe to assume kernel32.dll calls ExitProcess on every Windows version.

TerminateThread on the main thread terminates the process as well, and I doubt it calls ExitProcess internally.

Guess you gotta hook a few more APIs apart from ExitProcess there to be 100%ly sure.

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.