Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[vb.net] make simple program which enables something in program

Hey
Ive got a program which enables and disables a rule (connection rule).

Don't know how to make in vb.net a program which disables the rule without clicking on it; because now: right mouse and click on "disable rule"
or after it click "enable rule"
When I click on hotkey on keyboard, and the program enables/disables it , it would be better

Btw program is softperfect bandwidth manager
You're making no sense, please explain in detail with correct grammar so I can understand at least one thing in your post.
what on earth r u talking about
(Dec 17, 2010 10:45 AM)Deceptive Wrote:  You're making no sense, please explain in detail with correct grammar so I can understand at least one thing in your post.

Look in that program, I made a connection rule.
I can use rightmouse and after click on the "menu": "enable rule"
or when it is enabled: "disable rule"

But I don't want to click on it, but want wit a keyboard hotkey for example "g"-hotkey.
The problem is how to do this, that it enables it with that hotkey.
what connection rule? -.-
oh you want hotkeys...

go on youtube and search for: "hotkeys in vb"

:)
Yes hotkeys is no problem, But the problem is how to do the action: "Enable Rule"
the rule is just about download/uploadspeed.
Are you talking about a plugin system?
FR1908
(Dec 17, 2010 11:16 AM)The-One Wrote:  Are you talking about a plugin system?

Don't know,

When using the hotkey, it should enable rule

But normally to enable rule: You should click-right on it and after choose enable rule of the list
You want to enable something with a hotkey?
Code
if(E.Keycode == Keys.G)
{
  Someshit.Enabled = true;
}
http://www.pulsecodes.info
Computer and Information Science major.
Information Technology Apprentice.
Freelance Programmer.
He wants to make a program so that when he presses a hotkey, it edits the setting for another program and vice versa.

I would help you OP but I have no idea on how to do this :/ Sorry
Ok, so you need to start off by finding the window class type. Spy++ will do that for you.
Second, you want to declare your APIs.

Code
Private Declare Function FindWindowExA lib "user32" (ByVal Parent as intptr, ByVal ChildAfter as intptr, Byval Classname as String, ByVal WindowText as String) as IntPt
Private Declare Function FindWindowA lib "user32" (ByVal Classname as String, ByVal WindowText as String) as Intptr
Private Declare Function SendMessageA lib "user32" (ByVal hwnd as IntPtr, Byval Message as Integer, ByVal WParam as Integer, Byval lParam as String) as Integer
Private Declare Function GetAsyncKeyState lib "user32" (ByVal Hotkey as Integer) as Integer
Dim ToggleBoolean as Boolean = False

Now in a timer, with the interval set to 1, you want to do this.

Code
Public Sub Timer_Tick
Dim Hotkey as Boolean
Hotkey = GetAsyncKeyState(Keys.F12) 'You can change f12 to whatever
If Hotkey = True then
If Toggle = True Then
Dim Hwnd as Integer
Dim Child as Integer
FindWindowA("TheClassNameYouFound", vbnullstring)
'Using SendMessage, find a message to work with context menus.
Toggle = False
End If
Else
Toggle = True
End If
End Sub
(Dec 17, 2010 12:11 PM)TraptCode Wrote:  Ok, so you need to start off by finding the window class type. Spy++ will do that for you.
Second, you want to declare your APIs.

Thanks very much now I will try it with Spy
Here is a list I uploaded for you, this has a huge amount of values you can try sendmessage with.

http://ha.zard0.us/_/showthread.php?162-...lues&p=206
Trapcode tried to help me, it is not working, because its not a direct checkbox, but a "rightclick, after click on a menu"

So Maybe another solution: Putting the program on: But deactivated it somehow .. and when needed activate it with a hotlink
Don't know if this is possible
Store the programs settings in a text file, edit the text file.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by shellbullet101May 4, 2014 09:06 PM 11 628 May 4, 2014 09:06 PM
Last Post: reasondefies
[.NET] by BlackHat8496Sep 21, 2011 06:54 PM 5 83 Sep 21, 2011 06:54 PM
Last Post: BlackHat8496
[.NET] by S!rk0Jul 13, 2011 02:11 AM 8 173 Jul 13, 2011 02:11 AM
Last Post: fireboy25