so when the form loads it detects if the user have previously detects if the set the Stealth Mode on or not. If it is on then the notify icon is hidden then the form turns it's opacity to 0.0 and the form because not visible. Now, i not the form is still there but why isn't it registering my hot key. I did a simple test with GetAsyncKeyState
Here's the code just to make it undestandable. Let's start when the form loads up.
terminate_app = 0 fadeIncrement = 0.0 fadeDecrement = 1.0 My.Settings.Reload() LoadAppSettings() Me.Icon = My.Resources.prnk.prankzter NotifyIcon1.Icon = My.Resources.prnk.prankzter GoStep(0) soundcustomselected = False imagecustomselected = False If My.Settings.StealthEnabled = True Then StealtMode = True StealthModeNow() ElseIf My.Settings.LockEnabled = True Then LockDownMode = True LockDownNow() Else Timer1.Enabled = True End If
So if it detects that the settings.stealth enabled is turned to true then it goes to this funciton called StealthModeNow() which before the command there has to be StealthModeEnabled = true or else that sub routine won't work.
So here's the routine of StealthMode Now.
Public Sub StealthModeNow() If Form1.StealtMode = True Then Form1.fadeDecrement = 1.0 Form1.Timer2.Enabled = True Form1.NotifyIcon1.Visible = False Else Form1.fadeIncrement = 0.0 Form1.Timer1.Enabled = True Form1.NotifyIcon1.Visible = True End If End Sub
So, if the stealth mode is triggered it puts in the fade out effect.
So let's look at the timer2_tick and basically it just renderes it to look like it's fading out.
If Me.Opacity = 0.0 Then Me.Opacity = 0.0 Me.Visible = False Timer2.Enabled = False Else fadeDecrement = Val(fadeDecrement) - Val(0.1) Me.Opacity = fadeDecrement End If
So I know it's hidden it's self in the background like I want it to. But now when it comes to Form1_KeyDown it's not registering it.
I just have a simple test to make sure the hot key is being triggered or not.
If GetAsyncKeyState(Keys.ControlKey) And GetAsyncKeyState(Keys.ShiftKey) And GetAsyncKeyState(Keys.S) Then StealtMode = False Me.Opacity = 1.0 Me.Visible = True Me.Show() My.Settings.StealthEnabled = False End If
Any help guys would be greatly appreciated! Thanks for the support!