disabling

hi all,

is there a way to programatically disable certain menu items of programs
like MSWORD,EXCEL etc, or even for MSPAINT, NOTEPAD???

Here is what I want to do…

If the user has certain provileges then some optins like Print would be
enabled, else not.

How to do it, may be by hooking, dll injection etc, any technique???

bedanto

May I know what you are trying to develop?

Because what I sense is that you will end up in the same mess as one guy
once landed who was trying to prevent a user (based on previledges) from
copying some document or its part.

If menu Items is your only concern then yes they can be disabled! but what
about accelarator keys (Ctrl + P)?

There’s a thing called google if you haven’t heard of it before…
NTDEV is a driver dev list; not intended for userland apps in case you
missed that little item.

If you don’t know how to search the internet, don’t know how to locate
information in the sdk, msdn ect., just hire a programmer and stop
playing dress-up.

Bedanto wrote:

hi all,

is there a way to programatically disable certain menu items of
programs like MSWORD,EXCEL etc, or even for MSPAINT, NOTEPAD???

Here is what I want to do…

If the user has certain provileges then some optins like Print would
be enabled, else not.

How to do it, may be by hooking, dll injection etc, any technique???

bedanto

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 You are currently
subscribed to ntdev as: unknown lmsubst tag argument: ‘’ To
unsubscribe send a blank email to xxxxx@lists.osr.com

i sm judt trying to develop this little thing…

May I know what you are trying to develop?

Because what I sense is that you will end up in the same mess as one guy
once landed who was trying to prevent a user (based on previledges) from
copying some document or its part.

Define proper object ACL, in most cases, you needn’t write code.
Don’t care about how application take care of menu.

best regards,
Lu Lin
TTC senior engineer
http://ttcone.com
Inside Programming
http://lu0.126.com
----- Original Message -----
From: Bedanto
To: Windows System Software Devs Interest List
Sent: Friday, January 06, 2006 5:14 PM
Subject: [ntdev] disabling

hi all,

is there a way to programatically disable certain menu items of programs like MSWORD,EXCEL etc, or even for MSPAINT, NOTEPAD???

Here is what I want to do…

If the user has certain provileges then some optins like Print would be enabled, else not.

How to do it, may be by hooking, dll injection etc, any technique???

bedanto

— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank email to xxxxx@lists.osr.com

  1. get the menu handle
  2. getteh count of the number of items.
  3. use RemoveMenu to remove the item you want.

Use google…

http://ryanfarley.com/blog/archive/2004/04/12/526.aspx

>Define proper object ACL, in most cases, you needn’t write code.

Don’t care about how application take care of menu.

can you please explain wrt MSpaint, how this can be done…

  1. Send WM_GETHMENU to the menu window of MS Paint (you can Identify menu
    window by its class)
  2. This will return you the hMenu of that menu, now there exists a whole
    bunch of API (reffer to MSDN™ and Windows Platform SDK™) to do
    anything else?

Now plz dont tell me you need me to post code to do this also :wink:
(BTW jus kidding you can ask it if you want!)

On 1/6/06, Bedanto wrote:
>
> >Define proper object ACL, in most cases, you needn’t write code.
> >Don’t care about how application take care of menu.
>
> can you please explain wrt MSpaint, how this can be done…
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 You are currently subscribed
> to ntdev as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank
> email to xxxxx@lists.osr.com


Ankit Raizada
Room No. 349
Boys Hostel
IIITA Campus
Deoghat Jhalwa
Allahabad - 211012
Email: xxxxx@iiita.ac.in
xxxxx@yahoo.com
xxxxx@gmail.com

Sorry the message is MN_GETMENU (0x1E1)

On 1/6/06, Ankit Raizada wrote:
>
> 1. Send WM_GETHMENU to the menu window of MS Paint (you can Identify menu
> window by its class)
> 2. This will return you the hMenu of that menu, now there exists a whole
> bunch of API (reffer to MSDN™ and Windows Platform SDK™) to do
> anything else?
>
> Now plz dont tell me you need me to post code to do this also :wink:
> (BTW jus kidding you can ask it if you want!)
>
>
>
> On 1/6/06, Bedanto wrote:
> >
> > >Define proper object ACL, in most cases, you needn’t write code.
> > >Don’t care about how application take care of menu.
> >
> > can you please explain wrt MSpaint, how this can be done…
> > — Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256 You are currently subscribed
> > to ntdev as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank
> > email to xxxxx@lists.osr.com
>
>
>
>
> –
> Ankit Raizada
> Room No. 349
> Boys Hostel
> IIITA Campus
> Deoghat Jhalwa
> Allahabad - 211012
> Email: xxxxx@iiita.ac.in
> xxxxx@yahoo.com
> xxxxx@gmail.com
>


Ankit Raizada
Room No. 349
Boys Hostel
IIITA Campus
Deoghat Jhalwa
Allahabad - 211012
Email: xxxxx@iiita.ac.in
xxxxx@yahoo.com
xxxxx@gmail.com

> can you please explain wrt MSpaint, how this can be done…

No.

This is a KERNEL DRIVER development group. This is NOT a beginning user
basic user programming group.

What you want to do is normally done with standard windows security settings
that are designed to lock down a machine. Go find msdn and read about
security.

Loren

well, I really dont mind if u post the code :slight_smile: :slight_smile: :slight_smile: :slight_smile: