473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

C#(Quit the application) - shift+Ctrl+Q

Dev
Dear Friends,

I have created Application using VC#.

How do to the following tasks?

The user should not be allowed to exit the program: the start menu, end
task and all other ways of exiting the program should be
disabled. The Shift+Ctrl+Q (or other keystroke combination) should be the
only way to exit the program.

I disabled the close button.
If anyone knows ....Please help me....
Any suggestions would be greatly appreciated....

Thanks,
Rajan

Nov 13 '05 #1
1 5775
I don't know how you would disable "end task" from closing your program, but
I have no idea why you'd want to do that....When all else fails, you need a
way to close the program *somehow.*

Anyways, just add a handler for the Windows_Closing event in your main form
that sets the "Cancel" property to true

private void MainForm_Closing(object sender, CancelEventArgs e)
{
e.Cancel = myKeyStrokeWasPressed;
}

where myKeyStrokeWasPressed is a bool you'd set to false if, say,
Shift-Ctrl-Q was pressed. Otherwise, it's true.

"Dev" <ra********@hotmail.com> wrote in message
news:e5**************@TK2MSFTNGP11.phx.gbl...
Dear Friends,

I have created Application using VC#.

How do to the following tasks?

The user should not be allowed to exit the program: the start menu, end
task and all other ways of exiting the program should be
disabled. The Shift+Ctrl+Q (or other keystroke combination) should be the
only way to exit the program.

I disabled the close button.
If anyone knows ....Please help me....
Any suggestions would be greatly appreciated....

Thanks,
Rajan


Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Roger | last post by:
Are these two features available in VS.Net 2003 at all (maybe different keys)... F4 to go thru find-in-files search results (just like you F4 to go thru build errors). In VC6, if output window...
5
by: Alex Stevens | last post by:
Hi All, I'm writing a launcher program which checks for updates and copies them down to the client. However, I would like the user to be able to modify the settings for the launcher. As this...
3
by: Hasani | last post by:
What string value do I send to SendKeys to do this?
2
by: Guoqi Zheng | last post by:
Can some one tell me what is the chr value of Shift + Ctrl? a kind of soft return. an Enter, hard return is represented by chr(10) + chr(13), how about shift + ctrl? -- Kind regards Guoqi...
2
by: active | last post by:
In VB6 I believe MouseDown had a Shift argument that told if Shift, Ctrl or Alt was pressed. How in VB.NET MouseDown do I determine if one of these keys is pressed? I could increment a global...
4
by: Fred | last post by:
I have created a UserControl and now I need to Override the OnMouseUp, OnMouseDown, and OnMouseClick Subs but I also need to know if the Shift or Ctrl key was pressed when the mouse action...
1
by: andmarti | last post by:
Anyone can help me getting the shift + tab key combination ? I tried with getch () but with no success. May be using the sys.stdin ?? Please, help would be very appreciated. -- Andrés M....
9
by: timw.google | last post by:
Is there a way to disable ctrl-P (print window) in IDLE? I'm editing some python code in IDLE and I keep hitting this by mistake from my years of emacs editing. Thanks in advance.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.