Results 1 to 10 of 10
  1. #1
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81

    Weird Hotkey Glitch?

    Here is the code i have for a form:
    Code:
    Public Class Form1
        Private Const MF_BYPOSITION = &H400
        Private Const MF_REMOVE = &H1000
        Private Const MF_DISABLED = &H2
    
        Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As IntPtr, ByVal nPosition As Integer, ByVal wFlags As Long) As IntPtr
        Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As IntPtr, ByVal bRevert As Boolean) As IntPtr
        Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As IntPtr) As Integer
        Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As IntPtr) As Boolean
    
        Public Sub DisableCloseButton(ByVal hwnd As IntPtr)
            Dim hMenu As IntPtr
            Dim menuItemCount As Integer
    
            hMenu = GetSystemMenu(hwnd, False)
            menuItemCount = GetMenuItemCount(hMenu)
            Call RemoveMenu(hMenu, menuItemCount - 1, MF_DISABLED Or MF_BYPOSITION)
            Call RemoveMenu(hMenu, menuItemCount - 2, MF_DISABLED Or MF_BYPOSITION)
            Call DrawMenuBar(hwnd)
        End Sub
    
        Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
            Label3.Text = TrackBar1.Value
            Label6.Text = TrackBar1.Value / 1000
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            If CheckBox1.Checked = True Then
                Process.Start(Application.StartupPath & "\startupedit.exe")
                Timer1.Interval = TrackBar1.Value
                My.Settings.speed = TrackBar1.Value
                My.Settings.Save()
            Else
                Timer1.Interval = TrackBar1.Value
                My.Settings.speed = TrackBar1.Value
                My.Settings.Save()
            End If
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            DisableCloseButton(Me.Handle)
            If My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", _
    "Computer Spammer Startup", Nothing) Is Nothing Then
                MsgBox("Normal startup, no startup event found", MsgBoxStyle******rmation, "Normal Startup")
                TrackBar1.Value = My.Settings.speed
    
            Else
                MsgBox("Startup commands...")
                TrackBar1.Value = My.Settings.speed
                Button2.Enabled = False
                Me.Hide()
            End If
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            End
        End Sub
    
        Private Sub CheckBox12_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox12.CheckedChanged
            If CheckBox12.Checked = True Then
                NotifyIcon1.Visible = True
            Else
                NotifyIcon1.Visible = False
            End If
        End Sub
    
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            If CheckBox4.Checked = True Then
                Form2.Show()
            ElseIf CheckBox7.Checked = False Then
                antivir.Show()
            ElseIf CheckBox9.Checked = True Then
                Process.Start(Application.StartupPath & "cd.vbs")
            End If
        End Sub
    
        Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
            Me.Show()
        End Sub
    
        Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
            If CheckBox3.Checked = True Then
                CheckBox10.Checked = True
                CheckBox10.Enabled = False
            End If
            If CheckBox3.Checked = False Then
                CheckBox10.Enabled = True
            End If
        End Sub
    
        Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
            If e.KeyCode = Keys.A Then
                TextBox1.Text = e.KeyCode
            End If
        End Sub
    End Class
    now... if i have my hotkey code...
    Code:
        Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
            If e.KeyCode = Keys.A Then
                TextBox1.Text = e.KeyCode
            End If
        End Sub
    End Class
    nothing happens :/

    IDK How to fix this, i already tried GetAsyncKeyState...


    -----------------------------------------------

    My site: here
    My Blog: here
    My member's area: here
    Minecraft Sever Forum: here


    Minecraft Servers:

    Public:



    Private:



  2. #2
    treeham's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    heh. Turn around.
    Posts
    200
    Reputation
    10
    Thanks
    41
    My Mood
    Cynical
    Try using
    Code:
    Public Declare Function GetAsyncKeyState Lib "user32" (ByVal Vkey As Long) As Integer
    Then use
    Code:
    If GetAsyncKeyState(Keys.A) Then
    'Do code
    End If
    I know you have already tried but it's worth trying again
    In Choob Language:
    also for all your info.. i didnt copy and paste shit.. coz i dont think anyone has realeased any source code for the New update of CA.. so sdfu..
    In English:
    I didn't copy and paste because no one has released what I need copy and paste
    Oh Choobs...

  3. #3
    MugNuf's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    790
    Reputation
    9
    Thanks
    160
    My Mood
    Goofy
    NextGen1 showed me a way to make hotkeys for my button.

    [php] Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    If (e.KeyCode = Keys.Enter) Then
    Button1_Click(sender, e)
    End If
    End Sub

    Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
    If (e.KeyCode = Keys.Enter) Then
    Button1_Click(sender, e)
    End If
    End Sub

    Private Sub TextBox2_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown
    If (e.KeyCode = Keys.Enter) Then
    Button1_Click(sender, e)
    End If
    End Sub[/php]

    Of course, just change it to what you want, it should work for you.

  4. #4
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81
    thats what i tried next... anyways i have solved the problem by making a hidden form and redoing the coding...
    my code was:
    Code:
    end
    W8 still dont work...
    Last edited by mnpeepno2; 02-05-2010 at 09:12 PM.


    -----------------------------------------------

    My site: here
    My Blog: here
    My member's area: here
    Minecraft Sever Forum: here


    Minecraft Servers:

    Public:



    Private:



  5. #5
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    If your looking for a "cheapy" way of doing it, use buttons or a menu

    Set the text with &

    E&nd - will make it so if a user presses Alt + n it will end
    etc etc etc

    the above method should always work, your probally doing something wrong, make sure that code is in in KeyDown


     


     


     



    The Most complete application MPGH will ever offer - 68%




  6. The Following User Says Thank You to NextGen1 For This Useful Post:

    hopefordope (02-06-2010)

  7. #6
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81
    it does work, but i need it to not be focused when it does it. i will try the E&nd meathod.


    -----------------------------------------------

    My site: here
    My Blog: here
    My member's area: here
    Minecraft Sever Forum: here


    Minecraft Servers:

    Public:



    Private:



  8. #7
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Almost all components have a keydown, add it to your Form Keydown, Textbox keydowns and etc...


     


     


     



    The Most complete application MPGH will ever offer - 68%




  9. The Following User Says Thank You to NextGen1 For This Useful Post:

    hopefordope (02-06-2010)

  10. #8
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81
    I NEED IT TO WORK WHEN IT IS NOT FOCUSED


    -----------------------------------------------

    My site: here
    My Blog: here
    My member's area: here
    Minecraft Sever Forum: here


    Minecraft Servers:

    Public:



    Private:



  11. #9
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    .............
    No need for caps....

    I assumed you meant button or text-box,unfocus, I was explaining how to do it that way

    Calm Down
    .............

    Look up Virtual Keys and System Wide Shortcuts , MSDN has plenty of material including a very detailed tutorial

    Not Mine , Code Snippet form MSDN

    Code:
    Imports System.Runtime.InteropServices
     
    ' Press ALT+D to insert current date into where cursor is
    Public Class Form2
     
        Public Const MOD_ALT As Integer = &H1 'Alt key
        Public Const WM_HOTKEY As Integer = &H312
     
        Public Declare Function RegisterHotKey Lib "user32" (ByVal hwnd As IntPtr, ByVal id As Integer, ByVal fsModifiers As Integer, ByVal vk As Integer) As Integer
        Public Declare Function UnregisterHotKey Lib "user32" (ByVal hwnd As IntPtr, ByVal id As Integer) As Integer
       
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Call RegisterHotKey(Me.Handle, 9, MOD_ALT, Keys.D)
        End Sub
     
        Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
            If m.Msg = WM_HOTKEY Then
                SendKeys.Send(DateTime.Now.Date.ToString("MM-dd-yyyy"))
            End If
            MyBase.WndProc(m)
        End Sub
     
        Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
            Call UnregisterHotKey(Me.Handle, 9)
        End Sub
     
    End Class
    Use this concept to achieve your goals,
    Last edited by NextGen1; 02-06-2010 at 05:01 PM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  12. The Following 3 Users Say Thank You to NextGen1 For This Useful Post:

    hopefordope (02-06-2010),mnpeepno2 (02-06-2010),Zoom (02-06-2010)

  13. #10
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81
    ^thanks buttons says all XD


    -----------------------------------------------

    My site: here
    My Blog: here
    My member's area: here
    Minecraft Sever Forum: here


    Minecraft Servers:

    Public:



    Private:



Similar Threads

  1. [Discussion] Weird Loading Glitch
    By SPittn_Blood in forum Combat Arms Glitches
    Replies: 23
    Last Post: 04-24-2010, 11:25 PM
  2. weird quarantine glitch
    By Thalokdar in forum Combat Arms Help
    Replies: 3
    Last Post: 03-14-2010, 06:49 PM
  3. Weird Microphone glitch...
    By Lolland in forum General
    Replies: 0
    Last Post: 02-04-2010, 01:16 AM
  4. Weird CA glitch?
    By leothelion in forum Combat Arms Glitches
    Replies: 14
    Last Post: 09-05-2009, 04:17 AM
  5. Weird Quartine Glitch..
    By davie13 in forum Combat Arms Glitches
    Replies: 3
    Last Post: 08-11-2009, 02:58 PM