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.

Terminateprocess Does Not Work Every Time

Featured Replies

Posted

I want to be able to kill EVERY process no mather what,

but it seems code i'm using is not good enough to do that.

Here is what i use:

I find handle of process using something like this

hProcess:= OpenProcess(PROCESS_ALL_ACCESS, TRUE, aProcessId);

Then i try to kill it with this:

TerminateProcess(hProcess, 0);

Problem is it works with notepad and similar programs, but not

with many others.. :)

Any sugestions?

Regards,ChupaChu!

try

function KillProcessByPID(PID: DWORD): Boolean;

begin

Result := TerminateProcess(OpenProcess(PROCESS_TERMINATE, False, PID), 0);

end;

or have a look here:

http://www.delphipages.com/threads/thread....96&G=168165

  • Author
try

function KillProcessByPID(PID: DWORD): Boolean;

begin

Result := TerminateProcess(OpenProcess(PROCESS_TERMINATE, False, PID), 0);

end;

or have a look here:

http://www.delphipages.com/threads/thread....96&G=168165

I think there is problem with time i leave for process to terminate..

i just saw this line:

for i:=0 to 5000 do Application.ProcessMessages; 
//Genug Zeit geben - what would mena give enough time to terminate i guess :)

Next thing PROCESS_ALL_ACCESS or PROCESS_TERMINATE !?

Somebody said to me that if you want to kill proces without

waiting for anything use all_access..

I will try later today and give feedback how it turns out to be :)

Thanks!

  • Author

I tried PROCESS_TERMINATE instead of PROCESS_ALL_ACCESS and what i get is:

"Access violation at address 004xxxx in module "mymodule.exe". Read of address 00000000."

When I change it back to PROCESS_TERMINATE guess what - the same error!!

Now what was working does not work.. arghhh..

Look like i will have to read deeper into this..

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.