Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to remove the controls from the Access bar 1

Status
Not open for further replies.

HJessen

Technical User
Dec 18, 2002
39
US
When I open my db frontend, I have a startup screen, and then a switchboard where the users can select whcih forms or reports they want/need. Even thought I have made a menu bar that is blank, and removed all other menu bars from the application, the "minimize", "restore" and "close" buttons still show in the upper right corner.

Is there anyway to disable these features? I want the user to exit via a routine I have built that logs their entry and exit, but if they "X" out, I get no data.

Thanks. H. Jessen
"Now I know more, and I feel dummer"
 
You can do this using a few API calls, paste the following into a global module:

Declare Function GetActiveWindow Lib "user32" () As Integer
Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Integer, ByVal bRevert As Integer) As Integer
Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer

Public Const SC_RESTORE = &HF120
Public Const SC_MAXIMIZE = &HF030
Public Const SC_MINIMIZE = &HF020
Public Const SC_CLOSE = &HF060
Public Const MF_BYCOMMAND = &H0&

Paste the following into the "on load" event of your startup screen.

Call DeleteMenu(GetSystemMenu(GetActiveWindow, False), SC_CLOSE, MF_BYCOMMAND)
Call DeleteMenu(GetSystemMenu(GetActiveWindow, False), SC_MAXIMIZE, MF_BYCOMMAND)
Call DeleteMenu(GetSystemMenu(GetActiveWindow, False), SC_MINIMIZE, MF_BYCOMMAND)
Call DeleteMenu(GetSystemMenu(GetActiveWindow, False), SC_RESTORE, MF_BYCOMMAND)

This will grey the x and disable the mimimize, maximize and restore features.

 
Thank You!

I will have to do a little reading about global modules, but I think I can do it from here.

Again, Thank You!

THIS IS A GREAT FORUM FOR HELP! I WOULD NEVER HAVE GOTTEN THIS PROJECT DONE WITHOUT THE HELP OF THE PEOPLE HERE! H. Jessen
"Now I know more, and I feel dummer"
 
My using the term "Global Module" was probably misleading.

Creating a Module is the same procedure as creating a Table or Form etc.

Click on Modules in the Database Wwindow, click on new, paste the 1st block of code above into it, save it as any name you want. That's it!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top