Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

1 Temmuz 2007 Pazar

Look At And Description Object






'UserForm1

'A) Windows XP® Office 2003® Normal Referance List
'Visual Basic For Aplication
'Microsoft Forms 2.0 Object Library
'Microsoft Excel 11.0 Object Library
'OLE Automation
'Microsoft Office 11.0 Object Library
'B) Windows XP® Office 2003® Auto Add Referance List
'Microsoft Common Controls 6.0 (SP6)
'C) UserForm1'e Eklenen Araçlar (Add Tools)
'Frame1
'Frame1\Image1, Label1, Label2
'Label3, Label4, Label5, Label6, Label7, Label8
Option Explicit
Private Type RECT

Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type POINTAPI

x As Long
y As Long
End Type
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal Hwnd As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal Hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal Hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount 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 FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwndParent As Long, ByVal hwndChildAfter As Long, ByVal lpszClass As String, ByVal lpszWindow As String) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal Hwnd As Long, lpRect As RECT) 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 MoveWindow Lib "user32" (ByVal Hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Sub UserForm_Initialize()

On Error Resume Next
Me.Caption = "[PBİD®] Look At And Description Object"
ThisWorkbook.VBProject.References.AddFromGuid "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}", 2, 0 'Microsoft Windows Common Controls 6.0 (SP6)
Call EkranDüzenle
End Sub
Private Sub UserForm_Activate()

On Error Resume Next
Call AraçTanımla
End Sub
Private Sub EkranDüzenle()

On Error Resume Next
With Me
             .Height = 122
             .Width = 372
             .BackColor = &H80000014
End With
With Frame1
.Caption = ""
.Top = -1
.Left = -1
.Height = 36
.Width = Me.Width + 12
.Picture = LoadPicture("D:\Mustafa ULUSARAÇ\BLOGSPOT\zarifVİSTA.bmp")
.PictureAlignment = fmPictureAlignmentTopLeft
.PictureSizeMode = fmPictureSizeModeClip
.PictureTiling = False
With Image1
.BackStyle = fmBackStyleTransparent
.BorderColor = &HFF0000
.BorderStyle = fmBorderStyleSingle
.Top = 6
.Left = 6
.Height = 24
.Width = 24
.Picture = LoadPicture("D:\Mustafa ULUSARAÇ\BLOGSPOT\Örnekİkonlar\PBİD.ico")
End With
With Label1
.Caption = " " & "Mustafa ULUSARAÇ"
.BackStyle = fmBackStyleTransparent
.BorderStyle = fmBorderStyleNone
.SpecialEffect = fmSpecialEffectFlat
.Left = 30
.Top = 6
.Height = 12
.Width = 198
.Font.Bold = True
.ForeColor = &HFF0000
End With
With Label2
.Caption = " " & "01ulusarac@superonline.com"
.BackStyle = fmBackStyleTransparent
.BorderStyle = fmBorderStyleNone
.SpecialEffect = fmSpecialEffectFlat
.Left = 30
.Top = 18
.Height = 12
.Width = 198
.Font.Bold = True
.ForeColor = &HFF0000
End With
End With
With Label3
.Caption = " Window Handle"
.Left = 6
.Top = 36
.Height = 18
.Width = 78
.SpecialEffect = 3
End With
With Label4
.Caption = " Window Name"
.Left = 6
.Top = 54
.Height = 18
.Width = 78
.SpecialEffect = 3
End With
With Label5
.Caption = " Class Name"
.Left = 6
.Top = 72
.Height = 18
.Width = 78
.SpecialEffect = 3
End With
With Label6
.Caption = ""
.Left = 84
.Top = 36
.Height = 18
.Width = 276
.SpecialEffect = 3
End With
With Label7
.Caption = ""
.Left = 84
.Top = 54
.Height = 18
.Width = 276
.SpecialEffect = 3
End With
With Label8
.Caption = ""
.Left = 84
.Top = 72
.Height = 18
.Width = 276
.SpecialEffect = 3
End With
End Sub
Sub AraçTanımla()
'Object Description

On Error Resume Next
Dim Pencere As Long
Dim Nokta As POINTAPI
Dim SonPencere As Long
Dim Adı As String
Dim Sınıfı As String
Dim Numarası As Long
Do
GetCursorPos Nokta
Pencere = WindowFromPoint(Nokta.x, Nokta.y)
If Pencere = SonPencere Then
'Default
Else
SonPencere = Pencere
Sınıfı = String(256, " ")
Numarası = GetClassName(Pencere, Sınıfı, 255)
Sınıfı = Left(Sınıfı, InStr(Sınıfı, vbNullChar) - 1)
Adı = String(GetWindowTextLength(Pencere) + 1, Chr(0))
GetWindowText Pencere, Adı, Len(Adı)
Label6.Caption = Pencere
Label7.Caption = Adı
Label8.Caption = Sınıfı
End If
DoEvents
Loop Until Me.Visible = False
End Sub

Hiç yorum yok:

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