Documente Academic
Documente Profesional
Documente Cultură
'=========================================================================
'=========================================================================
End Function
Private Function InitSubclassingThunk(ByVal hWnd As Long, pObj As Object, ByVal pfnCallback As Long) As
IUnknown
aParams(0) = ObjPtr(pObj)
aParams(1) = pfnCallback
If hThunk = 0 Then
hThunk = pvThunkGlobalData("InitSubclassingThunk")
End If
#End If
If hThunk = 0 Then
Debug.Assert pvGetIdeOwner(aParams(7))
pvThunkGlobalData("InitSubclassingThunk") = hThunk
#End If
End If
End Function
Private Property Get ThunkPrivateData(pThunk As IUnknown, Optional ByVal Index As Long) As Long
lPtr = ObjPtr(pThunk)
End If
End Property
Do
#End If
pvGetIdeOwner = True
End Function
sBuffer = String$(50, 0)
Call GetEnvironmentVariable("_MST_GLOBAL" & App.hInstance & "_" & sKey, sBuffer, Len(sBuffer) - 1)
End Property
End Property
#End If
pvUnsubclass
End If
End Sub
End Sub
Public Function SubclassProc(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal
lParam As Long, Handled As Boolean) As Long
'Dim x As Single
'Dim y As Single
'
'
' End If
Handled = True
Exit Function
End If
Dim x As Single
Dim y As Single
Case WM_LBUTTONDOWN ' UserControl message, only in design mode (Not Ambient.UserMode), to
provide change of selected tab by clicking at design time
lTab = selIndex
Handled = True
SubclassProc = 0
Exit Function
End If
' End If
' End If
End Select
Handled = False
End Function
iSM = UserControl.ScaleMode
UserControl.ScaleMode = vbTwips
GetCursorPos iPt
iWidth = -1
iWidth = iCtl.Width
MouseIsOverAContainedControl = True
Err.Clear
Exit Function
End If
End If
End If
End If
End If
Next
Err.Clear
UserControl.ScaleMode = iSM
End Function
hWnd = UserControl.hWnd
End Property
GetCursorPos Pos
End If
End Sub
Exit Sub
End If
lScrollX = lScrollX + 10
If lScrollX > lScrollWidth Then
lScrollX = lScrollWidth
RightSliderStatus = ssDisabled
tmrSlide.Enabled = False
Me.Refresh
Exit Sub
End If
LeftSliderStatus = ssNormal
Else
lScrollX = lScrollX - 10
lScrollX = 0
LeftSliderStatus = ssDisabled
tmrSlide.Enabled = False
Me.Refresh
Exit Sub
End If
RightSliderStatus = ssNormal
End If
'Draw
Me.Refresh
End Sub
End Sub
Private Sub UserControl_EnterFocus()
bInFocus = True
Me.Refresh
End Sub
bInFocus = False
Me.Refresh
End Sub
Me.Refresh
End Sub
Dim c As Long
On Error GoTo 0
mUserMode = Ambient.UserMode
mUserControlHwnd = UserControl.hWnd
mContainerHwnd = UserControl.ContainerHwnd
mUserControlHdc = UserControl.hDC
pvSubclass
CreateGraphicsDC
For c = 1 To 4
End Sub
Dim c As Long
For c = 0 To m_TabCount - 1
getTabOrder = c
Exit For
End If
Next
End Function
lTab = getTabOrder(selIndex)
NextTab:
lCount = lCount + 1
Case vbKeyLeft
End If
lTab = lTab - 1
End If
Case vbKeyRight
lTab = -1 '0
End If
lTab = lTab + 1
End If
End Select
If lTab >= 0 And lTab < m_TabCount And lCount < m_TabCount Then
GoTo NextTab:
End If
End If
lTab = m_TabOrder(lTab)
RaiseEvent TabClick(lTab)
SelectedItem = lTab
End If
End Sub
mUserControlHdc = hDC
' Draw
Me.Refresh
End Sub
selIndex = PropBag.ReadProperty("SelectedItem", 0)
m_TabCount = PropBag.ReadProperty("ItemCount", 4)
ReDim m_Tabs(m_TabCount - 1)
ReDim m_TabOrder(m_TabCount - 1)
ReDim ctlLst(m_TabCount - 1)
m_ctlCount = 0
ReDim m_Ctls(m_ctlCount)
For i = 0 To m_TabCount - 1
' m_TabOrder(I) = I
m_Ctls(m_ctlCount).ctlName = ctlName
m_Ctls(m_ctlCount).iTabIndex = i
m_ctlCount = m_ctlCount + 1
End If
Next z
Next i
ItemMax = PropBag.ReadProperty("ItemMax", 0)
For z = 0 To mCCount - 1
m_Ctls(m_ctlCount).ctlName = ctlName
m_Ctls(m_ctlCount).iTabIndex = i
m_ctlCount = m_ctlCount + 1
End If
Next z
Next
selIndex = m_TabCount - 1
End If
'' handleControls 0, selIndex
SelectedItem = selIndex
On Error GoTo 0
mUserMode = Ambient.UserMode
mUserControlHwnd = UserControl.hWnd
mContainerHwnd = UserControl.ContainerHwnd
mUserControlHdc = UserControl.hDC
pvSubclass
CreateGraphicsDC
' Draw
Me.Refresh
End Sub
'
For i = 0 To m_TabCount - 1
c=0
For z = 0 To m_ctlCount - 1
If m_Ctls(z).iTabIndex = i Then
PropBag.WriteProperty "Item(" & i & ").Control(" & c & ")", m_Ctls(z).ctlName, ""
c=c+1
End If
MaxIndex = m_Ctls(z).iTabIndex
End If
Next z
Next i
c=0
For z = 0 To m_ctlCount - 1
If m_Ctls(z).iTabIndex = i Then
PropBag.WriteProperty "Item(" & i & ").Control(" & c & ")", m_Ctls(z).ctlName, ""
c=c+1
End If
Next z
Next
End Sub
End Function
Private Sub TransBlt(ByVal hdcScreen As Long, ByVal hdcDest As Long, ByVal xDest As Long, ByVal yDest As
Long, _
ByVal xSrc As Long, ByVal ySrc As Long, ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, ByVal
clrMask As OLE_COLOR)
'=====================================================
lMaskColor = TranslateColor(clrMask)
Lib = LoadLibrary("gdi32.dll")
FreeLibrary Lib
'works on XP
GdiTransparentBlt hdcDest, xDest, yDest, nWidth, nHeight, hdcSrc, xSrc, ySrc, nWidthSrc, nHeightSrc,
lMaskColor
End If
'=====================================================
lMaskColor = TranslateColor(clrMask)
hdcScnBuffer = CreateCompatibleDC(hdcScreen)
hdcColor = CreateCompatibleDC(hdcScreen)
Call StretchBlt(hdcColor, 0, 0, nWidth, nHeight, hdcSrc, xSrc, ySrc, nWidthSrc, nHeightSrc, vbSrcCopy)
hdcMask = CreateCompatibleDC(hdcScreen)
'clear
DeleteDC hdcColor
DeleteDC hdcScnBuffer
DeleteDC hdcMask
'ReleaseDC 0, hdcScreen
End Sub