Solved

Diable Common file items

Posted on 1998-09-12
16
149 Views
Last Modified: 2012-05-04
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
Comment
Question by:naallen
  • 6
  • 6
  • 2
  • +1
16 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1434556
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
 
LVL 10

Expert Comment

by:viktornet
ID: 1434557
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
 
LVL 10

Expert Comment

by:viktornet
ID: 1434558
Are you using C++ Builder???
0
 
LVL 5

Expert Comment

by:dirtdart
ID: 1434559
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
 
LVL 10

Expert Comment

by:viktornet
ID: 1434560
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
 

Author Comment

by:naallen
ID: 1434561
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
 
LVL 5

Expert Comment

by:dirtdart
ID: 1434562
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
 

Author Comment

by:naallen
ID: 1434563
By his request.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:naallen
ID: 1434564
By his request.
0
 

Expert Comment

by:bennys
ID: 1434565
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
 

Author Comment

by:naallen
ID: 1434566
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
 

Accepted Solution

by:
bennys earned 100 total points
ID: 1434567
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
 
LVL 10

Expert Comment

by:viktornet
ID: 1434568
I told you what to do...Assign a dummy popup menu to the diaolgs' system menu.....

//Viktor
0
 

Author Comment

by:naallen
ID: 1434569
Victor, does this work for all dialog boxes calling file fuctions?
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1434570
Yes, it works if you have create the app.....This disables the system menu only to your app...

//Vik
0
 

Author Comment

by:naallen
ID: 1434571
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now