Does anyone know how to do a sendkeys to a PnP device manger?
Printable View
Does anyone know how to do a sendkeys to a PnP device manger?
If it has a window that you type into, the outline of what you do
is
Get the window handle of the window (FindWindowEx api)
Send keystrokes as messages to the window (SendMessage api)
If you post just a little more information, one opf us can post code to help you. Otherwise Searcht forums here for those two api calls.
Also - goto www.allapi.net downloaf the api -guide (free). It is better than anything MS offers for api help. The web site also has a lot of specialized sample code that is not in the api -guide.
I want to be able to run a vb program from my desktop and go into device manager and disable my network card. Using sendkeys. Is that possible?
Another guy showed you what is involved in Registry changes to do this.
Yes, you can do the Reg changes from VB.
You know, this sounds like one of those problems that probably has a different answer than what you've come up with so far. You want to turn off/on your NIC card. Maybe if you explained the context of what you are doing you would get better answers, because this kind of thing is wjhat Sysadmin types need to do. So it come under System Programming - which is not really a VB thing usually.
You can do it manually with reg changes, but not programatically. The reg changes vary from machine to machine. I appreciate your help with this. thanks.
you should be able to go thru the registry looking for the appropriate key though?
Da Silvy got it right. You're gonna have to do a hell of a lot of work. In VB, anyway.
My original question stands. There must be another easier way to get what you need. But we can't get your overall picture.
What you're trying to do can be acheived at very low-level programming.
There is C source and tools available at www.sysinternals.com, download PsTools and it's cousins.
The other suggestion:
Goto www.mvps.org/vnet Search for 'Rundll32'
These RunDll statments mess with Network Settings:
command: Win9x: rundll32.exe shell32.dll,Control_RunDLL netcpl.cpl
result: displays Networks properties, Configuration tab
command: WinNT: rundll32.exe shell32.dll,Control_RunDLL ncpa.cpl
result: displays Networks properties, Identification tab
command: WinNT: rundll32.exe shell32.dll,Control_RunDLL ncpa.cpl,,1
result: displays Networks properties, Services tab
command: WinNT: rundll32.exe shell32.dll,Control_RunDLL ncpa.cpl,,2
result: displays Networks properties, Protocols tab
command: WinNT: rundll32.exe shell32.dll,Control_RunDLL ncpa.cpl,,3
result: displays Networks properties, Adapters tab
command: WinNT: rundll32.exe shell32.dll,Control_RunDLL ncpa.cpl,,4
result: displays Network
There are ways to start control page applets using RunDll32. You can then send a message via code to the applet to stop the NIC card. You want to start the Network Applet.
www.mvps.org/vnet. thanks for your info but this site is not found. can you give me another one to search?
What I'm trying to do is....
Develop a program that disable a network card on any Windows Operating System with a click of a button. I prefer VB, but if I can only do it in C than please if anyone knows of a good systems programming site, please let me know. Thanks
This doesn't sound good at all. Why do you want to do this?Quote:
Orginally posted by klmcsd
What I'm really trying to do... Develop a program that disable a network card on any Windows Operating System with a click of a button.
so i can control internet access on my lan