Click here to Skip to main content
16,020,459 members
Home / Discussions / Windows Forms
   

Windows Forms

 
QuestionHow To Detect The person who click the print option in any document????? Pin
manjari kar23-May-09 1:43
manjari kar23-May-09 1:43 
AnswerRe: How To Detect The person who click the print option in any document????? Pin
Mycroft Holmes23-May-09 2:06
professionalMycroft Holmes23-May-09 2:06 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar24-May-09 18:18
manjari kar24-May-09 18:18 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Mycroft Holmes24-May-09 19:11
professionalMycroft Holmes24-May-09 19:11 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar24-May-09 23:46
manjari kar24-May-09 23:46 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Mycroft Holmes25-May-09 0:36
professionalMycroft Holmes25-May-09 0:36 
Generalant invasion Pin
Luc Pattyn25-May-09 7:21
sitebuilderLuc Pattyn25-May-09 7:21 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Dave Kreskowiak25-May-09 6:38
mveDave Kreskowiak25-May-09 6:38 
You're not going to be able to do this using all-.NET code. I don't know the specifics of how to do it, but you're going to have to basically replace the system's print dialog to do what you want. This is FAR from a trivial task. You'll need very advanced knowledge of Windows internals and COM programming, along with some C++.

Why? Because Windows Security does not have any facilities in it to do what you want. Assigning a seperate password to a resource is a very inefficient method of trying to protect that resource. Personally, I think you're wasting your time trying to do this. Windows Security is made in such a way that users have a single sign-on and don't have to worry about "yet another password" to remember to access any resource. The permissions to users and groups of users are assigned to the user based on their login token, this includes accessing shared devices such as printers.

Your current method does not stop a print job from running. Since the job is already being spooled when your code figures out it is there, the print job has already started happening. The only thing you can do is pause the printer, which pauses ALL print jobs going to it, even the ones by other users who have supposedly put in the proper password. This is easily defeated because the user can just resume the printer to get around your password.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar25-May-09 18:52
manjari kar25-May-09 18:52 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Dave Kreskowiak26-May-09 15:41
mveDave Kreskowiak26-May-09 15:41 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar27-May-09 20:13
manjari kar27-May-09 20:13 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Dave Kreskowiak28-May-09 2:08
mveDave Kreskowiak28-May-09 2:08 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar30-May-09 1:15
manjari kar30-May-09 1:15 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Dave Kreskowiak30-May-09 13:12
mveDave Kreskowiak30-May-09 13:12 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar31-May-09 20:10
manjari kar31-May-09 20:10 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Dave Kreskowiak1-Jun-09 1:46
mveDave Kreskowiak1-Jun-09 1:46 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar4-Jun-09 20:47
manjari kar4-Jun-09 20:47 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar4-Jun-09 21:09
manjari kar4-Jun-09 21:09 
QuestionOffice Ribbon functionality Pin
windhopper22-May-09 2:23
windhopper22-May-09 2:23 
QuestionAliens stole my toolStrip, please help :'( Pin
Baeltazor21-May-09 14:52
Baeltazor21-May-09 14:52 
AnswerRe: Aliens stole my toolStrip, please help :'( [modified] Pin
Alan N21-May-09 22:38
Alan N21-May-09 22:38 
GeneralRe: Aliens stole my toolStrip, please help :'( Pin
Baeltazor22-May-09 15:50
Baeltazor22-May-09 15:50 
AnswerRe: Aliens stole my toolStrip, please help :'( Pin
dybs23-May-09 17:21
dybs23-May-09 17:21 
AnswerRe: Aliens stole my toolStrip, please help :'( Pin
molesworth24-May-09 0:34
molesworth24-May-09 0:34 
NewsVideos offer devs first look at Windows 7 Pin
brucedkyle21-May-09 8:45
brucedkyle21-May-09 8:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.