WM_VSROLL and WM_HSCROLL for MDI Client
Hello Andrew,
in my curent Desktop-Project I use dzEvent_Magic to get x- and y- scroll position from the scrollbars, of an MDI Client, which is set to Autoscroll like this:
#Region BuildFormEx3
AddForm("Form3", "Report")
FormEx3.New2("Form3","Report",600,600)
AddImage("Form3", "ImageF", 580, 580, 20, 20)
FormEx3.AddControl("ImageF")
AddImage("Form3", "ImageB", 580, 560, 20, 20)
FormEx3.AddControl("ImageB")
AddImage("Form3", "ImageZF", 580, 540, 20, 20)
FormEx3.AddControl("ImageZF")
AddImage("Form3", "ImageZB", 580, 520, 20, 20)
FormEx3.AddControl("ImageZB")
AddImage("Form3", "VLinImage", 15, 0, 15, 15)
FormEx3.AddControl("VLinImage")
AddImage("Form3", "HLinImage", 0, 15, 15, 15)
FormEx3.AddControl("HLinImage")
FormEx3.StartPosition = 0
FormEx3.WindowState = 0
FormEx3.ImageLayout = 0
frm3obj.FromControl(FormEx3.ControlRef)
frm3obj.SetProperty("AutoScroll", True)
dzem.New1(FormEx3.ControlRef, False)
dzem.Hook(276) 'WM_HSCROLL
dzem.Hook(277) 'WM_VSCROLL
hscrollobj.value = frm3obj.GetProperty("HorizontalScroll") ' returns an HScrollProperties type
hscrollobj.SetProperty("LargeChange", 100)
vscrollobj.value = frm3obj.GetProperty("VerticalScroll") ' returns an VScrollProperties type
vscrollobj.SetProperty("LargeChange", 100)
#End Region
The events are catched by this Sub(It's from an example in the Forum I didn't fin again):
Sub dzem_MagicEvent ' notice we seem to get two events for every scoll action!
msg1 = dzem.msg
Select msg1
Case 276
If Htoggle Then
ScrX = hscrollobj.GetProperty("Value")
IDebug.Text = FormEx3.ClientAreaHeight 'ScrXMax -
IScrolX.Text = ScrX
VLinImage.Left = (ScrX/(FormEx3.ClientAreaWidth-15))
VLinImage.BringToFront
End If
Htoggle = Not(Htoggle)
Case 277
If Vtoggle Then
ScrY = vscrollobj.GetProperty("Value")
IScrolY.Text = ScrY
HLinImage.Top = (ScrY/(FormEx3.ClientAreaHeight-15))-1
HLinImage.BringToFront
End If
Vtoggle = Not(Vtoggle)
End Select
End Sub
Is it possible to realize it with WindowsMessageDesktop.dll too?
I put the whole Project to this post too. It's buggie but it has been compieled(Desktop)
To see the window you have to click the Menue "Report", "Neu"
It would be verry nice, if it is possible, because the dzt dll is not mergeable.
Best Regards
berndgoedecke