3

3G module in a notebook. When I restart that notebook, the 3G module is turned off again. I have to turn it on on every restart.

So that's why I thought I need a simple software that simulates the KeyEvent of Fn+-. It's function on the notebook keyboard is to en- or disable th 3G-module.

An option would be that I find out the 3G module's hardware-ID and activate it. (Apparently it uses 1 network device and 4 COM-ports in the device manager...)

I already discovered Google and found these threads:

Unfortunately these threads don't give me a solution...

Now my question: What method would be more simple?

  • simulating the Fn-KeyPress
  • getting the hardware-IDs and acitvating them

And then... how to solve that problem in an easy way?

I hope the given Information will help you to help me. :)

Additional info: the solution may be in C#, BATCH or even registry "hacks". I just want that 3G module to be turned on!


//EDIT: Playing with the hardware-ID will NOT work! After a restart, it's simply not in the device manager. Only after I once activated Fn+- it's listed there. So is there any other way to just switch on 3G?

Community
  • 1
  • 1
Trollwut
  • 541
  • 1
  • 7
  • 23
  • See: http://stackoverflow.com/questions/13863370/how-can-i-simulate-function-key-combinations-using-c and http://stackoverflow.com/questions/3644881/simulating-keyboard-with-sendinput-api-in-directinput-applications For possible solutions. – CodingBarfield Sep 02 '13 at 11:49
  • Hi CodingBarfield! Yes, These are the two threads I already linked to. But I cant get a clue? Do I have to find out what pattern the Fn+? has and re-input it with the second thread? Is this possible? Because it seems like I can only send "Windows-known" keys wit that function. – Trollwut Sep 02 '13 at 12:24
  • 1
    Those Fn-KeyPresses might be skipping the OS and could be hardwired directly to the actual hardware. But I don't think so, usually you need some kind of drivers for the actual buttons to work. I would look at decompiling/analysing the device drivers for the laptop keyboard and see what they do. It can't be much more the start some process to start the actual hardware. – CodingBarfield Sep 02 '13 at 12:42
  • Phew, that's much work for that little shizzle... Is there any other way to activate 3G? In the manufacturer's software, there's a simple button for switching on and off. I just need that functionality... – Trollwut Sep 02 '13 at 12:49
  • Ask them to supply you with the code behind the button or reverse engineer it. There could be a simple .dll interop call behind the button. You could even post the .exe online or add the supplier name to stackoverflow. – CodingBarfield Sep 02 '13 at 13:08
  • That may be a little complicated, as I dont get a real supplier name. The program "Hotkey" (version 6.0046) is listed from supplier "NoteBook". I looked with "Dependency Walker" into the DLLs. I found fancy functions like "setwlan" and similar ones, but nothing related to an 3G device. I'm trying to get more information about that program's origin. :) //EDIT: seems like it's from Clevo, a notebook manufacturer. – Trollwut Sep 02 '13 at 13:34
  • Okay, I now sent an email to them. Maybe they let me join their circle of secrecy. :) Is there a way to thank you on this site? – Trollwut Sep 02 '13 at 14:14
  • I'm now in contact with the manufacturer. I'll post if I get an answer. :) – Trollwut Sep 03 '13 at 11:15
  • Ok, manufacturer won't give me exact answers. I've been trying [this solution](http://stackoverflow.com/questions/4097000/how-do-i-disable-a-system-device-programatically) and it seems like the right thing. But instead of just deactivating the device I want to switch the power state of it. Is there a way to do this? (It always remains it's hardware-ID to select it) – Trollwut Sep 24 '13 at 10:34
  • check your command prompt for the netsh command you can use this with a special wlan related piece to enable the networking, for example using "netsh wlan connect name=* SSID=******" in windows xp and 7 works to connect to a wireless network so it may be similar for whatever device you are trying to use a batch with. – CMS_95 Oct 16 '13 at 00:49
  • on windows you can write this with shell – CMS_95 Nov 19 '13 at 02:45
  • 1
    FWIW: on the laptops from a large computer company I work for, the Fn keys are handled by a separate micro processor. The Fn "key strokes" make their way into the OS via ACPI. So the keyboard driver is not involved in these key presses. So simulating keystrokes in the usual way (SendKeys(), etc.) won't work. An approach using PnP (via Setup APIs in the example referenced) or using Power mgmt. functionality is more likely to work. I suggest looking at the POWERCFG.EXE utility in Windows. `powercfg /?` will give you help. Note the `-DEVICEENABLEWAKE` and `-DEVICEDISABLEWAKE` options. – Χpẘ Jan 04 '14 at 22:19

1 Answers1

1

To simulate a keyboard event you should be able to create a new keyboard event which will simulate a keypress in C#. example

keybd_event( VK_NUMLOCK,0x45,KEYEVENTF_EXTENDEDKEY | 0, 0 );

Aiden Grossman
  • 337
  • 5
  • 13