|
-
Jul 10th, 2000, 06:16 PM
#1
Thread Starter
Junior Member
Im just wondering how I would be able to change every windows caption running in windows except WINDOWS EXPLORER to "hello world!"
I also would like to learn the Mousemove effect.
thanks,
-
Jul 10th, 2000, 06:30 PM
#2
transcendental analytic
Code:
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Type POINTAPI
X As Long
Y As Long
End Type
Property Get cursorX() As Integer
Dim pnt As POINTAPI
temp = GetCursorPos(pnt)
cursorX = pnt.X
End Property
Property Let cursorX(newvalue%)
temp = SetCursorPos(newvalue, cursorY)
End Property
Property Get cursorY() As Integer
Dim pnt As POINTAPI
temp = GetCursorPos(pnt)
cursorY = pnt.Y
End Property
Property Let cursorY(newvalue%)
temp = SetCursorPos(cursorX, newvalue)
End Property
With this in a module you can use cursorX and cursorY properties for setting and getting mouse position
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 10th, 2000, 06:51 PM
#3
transcendental analytic
And for the other part
put this in a module:
Code:
Private Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Private handles&(), counter&
Private Function EnmWinProc(ByVal hWnd As Long, ByVal lParam As Long) As Long
Dim sCaption As String * 255
ReDim Preserve handles(counter)
handles(counter) = hWnd
counter = counter + 1
EnumWindowsProc = hWnd
End Function
Public Function GetWindows()
ReDim handles(0)
counter = 0
Call EnumWindows(AddressOf EnmWinProc, 0&)
ListWindows = handles
End Function
And in the file you want to change all captions of all windows:
Code:
'In declarations
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String) As Long
'In code
Dim n As Long
For Each n In GetWindows
SetWindowText n, "hello world!"
Next n
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 11th, 2000, 12:36 PM
#4
Thread Starter
Junior Member
there is one problam with the hello world,
the code. says it "for each control variable must be Variant or object"
--------
'In code
Dim n As Long
For Each n In GetWindows
SetWindowText n, "hello world!"
Next n
--------
I looked at the help, nothing much, how can you solve this?
-
Jul 11th, 2000, 04:23 PM
#5
transcendental analytic
Sorry about that, i couldn't test it since it would change all my important windows...
Code:
'Change
Dim n As Long
'To
Dim n As Variant
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 11th, 2000, 07:44 PM
#6
Thread Starter
Junior Member
Thank you kedaman, I am starting to see how to use the AddressOf property and how API functions with the handles.
Thank you very much.
MR MO WHA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|