Jump to content

Recommended Posts

Posted

_WinAPI_GetSystemWow64Directory

#include <APIErrors.au3>
#include <WinAPISys.au3>

$sWow64Directory = _WinAPI_GetSystemWow64Directory ( )

$iError = @error
If @extended = $ERROR_CALL_NOT_IMPLEMENTED Then
    Exit MsgBox(0, "Error", "32 bit OS")
EndIf

If $iError Then
    Exit MsgBox(0, "Failure", "_WinAPI_GetSystemWow64Directory")
EndIf

ConsoleWrite($sWow64Directory & @LF)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted (edited)

_WinAPI_GetTempFileName

#include <WinAPIFiles.au3>

$sTempFileName = _WinAPI_GetTempFileName (@ScriptDir)

If @error Then
    Exit MsgBox(0, "Failure", "_WinAPI_GetTempFileName")
EndIf

ConsoleWrite($sTempFileName & @LF)
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

_WinAPI_GetVersionEx

#include <WinAPISys.au3>

$tOSVERSIONINFOEX = _WinAPI_GetVersionEx ( )
If @error Then
    Exit MsgBox (0, "failure", "_WinAPI_GetVersionEx")
EndIf

For $i = 1 To 11
    ConsoleWrite(DllStructGetData($tOSVERSIONINFOEX, $i) & @LF)
Next

; What these OSVERSIONINFOEX values are can be seen at this link (correct at time of post)
;http://msdn.microsoft.com/en-gb/library/windows/desktop/ms724833(v=vs.85).aspx

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted (edited)

_WinAPI_GetWindowFileName

#include <WinAPIProc.au3>

$PID = Run("notepad.exe")
ProcessWait($PID)

$sWindowFileName = _WinAPI_GetWindowFileName ( WinGetHandle("Untitled - Notepad") )
If @error Then
    ProcessClose($PID)
    Exit MsgBox(0, "Failure", "_WinAPI_GetWindowFileName")
EndIf

ProcessClose($PID)
ConsoleWrite($sWindowFileName & @LF)
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted (edited)

_WinAPI_GetWindowHeight

_WinAPI_GetWindowWidth

#include <WinAPI.au3>

$PID = Run("notepad.exe")
ProcessWait($PID)

$hWnd =  WinGetHandle("Untitled - Notepad")

$Height = _WinAPI_GetWindowHeight($hWnd)
If @error Then
    ProcessClose($PID)
    Exit MsgBox(0, "Failure", "_WinAPI_GetWindowHeight")
EndIf

$Width = _WinAPI_GetWindowWidth($hWnd)
If @error Then
    ProcessClose($PID)
    Exit MsgBox(0, "Failure", "_WinAPI_GetWindowWidth")
EndIf

ProcessClose($PID)
ConsoleWrite($Width & @LF)
ConsoleWrite($Height & @LF)
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

_WinAPI_LoByte

_WinAPI_HiByte

#include <WinAPIMisc.au3>

$dsShort = DllStructCreate("short")
DllStructSetData($dsShort, 1, 12345)

$hiByte = _WinAPI_HiByte(DllStructGetData($dsShort, 1))
$loByte = _WinAPI_LoByte(DllStructGetData($dsShort, 1))

ConsoleWrite($hiByte & @LF & $loByte & @LF)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

_WinAPI_InflateRect

#include <WinAPIGdi.au3>

$tRect = DllStructCreate($tagRECT)

DllStructSetData($tRect, "Left", 100)
DllStructSetData($tRect, "Top", 100)
DllStructSetData($tRect, "Right", 100)
DllStructSetData($tRect, "Bottom", 100)

ConsoleWrite("Struct before" & @LF)
For $i = 1 To 4
    ConsoleWrite(DllStructGetData($tRect, $i) & @LF)
Next

_WinAPI_InflateRect($tRect, 20, 20)

ConsoleWrite("Struct after" & @LF)
For $i = 1 To 4
    ConsoleWrite(DllStructGetData($tRect, $i) & @LF)
Next

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted (edited)

_WinAPI_IsChild

#include <WinAPISys.au3>

$AutWin = WinGetHandle(AutoItWinGetTitle())

$GUI = GUICreate("GUI")

GUICtrlCreateButton("button", 10, 10)

$hButton = ControlGetHandle($GUI, "", "[CLASS:Button; INSTANCE:1]")

If _WinAPI_IsChild($GUI, $AutWin) Then ; test our gui against autoit hidden window
    ConsoleWrite("True" & @LF)
Else
    ConsoleWrite("False" & @LF)
EndIf

If _WinAPI_IsChild($hButton, $GUI) Then ; Test our button against our gui
    ConsoleWrite("True" & @LF)
Else
    ConsoleWrite("False" & @LF)
EndIf
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

_WinAPI_IsClassName

#include <WinAPI.au3>

$GUI = GUICreate("GUI")

GUICtrlCreateButton("button", 10, 10)

$hButton = ControlGetHandle($GUI, "", "[CLASS:Button; INSTANCE:1]")

If _WinAPI_IsClassName($hButton, "Edit") Then
    ConsoleWrite("True" & @LF)
Else
    ConsoleWrite("False" & @LF)
EndIf

If _WinAPI_IsClassName($hButton, "Button") Then
    ConsoleWrite("True" & @LF)
Else
    ConsoleWrite("False" & @LF)
EndIf

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

  • 2 years later...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...