Re: How to prevent Windows turn off?

From: Steven Burn (nobody_at_PVT_it-mate.co.uk)
Date: 02/03/04


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
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: How to prevent Windows turn off?
    ... Shot down was not stopped. ... ran EXE and tried to shot down Windows. ... > Steven Burn ... > Ur I.T. Mate Group ...
    (microsoft.public.vb.general.discussion)
  • Re: Panorama photography / widely variable light - solution??
    ... If I take my D70 outside and do a full 360 pano shot with the Panosaurus ... wasn't important to get the Gulf in the shots, I'd just let the windows ... Thanks for the tip on the Panosaurus head, ...
    (rec.photo.digital)
  • Panorama photography / widely variable light - solution??
    ... If I take my D70 outside and do a full 360 pano shot with the Panosaurus head, ... able to shoot from inside a home, to do VT's for realtors on the Gulf. ... let the windows blow out because I need to be showing the Gulf in all ...
    (rec.photo.digital)
  • Registry Error
    ... A long shot - I had a similar problem back in the Windows ... Opening IE, even once, would damage the registry ... >installed visual studio with service pack 5 and after ...
    (microsoft.public.windowsxp.general)
  • Re: Windows XP pro cd and new computer
    ... Steven Burn ... Computer was delivered with Windows XP Pro ... > Microsoft has information on website pertaining to piracy ... > request from computer business. ...
    (microsoft.public.windowsxp.general)