Bütün kodları ( en üste deklerasyonlar olmak üzere ) UserForm kod sayfasına ekleyin.
- Kod: Tümünü seç
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal Y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetActiveWindow Lib "user32.dll" () As Long
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Private Const EVN_TASINMA = &H2 '
Private Const EVN_BOYUTLANMA = &H1 '
Private Const EVN_STIL = (-20) '
Private Const EVN_UST = 0 '
Private Const EVN_AKTIFDEGIL = &H10 '
Private Const EVN_GIZLE = &H80 '
Private Const EVN_GOSTER = &H40 '
Private Const EVN_PENCERE = &H40000 '
Private Const EVN_STILI = (-16) '
Private Const EVN_KUCULTBUTON = &H20000 '
Private Const EVN_BUYUTBUTON = &H10000 '
Private Const EVN_DEGIS = &H20 '
Dim hWnd As Long, WSTILI As Long, SONUC As Long
- Kod: Tümünü seç
Function KucultButonuEkle() As Long
hWnd = GetActiveWindow
Call SetWindowLong(hWnd, EVN_STILI, _
GetWindowLong(hWnd, EVN_STILI) Or EVN_KUCULTBUTON)
Call SetWindowPos(hWnd, 0, 0, 0, 0, 0, _
EVN_DEGIS Or EVN_TASINMA Or EVN_BOYUTLANMA)
End Function
- Kod: Tümünü seç
Function BuyutButonuEkle() As Long
hWnd = GetActiveWindow
Call SetWindowLong(hWnd, EVN_STILI, _
GetWindowLong(hWnd, EVN_STILI) Or EVN_BUYUTBUTON)
Call SetWindowPos(hWnd, 0, 0, 0, 0, 0, _
EVN_DEGIS Or EVN_TASINMA Or EVN_BOYUTLANMA)
End Function
- Kod: Tümünü seç
Function GorevCubugundaGoster(Formum) As Long
hWnd = FindWindow(vbNullString, Formum.Caption)
WSTILI = GetWindowLong(hWnd, EVN_STIL)
WSTILI = WSTILI Or EVN_PENCERE
SONUC = SetWindowPos(hWnd, EVN_UST, 0, 0, 0, 0, _
EVN_TASINMA Or EVN_BOYUTLANMA Or EVN_AKTIFDEGIL Or EVN_GIZLE)
SONUC = SetWindowLong(hWnd, EVN_STIL, WSTILI)
SONUC = SetWindowPos(hWnd, EVN_UST, 0, 0, 0, 0, _
EVN_TASINMA Or EVN_BOYUTLANMA Or EVN_AKTIFDEGIL Or EVN_GOSTER)
End Function
- Kod: Tümünü seç
Private Sub UserForm_Activate()
KucultButonuEkle
BuyutButonuEkle
Call GorevCubugundaGoster(Me)
End Sub