Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shell "shutdown.exe -s" not working/spawning random button
#3
Lol nah, I don't care! here it is:

Form:
Code:
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
    (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
    (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000

Option Explicit

Dim TLevel As Integer

Private Sub Command1_Click()

    Timer1.Enabled = False
                              
    Timer2.Enabled = True

End Sub

Private Sub Form_Load()

    Timer2.Enabled = False

    TLevel = 5
  
    TransForm Me, Val(TLevel)

End Sub


Private Sub picture2_Click(Index As Integer)
End
End Sub

Private Sub Timer1_Timer()

TLevel = TLevel + 5

TransForm Me, Val(TLevel)

    If TLevel = 255 Then
        Timer1.Enabled = False
    End If

End Sub

Private Sub Timer2_Timer()

TLevel = TLevel - 5

TransForm Me, Val(TLevel)

    If TLevel = 5 Then
        Unload Me
    End If
  
End Sub
Private Sub Command99_Click()
    Dim lStyle As Long
    lStyle = GetWindowLong(Me.hWnd, GWL_STYLE)
    SetWindowLong Me.hWnd, GWL_STYLE, lStyle And Not WS_CAPTION
End Sub


Private Sub Picture1_Click(Index As Integer)
'Shutdown the computer
Shell ("shutdown.exe -s")
'close program
End
End Sub

Module (for fade effect):
Code:
Option Explicit

Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_ALPHA = &H2

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" (ByVal hWnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hWnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) _
As Long

Private Declare Function SetLayeredWindowAttributes Lib _
"user32" (ByVal hWnd As Long, ByVal crKey As Long, _
ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Public Function TransForm(Form As Form, TransLevel As Byte) As Boolean
SetWindowLong Form.hWnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes Form.hWnd, 0, TransLevel, LWA_ALPHA
TransForm = Err.LastDllError = 0
End Function
Reply


Messages In This Thread
RE: Shell "shutdown.exe -s" not working/spawning random button - by Extasey - 11-04-2009, 01:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  dfsvc.exe crashing eXtremer 0 730 11-15-2012, 05:45 AM
Last Post: eXtremer
  Good Button :) HF~Legend 5 2,069 09-28-2012, 01:21 AM
Last Post: rqmok
  Button firefox Menu HF~Legend 2 1,524 09-08-2012, 04:20 PM
Last Post: spesificrelax
  vLoader 1.0 - File Uploader - Exe to Web - Easy - MediaFire Link Die 2 1,630 01-07-2012, 02:57 PM
Last Post: Die
  [Release] Shutdown Timer (My Version) euverve 13 4,607 12-11-2011, 10:53 PM
Last Post: euverve

Forum Jump:


Users browsing this thread: 5 Guest(s)