Re: How to prevent Windows turn off?
From: Steven Burn (nobody_at_PVT_it-mate.co.uk)
Date: 02/03/04
- Next message: MikeD: "Re: mcisendstring - long path names"
- Previous message: Ken Halter: "Re: EVAL Function"
- In reply to: Vlad: "Re: How to prevent Windows turn off?"
- Next in thread: Vlad: "Re: How to prevent Windows turn off?"
- Reply: Vlad: "Re: How to prevent Windows turn off?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 3 Feb 2004 16:03:35 -0000
Works just fine here......... (tested on my 9x system as my XP system is
down atm (has been for over a week now))
-- Regards Steven Burn Ur I.T. Mate Group www.it-mate.co.uk Keeping it FREE! Disclaimer: I know I'm probably wrong, I just like taking part ;o) Vlad <vovan.c@verizon.net> wrote in message news:OZ1QBnm6DHA.2568@TK2MSFTNGP10.phx.gbl... > Unfortunately, it doesn't work. > I put the code for form in MDI_QueryUnload event. Started my application and > tried to shot down Windows. Shot down was not stopped. I moved the code in > one of the child window and tried again. Did not work. I compiled my > project, ran EXE and tried to shot down Windows. It was shot down. > I'm testing on Windows XP Pro. Maybe it should not work with this version of > Windows, or maybe I need to change some settings in Windows? > Thank you > Vlad > > "Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message > news:e$Vp2Nm6DHA.1804@TK2MSFTNGP12.phx.gbl... > > Your welcome ;o) > > > > -- > > Regards > > > > Steven Burn > > Ur I.T. Mate Group > > www.it-mate.co.uk > > > > Keeping it FREE! > > > > Disclaimer: > > I know I'm probably wrong, I just like taking part ;o) > > > > > > Vlad <vovan.c@verizon.net> wrote in message > > news:etzS$#l6DHA.3008@TK2MSFTNGP09.phx.gbl... > > > Thanks a lot, Steven > > > I'll try it right now. > > > Vlad > > > > > > "Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message > > > news:OS0r2tl6DHA.2168@TK2MSFTNGP12.phx.gbl... > > > > 'Module code > > > > Option Explicit > > > > Declare Function GetComputerName Lib "kernel32" Alias > "GetComputerNameA" > > > > (ByVal lpBuffer As String, nSize As Long) As Long > > > > Declare Function AbortSystemShutdown Lib "advapi32.dll" Alias > > > > "AbortSystemShutdownA" (ByVal lpMachineName As String) As Long > > > > > > > > > > > > Function GetName() > > > > Dim lpBuff As String * 25 > > > > Dim ret As Long, ComputerName As String > > > > ret = GetComputerName(lpBuff, 25) > > > > ComputerName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1) > > > > GetName = ComputerName > > > > End Function > > > > > > > > 'Form code > > > > Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) > > > > If UnloadMode = vbAppWindows Then > > > > AbortSystemShutdown (GetName) > > > > End If > > > > End Sub > > > > > > > > > > > > -- > > > > Regards > > > > > > > > Steven Burn > > > > Ur I.T. Mate Group > > > > www.it-mate.co.uk > > > > > > > > Keeping it FREE! > > > > > > > > Disclaimer: > > > > I know I'm probably wrong, I just like taking part ;o) > > > > > > > > > > > > Vlad <vovan.c@verizon.net> wrote in message > > > > news:#KrAepl6DHA.2712@tk2msftngp13.phx.gbl... > > > > > Access database located on file server is used by VB programs > located > > on > > > > > several users machines. When the last user stops the program the > > > database > > > > is > > > > > compacting. > > > > > I noticed several times that compacting process is not finished by > > some > > > > > reason. I think that it happens when the last user doesn't stop the > > > > program > > > > > before Windows shot down. And Program doesn't have enough time to > > finish > > > > > compact process. > > > > > Is there any way to prevent Windows shot down if my program is > still > > > > > running? > > > > > Thank you > > > > > Vlad > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
- Next message: MikeD: "Re: mcisendstring - long path names"
- Previous message: Ken Halter: "Re: EVAL Function"
- In reply to: Vlad: "Re: How to prevent Windows turn off?"
- Next in thread: Vlad: "Re: How to prevent Windows turn off?"
- Reply: Vlad: "Re: How to prevent Windows turn off?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|