Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

20 Eylül 2005 Salı

UserForm Icon


'UserForm1
'AddTools on UserForm1: Image1, Label1
'Image1 Picture: Your *.ico file...
Option Explicit
Dim Ekran As New Class1

Private Sub UserForm_Initialize()
On Error Resume Next
Me.Caption = "[PBİD®] UserForm Icon..."
Application.Visible = False
End Sub
Private Sub UserForm_Activate()
On Error Resume Next
Set Ekran.Simge_Ekle = Me
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
On Error Resume Next
Application.Visible = True
End Sub
'Class1

Option Explicit
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 Pencere As Long, Tercih As Long, FIcon As Long, Tarz As Long, Sonuç As Long

Public Property Set Simge_Ekle(ByVal Ekran As Object)
On Error Resume Next
FIcon = Ekran.Label1.Picture.Handle
Pencere = FindWindow(vbNullString, Ekran.Caption)
Tercih = SendMessage(Pencere, &H80, 0&, ByVal FIcon)
Tercih = SendMessage(Pencere, &H80, 1&, ByVal FIcon)
Tercih = DrawMenuBar(Pencere)
Tarz = GetWindowLong(Pencere, (-20))
Tarz = Tarz Or &H40000
Sonuç = SetWindowPos(Pencere, 0, 0, 0, 0, 0, &H2 Or &H1 Or &H10 Or &H80)
Sonuç = SetWindowLong(Pencere, (-20), Tarz)
Sonuç = SetWindowPos(Pencere, 0, 0, 0, 0, 0, &H2 Or &H1 Or &H10 Or &H40)
End Property

10 Eylül 2005 Cumartesi

Useful Class1

'Class1

Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function GetWindowLongA Lib "user32" (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 SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Const WS_BORDER = &H800000
Private Const GWL_STYLE = (-16)
Dim hWndForm As Long
Dim hwnd As Long, FormStyle As Long
Dim StartTime As String
Dim frmStyle As Long
Dim i As Integer

Public Property Set Form1(objForm As Object)
hWndForm = FindWindow(vbNullString, objForm.Caption)
frmStyle = GetWindowLong(hWndForm, (-16)) Or &H80000 Or &H20000 Or &H10000
SetWindowLong hWndForm, (-16), frmStyle
ShowWindow hWndForm, 3
DrawMenuBar hWndForm
End Property
Public Property Set Form2(objForm As Object)
hwnd = FindWindowA(vbNullString, objForm.Caption)
frmStyle = GetWindowLong(hwnd, (-16)) Or &H80000 Or &H20000 Or &H10000
SetWindowLong hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) And Not WS_BORDER
ShowWindow hwnd, 5
DrawMenuBar hwnd
End Property
Public Property Set Form3(objForm As Object)
Dim hwnd As Long
hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", İlerleme_Formu.Caption)
SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And &HFFF7FFFF
End Property
Public Property Set Form4(objForm As Object) 'Kapat yok
hWndForm = FindWindow(vbNullString, objForm.Caption)
frmStyle = GetWindowLong(hWndForm, (-16)) And &HFFF7FFFF
SetWindowLong hWndForm, (-16), frmStyle
ShowWindow hWndForm, 5
DrawMenuBar hWndForm
End Property
Public Property Set Form5(objForm As Object) 'Kapat işlevsiz
hWndForm = FindWindow(vbNullString, objForm.Caption)
frmStyle = GetWindowLong(hWndForm, (-16)) And &HFFF7FFFF
SetWindowLong hWndForm, (-16), frmStyle
End Property

1 Eylül 2005 Perşembe

SENDKEY Method


'Module1

Sub SENDKEY_File()
On Error Resume Next
Application.SendKeys ("%fx")
End Sub
Sub SENDKEY_Edit()
On Error Resume Next
Application.SendKeys ("%ex")
End Sub
Sub SENDKEY_View()
On Error Resume Next
Application.SendKeys ("%vx")
End Sub
Sub SENDKEY_Insert()
On Error Resume Next
Application.SendKeys ("%ix")
End Sub
Sub SENDKEY_Format()
On Error Resume Next
Application.SendKeys ("%ox")
End Sub
Sub SENDKEY_Debug()
On Error Resume Next
Application.SendKeys ("%dx")
End Sub
Sub SENDKEY_Run()
On Error Resume Next
Application.SendKeys ("%rx")
End Sub
Sub SENDKEY_Tools()
On Error Resume Next
Application.SendKeys ("%tx")
End Sub
Sub SENDKEY_Add_Ins()
On Error Resume Next
Application.SendKeys ("%ax")
End Sub
Sub SENDKEY_Window()
On Error Resume Next
Application.SendKeys ("%wx")
End Sub
Sub SENDKEY_Help()
On Error Resume Next
Application.SendKeys ("%hx")
End Sub

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul