How to endtask for browsers every *seconds ?

Just starting out? Need help? Post your questions and find answers here.
vmars316
Enthusiast
Enthusiast
Posts: 464
Joined: Fri Jun 29, 2012 12:24 am
Contact:

How to endtask for browsers every *seconds ?

Post by vmars316 »

Hello ,
I am writing a kid safe browser
and I want to 'not allow' other browsers (google , edge , etc.) to run .
Not sure what is the best way to do that , I am thinking "endtask for browsers every *seconds" .
Open to suggestions , but don't want to get into 'the Parental Controls maze' .

Thanks for your Help...
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
User avatar
NicTheQuick
Addict
Addict
Posts: 1224
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: How to endtask for browsers every *seconds ?

Post by NicTheQuick »

What do you mean with "you are writing a kid safe browser"? Do you have a development team? And what has it to do with not using other browsers? If you do not want to execute other browser, uninstall them or remove the execution rights of the executable for the user that should not be able to start it.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
vmars316
Enthusiast
Enthusiast
Posts: 464
Joined: Fri Jun 29, 2012 12:24 am
Contact:

Re: How to endtask for browsers every *seconds ?

Post by vmars316 »

<<What do you mean with "you are writing a kid safe browser"?>>
https://gist.github.com/vmars316/09ae59 ... 17335db9cc
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
User avatar
NicTheQuick
Addict
Addict
Posts: 1224
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: How to endtask for browsers every *seconds ?

Post by NicTheQuick »

That's Javascript and HTML but no Purebasic Code. I don't understand.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
fluent
User
User
Posts: 68
Joined: Sun Jan 24, 2021 10:57 am

Re: How to endtask for browsers every *seconds ?

Post by fluent »

vmars316 wrote:Hello ,
I am writing a kid safe browser
and I want to 'not allow' other browsers (google , edge , etc.) to run .
Not sure what is the best way to do that , I am thinking "endtask for browsers every *seconds" .
Open to suggestions , but don't want to get into 'the Parental Controls maze' .

Thanks for your Help...
Yes I've been using something like this:

Code: Select all

Procedure KillerProc(tgt$)
    RunProgram("taskkill", " /F /IM firefox.exe", ""  , #PB_Program_Hide) 
    RunProgram("taskkill", " /F /IM iexplore.exe", "" , #PB_Program_Hide) 
EndProcedure


Procedure a(*x)
 shared active
  Repeat   
    If active 
      KillerProc(tgt$)  
    EndIf
    Delay(1000)   
  ForEver
EndProcedure

OpenWindow(0, 960, 340, 388, 88, "---", #PB_Window_MinimizeGadget | #PB_Window_SystemMenu  )  
ButtonGadget(2,15,50,240,30, "And... GO!")

CreateThread(@a(),1)


Repeat 
  e= WaitWindowEvent()  
  Select e 
    Case #PB_Event_Gadget   
      select EventGadget() 
        case 2
           SetWindowState(0, #PB_Window_Minimize) : active = 1 
      EndSelect
    Case #PB_Event_CloseWindow :   end
  EndSelect
Forever
vmars316
Enthusiast
Enthusiast
Posts: 464
Joined: Fri Jun 29, 2012 12:24 am
Contact:

Re: How to endtask for browsers every *seconds ?

Post by vmars316 »

NicTheQuick wrote:That's Javascript and HTML but no Purebasic Code. I don't understand.
Yes , its Nodejs , Electronjs and javascript .
My vision is , at User Login/StartUp , startup Killer.pb.exe ,
doubleClick StartBrowser.pb.exe housekeeping , then 'RunProgram(SafeBrowser.exe)' .
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
vmars316
Enthusiast
Enthusiast
Posts: 464
Joined: Fri Jun 29, 2012 12:24 am
Contact:

Re: How to endtask for browsers every *seconds ?

Post by vmars316 »

fluent "Yes I've been using something like this:"
Thanks ,
Wow , that's looking great .
Anxious to study and try it out
but first things first .

I want to make the whole thing plug-and-play-ISH ,
so its simple to install , click click .
OpenSource of course .
Thanks Again
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
Post Reply