473,473 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

[C#] sendkeys

3 New Member
Ok hi. Im new here.

But i have been coding in C# the last 2 days. And i am actually already very good.
I use windows applications.

And i was wondering. Im making a program that i want it to stop when you press Ctrl and S or something along those lines.

So. I know its

SendKeys isnt it?
I would like it to exit when they click a certain button. i know how to exit its just the part when they click!

But would i have to use an if statement? Any help would be appreciated.
Oct 24 '07 #1
5 2609
Plater
7,872 Recognized Expert Expert
Sendkeys is used to send simulated key/button presses to another program.

From what you described, you will either want to monitor you own key/mouse presses with the keydown or mouseclick events.

OR

You'll want what's known as a "global hook" to monitor key/button presses even when your program doesn't have focus.
http://www.codeproject.com/csharp/globalhook.asp
Oct 24 '07 #2
kenobewan
4,871 Recognized Expert Specialist
But i have been coding in C# the last 2 days. And i am actually already very good.
I'm still learning after seven years, but my four year old nephew learned C# in two hours. I think he's getting too big for his boots, what with learning a foreign language each day and beating computers at chess. Can't wait till he gets to school and gets picked on for being a nerd. At school no one ever called me names!
Oct 24 '07 #3
CSharpFTW
3 New Member
Yes. I want to use the keydown.

As i want it to do something when the USER clicks something on there keyboard.

So anyone know of any sort of code snippet?
Oct 24 '07 #4
Plater
7,872 Recognized Expert Expert
I included the link in my first post.
Oct 24 '07 #5
CSharpFTW
3 New Member
o.O yh i see now sorry,. Ithought that was like ur sig or sumut lol.

Cheers bro!
Oct 24 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mr. Bungle | last post by:
I would like to send email automatically via a command button. I have accomplished this just fine through the following code: (Outlook should already be open for reliable results) Private Sub...
2
by: RBohannon | last post by:
I need to create a report in MS Word populated with data from A2K. I have been asked to create the report in Word so that parts of it can be edited as necessary later. The data in the report are...
1
by: George | last post by:
Every time I used the Sendkeys command in my application the "Numlock" turned off and I couldn't use the keypad to hit numbers...... The old code was: Private Sub Command1_Click() SendKeys...
5
by: Wayne Gibson | last post by:
Hi, Was wondering if somebody could help.. I'm trying to use Sendkeys on a Windows forms. I have entered the following command to simulate a CTRL+ALT+1.. ...
1
by: Bryan | last post by:
I am writing a C# Windows App that updates out Excel reports' modules. The app is complete, but has a problem. The only way MS allows you to unprotect the VBA code in Excel is to do it by hand or...
1
by: GrantS | last post by:
I need to use a sendkeys key combination to automate the "accept files" that a remote user wants to send to me via Windows messenger. I am using automation to work with Windows Messenger client in...
6
by: Gary | last post by:
Hi, I am trying to use the "System.Windows.Forms.SendKeys" class for triggering the Ctrl+P key. Syntax: System.Windows.Forms.SendKeys.Send("^(P)") This is not working ..what could be the...
6
by: Michael Maes | last post by:
Hello, I'm invoking successive SendKeys.SendWait("{BACKSPACE}") SendKeys.SendWait("{DELETE}") in a loop. The issue is that it causes a Beep on every Pass. Setting the 'Handled = True' on...
2
by: MLH | last post by:
I have the following code with a SendKeys statement in it. 100 If Me.Dirty Then MsgBox "Form is Dirty!" 120 Dim MyQ As String, MyTitle As String, Response As Boolean 140 MyQ =...
0
by: dtshedd | last post by:
I have a database with hundreds of embedded photos (Microsoft Photo 3.0) Many are larger than 1 MB. I tried Stephen Lebans macro but it did not work probably for the aforementioned reasons Now...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.