AW: Maus auf Button legen ?
09.08.2009 19:30:16
Tino
Hallo,
vielleicht geht es so, es muss nur wegen des Textes noch eine Korrektur eingegeben werden.
Leider weiß ich keine Lösung um die Maße der Msg zu bestimmen, weil während der Anzeige keine Makros laufen.
Da müsste man schon mit externer Hilfe arbeiten, aber wie gesagt dazu habe ich keine Lösung.
Option Explicit
Private Declare Function SetCursorPos Lib "user32" _
(ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
Private Type Maus_Pos
X As Long
Y As Long
End Type
Sub test()
Dim Maus As Maus_Pos
' X=Horizontal, Y=Vertikal
Maus.X = GetSystemMetrics(0) / 2
Maus.Y = GetSystemMetrics(1) / 2
'Position Mitte + eine Korrektur
SetCursorPos Maus.X + 30, Maus.Y + 50
MsgBox "Hallo das ist ein Test", vbOKOnly
End Sub
Gruß Tino