iverson_est Posted April 1, 2006 Posted April 1, 2006 Can auto it kill a program or close a program. I am not taliknig about a window. #NoTrayIcon HotKeySet("^e", "Terminate") While 1 If WinExists("NETI - Eesti Interneti Kataloog ja Otsingusüsteem - Mozilla Firefox") Then WinClose("NETI - Eesti Interneti Kataloog ja Otsingusüsteem - Mozilla Firefox") MsgBox(16, "Halt!", "No internet for you!") EndIf If WinExists("NETI - Eesti Interneti Kataloog ja Otsingusüsteem - Microsoft Internet Explorer") Then WinClose("NETI - Eesti Interneti Kataloog ja Otsingusüsteem - Microsoft Internet Explorer") MsgBox(16, "Halt!", "No internet for you!") EndIf WEnd Func Terminate() Exit EndFunc as u can see it closes when the homepages is reached, so basically, one could do so thats he opens a folder browses for favs and one could ignore the restrict. So, can i close a program, not only a window?
Moderators SmOke_N Posted April 1, 2006 Moderators Posted April 1, 2006 Check out ProcessClose() in the help file. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
iverson_est Posted April 1, 2006 Author Posted April 1, 2006 yes thanks. Thats what i was looking for. #NoTrayIcon HotKeySet("^e", "Terminate") While 1 If ProcessExists("firefox.exe") Then ProcessClose("firefox.exe") MsgBox(16, "Halt!", "No internet for you!") EndIf If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") MsgBox(16, "Halt!", "No internet for you!") EndIf WEnd Func Terminate() Exit EndFunc now my script is like this. But, i can't get the result i want. Basically, when u go to internet through favs no internet .exe will be executed, sadly. Anyone ideas how to cover this?
Moderators SmOke_N Posted April 1, 2006 Moderators Posted April 1, 2006 @MyPM: (Ahh... Now I understand my PM from someone ) @iverson_est: This might be a good opportunity to explain (in detail) step by step EXACTLY what you are trying to accomplish. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
forger Posted April 1, 2006 Posted April 1, 2006 Maybe getting the pid from the window when it gets active? Perhaps something like: WinWaitActive("Google - Microsoft Internet Explorer", "") $pid = WinGetProcess("Google - Microsoft Internet Explorer", "") If $PID Then ProcessClose($PID) MsgBox(16, "Halt!", "No internet for you!")
MHz Posted April 1, 2006 Posted April 1, 2006 (edited) now my script is like this. But, i can't get the result i want. Basically, when u go to internet through favs no internet .exe will be executed, sadly. Anyone ideas how to cover this?Sounds like you want to watch for certain window title then process close #NoTrayIcon HotKeySet("^e", "Terminate") While 1 If WinExists("NETI - Eesti Interneti Kataloog ja Otsingusüsteem - Mozilla Firefox") Then ProcessClose("firefox.exe") MsgBox(16, "Halt!", "No internet for you!") EndIf If WinExists("NETI - Eesti Interneti Kataloog ja Otsingusüsteem - Microsoft Internet Explorer") Then ProcessClose("iexplore.exe") MsgBox(16, "Halt!", "No internet for you!") EndIf WEnd Func Terminate() Exit EndFunc Edit: A Sleep in the loop might be a good idea also Edited April 1, 2006 by MHz
iverson_est Posted April 1, 2006 Author Posted April 1, 2006 (edited) actually i want to prevent my sister to acess internet from MY computer Well my prob is that she could acess internet from any folder from favourites, pick 1 adress and ur in... edit: to where should place the sleep, i've tried it but where ever i put it, my hotkey wouldn't work Edited April 1, 2006 by iverson_est
Moderators SmOke_N Posted April 1, 2006 Moderators Posted April 1, 2006 actually i want to prevent my sister to acess internet from MY computer Well my prob is that she could acess internet from any folder from favourites, pick 1 adress and ur in...Could always take the cable from the modem or the phone coord with you when you leave the computer Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
forger Posted April 1, 2006 Posted April 1, 2006 (edited) I think Favorites (or Internet Shortcuts) open with this command: "rundll32.exe shdocvw.dll,OpenURL %l"(look @ file types)You could change it in the file types from a menu Tools -> Folder OptionsHence I doubt killing firefox.exe or iexplore.exe by process name would work Edit: or even disable Favourites from the start menu, if you're using xp: Edited April 1, 2006 by forger
iverson_est Posted April 1, 2006 Author Posted April 1, 2006 yeah but she is smart enough to plug it in
forger Posted April 1, 2006 Posted April 1, 2006 This is a windows registry file (.reg) (for xp pro, I'm almost 90% sure it could work on windows 2000 and the home versions of windows xp :\) Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Paths] [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Paths\{18d8cfb8-cfce-4a97-ad63-00dc9a1fda0c}] "LastModified"=hex(b):ec,94,f9,ea,9a,55,c6,01 "Description"="" "SaferFlags"=dword:00000000 "ItemData"="iexplore.exe" [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Paths\{5a6d7f2e-c931-42a6-ba1c-297d27a56c72}] "LastModified"=hex(b):36,43,7b,67,9a,55,c6,01 "Description"="" "SaferFlags"=dword:00000000 "ItemData"="firefox.exe" Now, if someone can translate this into AutoIT code.. after that you run: gpupdate /force and that's it
dabus Posted April 1, 2006 Posted April 1, 2006 Er, although it may be a little too late to ask for, but why don't you use a password to protect your account(s)?
iverson_est Posted April 1, 2006 Author Posted April 1, 2006 i dont want to protect account, mainly just doing it to learn autoit better
dnsi Posted April 16, 2006 Posted April 16, 2006 Why dont you just put a password on your computer. I can disable autoit even it you use #NoTrayIcon function. So it wont work. i think ur sister is smart enough to do that. My Programs:Flip-Flop File Encryption SysyemMULTIPLAYER-SOCKETSERVERHide An Archive In A Picture
dandymcgee Posted August 8, 2006 Posted August 8, 2006 Well you could use Valuater's Computer Lock program. You can view the source and change the pass to whatever you like. Very useful, and almost impossible to get through. OR, just set password to screensaver (if you on XP). HEHE - Dan [Website]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now