1. PC switch off from pgm
- Posted by Kondor Attila <euf-lev at dpg.hu> Aug 07, 2005
- 591 views
- Last edited Aug 08, 2005
I'd like to swich off an ATX PC in pgm, but I do not know how. Please help me! Thans! Attila Kondor --
2. Re: PC switch off from pgm
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Aug 08, 2005
- 615 views
On Sat, 6 Aug 2005 21:17:02 +0200, Kondor Attila <euf-lev at dpg.hu> wrote: >I'd like to swich off an ATX PC in pgm, but I do not know how. More details required. Apart from "a computer", what do you mean by "ATX PC"? To get this into perspective, I could reply "F4", and while you obviously won't know what that means, it _IS_ a perfectly valid answer to the question as asked. Regards, Pete PS. Just in case anyone really wants to know, that is not the function key between F3 and F5, it is the binary (in hexadecimal notation) for the HLT instruction on 80x86 pcs, though it probably is why some geek originally chose Alt F4 to shut a program or windows itself down.
3. Re: PC switch off from pgm
- Posted by Michael Raley <thinkways at yahoo.com> Aug 09, 2005
- 547 views
Pete Lomax wrote: > > On Sat, 6 Aug 2005 21:17:02 +0200, Kondor Attila <euf-lev at dpg.hu> > wrote: > > >I'd like to swich off an ATX PC in pgm, but I do not know how. > > More details required. > > Apart from "a computer", what do you mean by "ATX PC"? > I would guess an ATX form factor case/motherboard, which could a number of processor/os configurations. If your looking to do a system call you can find some third party command line utilities I looked through Snapfiles for freeware; http://www.snapfiles.com/opinions/Quick_ShutDown/Quick_ShutDown.html --"ask about our layaway plan". --
4. Re: PC switch off from pgm
- Posted by "Wolf" <wolfritz at king.igs.net> Aug 09, 2005
- 541 views
Attila asked, somewhat vaguely, and besides, I wanted to punish all those bloaters too lazy to *EDIT* their reply-to's. --shut down Windows, also, if ATX, power. --only tested on 98, 2K include dll.e include machine.e include misc.e constant KERNEL32=open_dll("kernel32.dll") ,GetVersion=define_c_func(KERNEL32,"GetVersion",{},C_UINT) ,GetCurrentProcess=define_c_func(KERNEL32,"GetCurrentProcess",{},C_UINT) ,hToken=allocate(4) ,ADVAPI32=open_dll("advapi32.dll") ,OpenProcessToken=define_c_func(ADVAPI32,"OpenProcessToken", {C_UINT,C_UINT,C_POINTER},C_UINT) ,TOKEN_ADJUST_PRIVILEGES=#20 ,TOKEN_QUERY=#8 ,struct_TOKEN_PRIVILEGES=allocate(16) --4 for count + 12 per privilege ,LookupPrivilegeValue=define_c_func(ADVAPI32,"LookupPrivilegeValueA", {C_POINTER,C_POINTER,C_POINTER},C_UINT) ,SE_SHUTDOWN_NAME=allocate_string("SeShutdownPrivilege") ,SE_PRIVILEGE_ENABLED=2 ,AdjustTokenPrivileges=define_c_func(ADVAPI32,"AdjustTokenPrivileges", {C_UINT,C_UINT,C_POINTER,C_UINT,C_POINTER,C_POINTER},C_UINT) --Win9x's really only need items below ,USER32=open_dll("user32.dll") ,ExitWindowsEx=define_c_func(USER32,"ExitWindowsEx", {C_UINT,C_UINT},C_UINT) ,EWX_SHUTDOWN=1 --,EWX_FORCE=4 --not used here function hi_word( atom d ) return floor(d/#10000) end function atom current, jk --is this NT/2000/XP? if hi_word( c_func(GetVersion,{}) ) < #8000 then mem_set(struct_TOKEN_PRIVILEGES,0,16) current=c_func(GetCurrentProcess,{}) jk=c_func(OpenProcessToken, {current,TOKEN_ADJUST_PRIVILEGES+TOKEN_QUERY,hToken}) if jk then poke4(struct_TOKEN_PRIVILEGES,1) --only one privilege --to enable privilege poke4(struct_TOKEN_PRIVILEGES+12,SE_PRIVILEGE_ENABLED) --get Luid into same struct jk=c_func(LookupPrivilegeValue, {0,SE_SHUTDOWN_NAME,struct_TOKEN_PRIVILEGES+4}) jk=c_func(AdjustTokenPrivileges, {peek4u(hToken),0,struct_TOKEN_PRIVILEGES,0,0,0}) printf(1,"%s\n",{"..attempting NT/2000/XP shutdown"}) sleep(2) free_console() --apparently not necessary on NT/2000/XP jk=c_func(ExitWindowsEx,{EWX_SHUTDOWN,0}) end if else printf(1,"%s\n",{"..attempting Win9x/ME shutdown"}) sleep(2) free_console() -- you *must* do this for 9x's jk=c_func(ExitWindowsEx,{EWX_SHUTDOWN,0}) end if --
5. Re: PC switch off from pgm
- Posted by Chris Burch <chriscrylex at aol.com> Aug 09, 2005
- 542 views
- Last edited Aug 10, 2005
Hi This will shutdown the computer, or is it too simple system("shutdown -s -t 40", 2) Chris http://members.aol.com/chriscrylex/euphoria.htm http://uboard.proboards32.com/
6. Re: PC switch off from pgm
- Posted by Kondor Attila <euf-lev at dpg.hu> Aug 09, 2005
- 564 views
- Last edited Aug 10, 2005
Michael Raley <guest at RapidEuphoria.com> 2005.08.08. 22:18:45 -7h-kor =EDrt= a: > > > posted by: Michael Raley <thinkways at yahoo.com> > > Pete Lomax wrote: > >=20 > > On Sat, 6 Aug 2005 21:17:02 +0200, Kondor Attila <euf-lev at dpg.hu> > > wrote: > >=20 > > >I'd like to swich off an ATX PC in pgm, but I do not know how. > >=20 > > More details required. > >=20 > > Apart from "a computer", what do you mean by "ATX PC"? > >=20 > > I would guess an ATX form factor case/motherboard, > which could a number of processor/os configurations. > > If your looking to do a system call you > can find some third party command line utilities=20 > > I looked through Snapfiles for freeware;=20 > http://www.snapfiles.com/opinions/Quick_ShutDown/Quick_ShutDown.html > Thank You, I will download. Attila Kondor --
7. Re: PC switch off from pgm
- Posted by Kondor Attila <euf-lev at dpg.hu> Aug 09, 2005
- 542 views
- Last edited Aug 10, 2005
Wolf <wolfritz at KING.IGS.NET> 2005.08.09. 14:38:34 -4h-kor =EDrta: > > > Attila asked, somewhat vaguely, and besides, I wanted to punish all those= > bloaters too lazy to *EDIT* their reply-to's. > > > --shut down Windows, also, if ATX, power. > --only tested on 98, 2K This is what I would like do. Thank you veru much, I will try after reading the emails. Attila --
8. Re: PC switch off from pgm
- Posted by Kondor Attila <euf-lev at dpg.hu> Aug 09, 2005
- 540 views
- Last edited Aug 10, 2005
Pete Lomax <petelomax at blueyonder.co.uk> 2005.08.08. 18:59:40 +1h-kor =EDrt= a: > > > On Sat, 6 Aug 2005 21:17:02 +0200, Kondor Attila <euf-lev at dpg.hu> > wrote: > > >I'd like to swich off an ATX PC in pgm, but I do not know how. > > More details required. > > Apart from "a computer", what do you mean by "ATX PC"? > > To get this into perspective, I could reply "F4", and while you > obviously won't know what that means, it _IS_ a perfectly valid > answer to the question as asked. > > Regards, > Pete > > PS. Just in case anyone really wants to know, that is not the function > key between F3 and F5, it is the binary (in hexadecimal notation) for > the HLT instruction on 80x86 pcs, though it probably is why some geek > originally chose Alt F4 to shut a program or windows itself down. > Thank you, I hope Wolf's pgm will be good. Attila --