[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Diable Common file items

I'm writing a program in which I must have the delete, rename, cut, copy, paste items disabled/tracked so that I can keep the user from doing these actions. How Can I do this in vb5 or C++?
0
naallen
Asked:
naallen
  • 6
  • 6
  • 2
  • +1
1 Solution
 
viktornetCommented:
I've got a Delphi code, for this but don't know how to do it in VB/C++

Actually if you have C++ Builder I can show you how to do that....

Regards,
Viktor Ivanov
0
 
viktornetCommented:
Would you please tell me what's pointer that points to nothing ...in Delphi that would be NIL
In C++ that would be NULL....what about in C++ Builder...is it NULL??

Regards,
Viktor Ivanov
0
 
viktornetCommented:
Are you using C++ Builder???
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dirtdartCommented:
Declare Function GetSystemMenu Lib "user32" Alias "GetSystemMenu" (ByVal hwnd As Long, ByVal bRevert As Long) As Long

Declare Function EnableMenuItem Lib "user32" Alias "EnableMenuItem" (ByVal hMenu As Long, ByVal wIDEnableItem As Long, ByVal wEnable As Long) As Long

Use GetSystemMenu to get a handle to the system menu that pops up on right click.  Once you've gotten the handle, Use EnableMenuItem with wEnable set to MF_DISABLED to disable the menu.
0
 
viktornetCommented:
Create a PopUp menu and do this.......
to disable the system menu use this,,,,

Form.PopUpMenu = YourComponentMenu

to enable it use this....

Form.PopUpMenu = null

Regards,
Viktor Ivanov
0
 
naallenAuthor Commented:
Dirtdart, please provide an example of the enableMenuItem line and explain to me what the index numbers for the items to be disabled are.
0
 
dirtdartCommented:
I'm sorry.  Please reject my answer.  I didn't fully test it before posting.  Tehcnically, the calls will work to disable the system menu, but there is no way to capture the system menu popping up (that I can find) from VB.  The click event is not fired when the user right clicks and brings up the system menu, and the MouseUp event doesn't fire until the system menu disappears.  Wish I could help you more.
0
 
naallenAuthor Commented:
By his request.
0
 
naallenAuthor Commented:
By his request.
0
 
bennysCommented:
can you give some more details ?
do you want to display a file list ? explorer-like ?
what do you want to prevent the user from doing ?
(opening a pop-up menu ? pressing DEL ? )
0
 
naallenAuthor Commented:
i want to keep the user from seeing the right click in explorer dialog boxes, or anything that accesses file functions. If possible, I would like the whole function disabled.
0
 
bennysCommented:
you can't do that through the common dialog control.
(a small tour in its documentation will tell you that.)
the best solution i see is to write this dialog yourself.
its not that much work and you can control anything there.
if you do that , you can also limit the dialog to the only
features you need there.
0
 
viktornetCommented:
I told you what to do...Assign a dummy popup menu to the diaolgs' system menu.....

//Viktor
0
 
naallenAuthor Commented:
Victor, does this work for all dialog boxes calling file fuctions?
0
 
viktornetCommented:
Yes, it works if you have create the app.....This disables the system menu only to your app...

//Vik
0
 
naallenAuthor Commented:
i know how to do that, but how do i diable the same functions globally? In anything that calls them. A system wide api or something.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 6
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now