< návrat zpět
MS Excel
Téma: Zamknout pozici formu
Zaslal/a Fantasyk 15.12.2021 21:45
Zdravím,
jde zamknout pozici, aby sní nešlo hýbat?
Dík
StrejdaPompo(20.12.2021 9:13)#051782 Ano, určitě to jde.
citovat
Fantasyk(20.12.2021 20:00)#051784 StrejdaPompo napsal/a:
Ano, určitě to jde.
Už jsem na to přišel:
Option Explicit
Private Declare PtrSafe Function GetSystemMenu Lib "USER32" _
(ByVal hWnd As Long, _
ByVal bRevert As Long) As Long
Private Declare PtrSafe Function RemoveMenu Lib "USER32" _
(ByVal hme2nu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Private Declare PtrSafe Function FindWindowA Lib "USER32" _
(ByVal lpClassName2 As String, _
ByVal lpWindowName2 As String) As Long
Private Const MF_BYPOSITION As Long = &H400
Public Sub FormatUserForm(UserFormCaption As String)
Dim lFrmHdl As Long
Dim iCount As Integer
lFrmHdl = FindWindowA(vbNullString, UserFormCaption)
If lFrmHdl <> 0 Then
For iCount = 0 To 1
RemoveMenu GetSystemMenu(lFrmHdl, False), 0, MF_BYPOSITION
Next iCount
End If
End Sub
a pak
Call FormatUserForm(Me.Caption)
citovat