Jump to content
Sign in to follow this  
Merchants

finder tool control

Recommended Posts

I found this

but how do i use it? can u maby make a simple script:

Drag the cursor over a program and bring me back a msgbox with the Titel+WinHandle

all i need..

Global Const $OCR_APPSTARTING = 32650
Global Const $OCR_NORMAL = 32512
Global Const $OCR_CROSS = 32515
Global Const $OCR_HAND = 32649
Global Const $OCR_IBEAM = 32513
Global Const $OCR_NO = 32648
Global Const $OCR_SIZEALL = 32646
Global Const $OCR_SIZENESW = 32643
Global Const $OCR_SIZENS = 32645
Global Const $OCR_SIZENWSE = 32642
Global Const $OCR_SIZEWE = 32644
Global Const $OCR_UP = 32516
Global Const $OCR_WAIT = 32514

;~ _SetCursor(@WindowsDir & "cursors3dgarro.cur", $OCR_NORMAL)
;~ _SetCursor(@WindowsDir & "cursors3dwarro.cur", $OCR_NORMAL)
_SetCursor(@WindowsDir & "cursorsbanana.ani", $OCR_NORMAL)

;==================================================================
; $s_file - file to load cursor from
; $i_cursor - system cursor to change
;==================================================================
Func _SetCursor($s_file, $i_cursor)
   Local $newhcurs, $lResult
   $newhcurs = DllCall("user32.dll", "int", "LoadCursorFromFile", "str", $s_file)
   If Not @error Then
      $lResult = DllCall("user32.dll", "int", "SetSystemCursor", "int", $newhcurs[0], "int", $i_cursor)
      If Not @error Then
         $lResult = DllCall("user32.dll", "int", "DestroyCursor", "int", $newhcurs[0])
      Else
         MsgBox(0, "Error", "Failed SetSystemCursor")
      EndIf
   Else
      MsgBox(0, "Error", "Failed LoadCursorFromFile")
   EndIf
EndFunc;==>_SetCursor
Edited by Merchants

Share this post


Link to post
Share on other sites

This example will give you the handle and title of the window below mouse when Ctrl+M is pressed

#include <WinAPI.au3>

HotKeySet("{ESC}", "Close") ; Set ESC as a hotkey to exit the script.

HotKeySet("^m", "Example") ; Set Hotkey Ctrl+M

Global $tStruct = DllStructCreate($tagPOINT) ; Create a structure that defines the point to be checked.

Example()

Func Example()
Local $hWnd
ToolTip("")
Position() ; Update the X and Y elements with the X and Y co-ordinates of the mouse.
$hWnd = _WinAPI_WindowFromPoint($tStruct) ; Retrieve the window handle.
MsgBox(64, 'Information', 'Title:' & WinGetTitle($hWnd) & @CRLF & ' hWnd:' & $hWnd) ; Popup the Msgbox
EndFunc   ;==>Example

Func Position()
DllStructSetData($tStruct, "x", MouseGetPos(0))
DllStructSetData($tStruct, "y", MouseGetPos(1))
EndFunc   ;==>Position

Func Close()
Exit
EndFunc   ;==>Close

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...