Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack (1) Thread Tools Display Modes
Old 11-12-2008, 02:44 PM   1 links from elsewhere to this Post. Click to view. #1 (permalink)
God of Mistakes...
 
Garbage's Avatar
 
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
Default [C#] NEED HELP - How to disable all other things except current windows form ?


Hello.
Currently, I'm working on a windows form. For some reasones, I need that whenever I'll execute my windows form, all other things, like start menu, some windows services should be disabled.
Means, user shouldn't be able to use Start menu button, ALT+TAB, Browser, etc...
My windows form will be running full screen.

Is there any code available for this purpose in C# .Net ?

Thanks in advance.

no replies till ? :O
__________________
Registered Linux User #468778
----------------------------------
http://twitter.com/_Garbage_

Last edited by Garbage; 11-12-2008 at 06:06 PM. Reason: Automerged Doublepost
Garbage is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 11-12-2008, 06:30 PM   #2 (permalink)
Legen-wait for it-dary!
 
dheeraj_kumar's Avatar
 
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
Default Re: [C#] NEED HELP - How to disable all other things except current windows form ?

C# is no good with low level windows functionality. You need to use pInvoke, to call the necessary APIs. You would need to use FindWindow to find your specific window, as all objects in windows are windows themselves. Then use EnableWindow to disable that window. Use Spy++ to find out window names, or better yet, use CreateToolSnapshot to get PIDs.

As for services, Codeproject helps you:
http://www.codeproject.com/KB/system...ceManager.aspx

If you want to do it the API way, use OpenSCManager, OpenService, ControlService and CloseServiceHandle.

Again, I'm not familiar enough with C# to suggest, but as for API use RegisterHotKey to disable alt tab.

If you arent familiar with pinvoke, use www.pinvoke.net for instant function definitions.
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
dheeraj_kumar is offline  
Old 12-12-2008, 11:09 AM   #3 (permalink)
God of Mistakes...
 
Garbage's Avatar
 
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
Default Re: [C#] NEED HELP - How to disable all other things except current windows form ?

Thanks for the links Dheeraj.
Here is another link I got - http://www.codeproject.com/KB/cs/globalhook.aspx

But still it's not working.
Need more help.
__________________
Registered Linux User #468778
----------------------------------
http://twitter.com/_Garbage_
Garbage is offline  
Old 12-12-2008, 03:20 PM   #4 (permalink)
Legen-wait for it-dary!
 
dheeraj_kumar's Avatar
 
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
Default Re: [C#] NEED HELP - How to disable all other things except current windows form ?

Hmm... the codeproject link is just an implementation of SetWindowsHookEx. I dont know enough c# to help you, I'm good at unmanaged code though.

If you cant get them working, try the codeproject link, as well as
http://www.codeproject.com/csharp/GlobalSystemHook.asp

If you cant use the source directly, link the DLL provided, and study the demo app to figure out how you can use it.
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
dheeraj_kumar is offline  
Old 13-12-2008, 03:36 PM   #5 (permalink)
God of Mistakes...
 
Garbage's Avatar
 
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
Default Re: [C#] NEED HELP - How to disable all other things except current windows form ?

Thanks Dheeraj again...

But I solved it.

I created a thread, which continuously search for the open processes like explorer.exe, iexplore.exe, taskmgr.exe. If it finds any open process, it kills.
__________________
Registered Linux User #468778
----------------------------------
http://twitter.com/_Garbage_
Garbage is offline  
Old 14-12-2008, 01:35 AM   #6 (permalink)
Legen-wait for it-dary!
 
dheeraj_kumar's Avatar
 
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
Default Re: [C#] NEED HELP - How to disable all other things except current windows form ?

Hmm... another simpler way to be to hook CreateProcess()
If the exe name parameter matches your list, bang! return an error.

This way, you dont waste CPU time looking for a process.

First you need to use CreateToolhelp32Snapshot to get a list of the current processes, then terminate whatever you need to. Then hook CreateProcess and have fun
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
dheeraj_kumar is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://www.thinkdigit.com/forum/programming/104136-c-need-help-how-disable-all-other-things-except-current-windows-form.html
Posted By For Type Date
[C#] povezave @ Slo-Tech This thread Refback 10-05-2012 06:27 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check windows partion for bad sectors form ubuntu saurabh kakkar Open Source 3 21-12-2007 08:48 AM
How to disable USB drive in Windows XP & Windows 2003 thinkdigitreader Software Q&A 1 22-11-2007 11:22 AM
Remove Update Notices Form Windows Xp shishirmzp Software Q&A 5 15-08-2006 05:40 PM
20 things you didn't know about Windows XP prj15 Tutorials 4 10-03-2006 09:51 PM
plz tell me the full form of WINDOWS NT operating system balbir97 Software Q&A 13 16-06-2005 02:26 PM

 
Latest Threads
- by gforz
- by soumya
- by Sujeet
- by icebags
- by Charan

Advertisement




All times are GMT +5.5. The time now is 03:02 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2