- Katılım
- 5 Kasım 2006
- Mesajlar
- 602
- Excel Vers. ve Dili
- TÜRKCE Excel 2021 32bit
Merhaba.
Alttaki kod ile userforma büyütme ve küçültme işareti geliyor üst sağ çarpının oraya.
Ve küçültme işaretine basınca görev çubuğuna iniyor ve orda userform görüküyor.
Benim yapamadığım userformun açılışında userformun kaybolması ve görevçubuğunda görünür durması.
me.hide işe yaramdı.Bunu ekleyine görevçubuğunda görükmüyor.
https://www.dropbox.com/s/f4biyswwbdhqxz1/Userform Görev cubuk.xlsm?dl=0
Alttaki kod ile userforma büyütme ve küçültme işareti geliyor üst sağ çarpının oraya.
Ve küçültme işaretine basınca görev çubuğuna iniyor ve orda userform görüküyor.
Benim yapamadığım userformun açılışında userformun kaybolması ve görevçubuğunda görünür durması.
me.hide işe yaramdı.Bunu ekleyine görevçubuğunda görükmüyor.
https://www.dropbox.com/s/f4biyswwbdhqxz1/Userform Görev cubuk.xlsm?dl=0
PHP:
#If Win64 Then
Private Declare PtrSafe Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare PtrSafe 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 PtrSafe Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare PtrSafe Function GetActiveWindow Lib "user32.dll" () As Long
Private Declare PtrSafe 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 PtrSafe Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
#Else
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
#End If
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 '
Private hwnd As Long
Private WSTILI As Long
Private SONUC As Long
Private 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
Private 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
Private 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
Private Sub UserForm_Activate()
KucultButonuEkle
BuyutButonuEkle
Call GorevCubugundaGoster(Me)
' Me.Left = Application.Left
' Me.Top = Application.Top
' Me.Height = Application.Height
' Me.Width = Application.Width
End Sub