Results 1 to 11 of 11

Thread: SendKeys

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    Richmond, VA
    Posts
    30

    SendKeys

    Does anyone know how to do a sendkeys to a PnP device manger?

  2. #2
    jim mcnamara
    Guest
    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.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    Richmond, VA
    Posts
    30
    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?

  4. #4
    jim mcnamara
    Guest
    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.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    Richmond, VA
    Posts
    30
    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.

  6. #6
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    you should be able to go thru the registry looking for the appropriate key though?

  7. #7
    jim mcnamara
    Guest
    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.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    Richmond, VA
    Posts
    30
    www.mvps.org/vnet. thanks for your info but this site is not found. can you give me another one to search?

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    Richmond, VA
    Posts
    30
    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

  10. #10
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    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.
    This doesn't sound good at all. Why do you want to do this?

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Apr 2001
    Location
    Richmond, VA
    Posts
    30
    so i can control internet access on my lan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width