Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
SQL Server 2000/2005/2008, Express, Access, MySQL, Oracle
Togliere chiusura X da finestra maschera di access
lunedì 04 aprile 2011 - 15.52
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
Elenco Tags
Windows XP
|
Access (.mdb)
|
Office 2003
teocartu
Profilo
| Newbie
8
messaggi | Data Invio:
lun 4 apr 2011 - 15:52
Buongiorno, non sono affatto esperto di access e vorrei sapere come fare per togliere la X di chiusura dalle finestre delle maschere di access.
Girovagando su internet, sono riuscito a farlo per la finestra di access principale, creando il seguente modulo (totalmente copiato):
"
Option Compare Database
Public Const WM_NCPAINT = &H85
Public Const GWL_STYLE = (-16)
Public Const WS_SYSMENU = &H80000
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, _
ByVal bRevert As Long) As Long
Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Public Function ShowAccessCloseBtn(ShowIt As Boolean)
Dim mhWnd As Long
Dim lngOldStyle As Long
Dim lngNewStyle As Long
mhWnd = Application.hWndAccessApp
' Get the current window style of the form.
lngOldStyle = GetWindowLong(mhWnd, GWL_STYLE)
If ShowIt Then
' Turn on the bit that enables system menu.
lngNewStyle = lngOldStyle Or WS_SYSMENU
Else
' Turn off the bit the shows the system menu.
lngNewStyle = lngOldStyle And Not WS_SYSMENU
End If
Call RemoveItem(mhWnd)
' Set the new window style.
Call SetWindowLong(mhWnd, GWL_STYLE, lngNewStyle)
' The 1 as the third parameter tells
' the window to repaint its entire border.
Call SendMessage(mhWnd, WM_NCPAINT, 1, 0)
ExitHere:
Exit Function
HandleErrors:
Select Case Err.Number
Case Else
MsgBox Err.Number & " " & Err.Description
End Select
Resume ExitHere
End Function
Private Sub RemoveItem(hwnd As Long)
Dim hMnu, y, i
Const MF_BYPOSITION As Long = 1024
Const MF_GRAYED As Long = 1
Const MF_DISABLED As Long = 2
hMnu = GetSystemMenu(hwnd, 0)
For i = 6 To 0 Step -1
y = RemoveMenu(hMnu, i, MF_BYPOSITION)
Next i
End Sub
"
e richiamandola poi all'apertura della maschera "menù principale".
Vorrei fare però la stessa cosa anche per le finestre delle maschere stesse e non so assolutamente come fare.
Pregandovi di cercare di essere il più chiari possibili causa la mia ignoranza, ringrazio chiunque riesca a rispondermi.
Matteo
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !