Sign in to follow this  
Followers 0
jerwin

WinApi.au3

5 posts in this topic

#1 ·  Posted (edited)

hi guys can anyone can give me an example for how to add the script WinApi.au3???

i try to understand the AutoIt help description but still i get confuse....

can anyone can give me example...??

how to use this code:

#Include <WinAPI.au3>
_WinAPI_ShowCursor($fShow) is this code is for show/hideCursor??

#Include <WinAPI.au3>
_WinAPI_SetWindowText($hWnd, $sText)is this code is for Title Change

#Include <WinAPI.au3>
_WinAPI_Mouse_Event($iFlags[, $iX = 0[, $iY = 0[, $iData = 0[, $iExtraInfo = 0]]]])is this code is for Mousecoord like mouse click??

#Include <WinAPI.au3>
_WinAPI_MoveWindow($hWnd, $iX, $iY, $iWidth, $iHeight[, $fRepaint = True])is this code is for New Window

and can you tell me what the use???

thanx in advance guys....

Edited by jerwin

[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]

Share this post


Link to post
Share on other sites



Hi, examples:

#include <WinAPI.au3>
#include <Constants.au3>

$cur = _WinAPI_ShowCursor(False)

MsgBox(0, "Info", "Mouse cursor hided for your GUI")

_WinAPI_ShowCursor(True)

MsgBox(0, "Info", "Mouse cursor showed for your GUI")


Run("notepad.exe")

WinWait("[Class:Notepad]")

$hWnd = WinGetHandle("[Class:Notepad]")

_WinAPI_SetWindowText($hWnd, "My custom titlebar")

MsgBox(0, "Info", "Notepad title changed")

MsgBox(0, "Info", "Moving mouse cursor to X-100 and Y-100 from current pos")
_WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 100, 100)

MsgBox(0, "Info", "Click mouse right button")
_WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 100, 100)
_WinAPI_Mouse_Event($MOUSEEVENTF_RIGHTUP)

MsgBox(0, "Info", "Move and resize a notepad window")
_WinAPI_MoveWindow($hWnd, 0, 0, 200, 100)

MsgBox(0, "Info", "Lesson is ended")

WinClose($hWnd)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Simpler is to use standard AutoIt's functions.

Use UDFs only for things that couldn't be done by standard AutoIt's functions.

See:

GUISetCursor()
WinSetTitle()
MouseClick(), MouseMove()
WinMove()
Edited by Zedna

Share this post


Link to post
Share on other sites

THANX GUYS .. :P


[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

BUMP sorry for double post but i get this error...

_WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 100, 100)

syntax error

Problem Fixed!!

New Problem evertime i set the coordinate in 817, 668

the mouse go in the right bottom side of the monitor screen...

Edited by jerwin

[font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font]

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  
Followers 0