mouse pozisyonu
Tarih
04/05/2012 13:01
Konu Sahibi
accessman
Yorumlar
0
Okunma
1029
Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 5
  • 4
  • 3
  • 2
  • 1

Derecelendirme: 0/5 - 0 oy



accessman

Kullanici Avatari
Onursal
2.367
31/10/2008
425
Denizli
Ofis 2003
20/09/2016,00:20

Kod:
1
2
3
4
5
6
7
8
9
10
11
12
Option Explicit
Private Type POINTAPI
 x As Long
 y As Long
End Type

Private Declare Function ClientToScreen Lib "user32" _
(ByVal hwnd As Long, lpPoint As POINTAPI) As Long

Private Declare Function SetCursorPos Lib "user32" _
(ByVal x As Long, ByVal y As Long) As Long
[code]

Kod:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Public Function SetCursorPosition(Window As Object, xPos As _
Long, yPos As Long) As Boolean

'AUTHOR: FreeVBCode.com (http://www.freevbcode.com)

'Usage: Window = window for which you want
'to set the cursof for (form or control)

'window must support hwnd property; function will
'return false if it doesn't (e.g., won't work
'with labels)

'x = xPosition in twips
'y = yPosition in twips

'if you are not using twips as your scale mode
'you must convert the value to pixels from your
'metric. There is a function on FreeVBCode.com
'that does this, under the System/API
'category

On Error GoTo errorhandler

Dim x As Long, y As Long
Dim lRet As Long
Dim lHandle As Long
Dim typPoint As POINTAPI

lHandle = Window.hwnd
With Screen
 x = CLng(xPos / .TwipsPerPixelX)
 y = CLng(yPos / .TwipsPerPixelY)
End With
 
typPoint.x = x
typPoint.y = y

lRet = ClientToScreen(lHandle, typPoint)
lRet = SetCursorPos(typPoint.x, typPoint.y)


SetCursorPosition = (lRet <> 0)

Exit Function

errorhandler:

SetCursorPosition = False
Exit Function


End Function

@benbendedeilem
Cevapla







Konuyu Okuyanlar: 1 Ziyaretçi


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Tarih Son Yorum
  Mouse ile Tıklanan Yerde Resim Açılması ercansahin 15 4.266 16/01/2016, 23:08 ferit39
  mouse pozisyonu accessman 2 960 05/05/2012, 21:40 DUAYEN
  Mouse kilitle accessman 0 888 04/05/2012, 16:30 accessman
Bug Mouse nerede ise orada form açılsın Yandemir 7 1.580 15/02/2011, 01:35 ercansahin
  Mouse imleci - El ( 2003 için ) okileturc 2 1.960 02/02/2011, 07:07 benremix


Türkçe Çeviri: MCTR, Forum Yazılımı: MyBB, © 2002-2016 MyBB Group.
DMCA.com Protection Status
© Desing by XSTYLED| Develops by ozanakkaya