I would like to create a process that runs on both a Windows XP and Vista Machines that loads on startup, what this process will do is, on the "F12" keypress it brings up a simple form that a user fills in some details then clicks on send, then it goes back to sleep and waits on the "F12" key being pressed.
Never created a process before so any help is appreciated.
I get what you are saying and this is not a keylogger if that is what you are trying to say. This is for an inhouse helpdesk application, I just want the user to be able to hit F12 on there keyboard to bring up the form to log a call, just a quicker means than the user havig to open up the application, going up to New Request, trying to make things simpler. On reflection though think a process may not be what I am thinking off, does this sound a better way of doing it? In machine startup the program is loaded and minimized immediatly (Program is hidden from Taskbar, but a icon is put into system tray) Program stays in minimized until the F12 key is encountered then form is restored, user fills in details clicks on send, then program is minimized again to system tray?
Ok I am a little further. I now have my form created, I have it minimizing on startup, it hides the Taskbar Icon and I now have a small icon in the System Tray indicating that the program is running. Now I have the following code in the KeyDown Event of my form
Code:
Select Case e.KeyCode
Case Keys.F12
Me.WindowState = FormWindowState.Normal
End Select
This works ok as long as I dont open any other applications, basically the form is still the focus, but obviously it stops working the minute the form loses focus. I have looked at the thread on Low Level Keyboard hooks but this is way above my head. Is there an easier way for my form to detect the F12 key even though it does not have focus?
You can register a hotkey. I have attached you a sample application (main thing is HelperHotkey class I wrote for one program of mine).
P.S. You cannot use F12 for hotkey since it is reserved for use by the debugger (NT4 and above).
If you by process mean windows service, you cannot show from it on Vista and above since services get special desktop (if you allow it to interact with desktop) or no desktop at all.
I would approach this via small trayed application which runs with user logon.
Thanks for the reply, I will have a look at your sample and see if I can implement it into my project..
I have another question, same project but another part of it.. I have a tabcontrol with 7 tabsheets. Each tab contains different information for display. Now the user wants the tabpages to change automatically every 30 seconds. The hard part is they want to specify the order in which they will be displayed, so I thought of a form with 7 Comboboxes named CBDisplay1 to CBDisplay7. Each Combobox will contain the name of the tab. Unfortuantly I am not sure how to get my timer to start on CBDisplay1, display the selected tab, then after 30 seconds look at CBDisplay2 and so on, then start back at cbdisplay1 after all other CBDisplay comboboxes have been used.
I have another question, same project but another part of it.. I have a tabcontrol with 7 tabsheets. Each tab contains different information for display. Now the user wants the tabpages to change automatically every 30 seconds. The hard part is they want to specify the order in which they will be displayed, so I thought of a form with 7 Comboboxes named CBDisplay1 to CBDisplay7. Each Combobox will contain the name of the tab. Unfortuantly I am not sure how to get my timer to start on CBDisplay1, display the selected tab, then after 30 seconds look at CBDisplay2 and so on, then start back at cbdisplay1 after all other CBDisplay comboboxes have been used.
Just put TabPages in Some List(Of TabPage) in order that you want. Every time timer ticks, just go on list((i + 1) % 7).
P.S. I am not sure that this is exactly what user wants. Usually user has some internal process in mind and proposes solution which may not be an optimal one. Check what user really wants because this interface is not nice and it will get uglier before it gets better.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.