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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing Close Button from Main Access Window?

Status
Not open for further replies.

huskerdon

Programmer
Aug 26, 2002
67
US
Hi Access experts,

Just a quick question - I've been looking all over trying to find an answer, but haven't so far. Is there any way to modify the Control Box for the Main Access Application window ("Omain") ?

I'm using the FindWindow and SetWindowPos api's to limit the Main window to 1024 x 768, and center it on the user's screen, regardless of their actual screen resolution. This part is working great, and it allows me to use Docmd.Maximize on all forms without exceeding 1024 x 768.

My question is, how can I remove the "X" from the Main window (or control it in code), to prevent users from closing the entire database accidentally? I know how to limit the min, max, and close buttons on individual forms, but haven't found anything that talks about the Main Application itself. Any help would be greatly appreciated!
 
I think this is perhaps two different questions?
1 - how to hide the x button
2 - how to control the closing of access

anyway, here's a discussion addressing both thread702-831433.

Roy-Vidar
 
RoyVidar,

Thanks for the thread. I had already tried experimenting with the SetWindowLong api using GWL_STYLE, etc. It removes the "X" but also removes the Min and Max buttons. I need the Min button to stay on the main window's title bar.

Is there no way in code to trap the click in the Control Box of the main window?

If not, I'll leave it as is, and warn users to not click the "X" on the Main Access window.
 
Then someone else must pop in, I only use #2;-)
(ALT+F4, CTRL+F4, CTRL+W...)

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top