Jump to content

DllCall


Recommended Posts

hey, im trying to make this work with all windows type

DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hwnd, "int", -8)

I tried working around with it but no hope ;)

Here is what i got so far

$hnd = WinGetHandle("Example")
$check = "GetWindowLong"
If @AutoItX64 Then $check = "GetWindowLongPtr"

DllCall("user32.dll", "long", $check, "hwnd", $hwnd, "int", -8)

There seems to be something wrong with my script but I cant seem to find what it is

Hope someone could help me with this :huh2:

Link to comment
Share on other sites

From standard WinAPI UDF

Func _WinAPI_GetWindowLong($hWnd, $iIndex)
    Local $sFuncName = "GetWindowLongW"
    If @AutoItX64 Then  $sFuncName = "GetWindowLongPtrW"
    Local $aResult = DllCall("user32.dll", "long_ptr", $sFuncName, "hwnd", $hWnd, "int", $iIndex)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[0]
EndFunc   ;==>_WinAPI_GetWindowLong
Link to comment
Share on other sites

Thanks for reply guys :huh2:

$hnd <> $hwnd

Br,

UEZ

Sorry was my bad :/, i rewritten the code and left a letter :S

From standard WinAPI UDF

Func _WinAPI_GetWindowLong($hWnd, $iIndex)
    Local $sFuncName = "GetWindowLongW"
    If @AutoItX64 Then  $sFuncName = "GetWindowLongPtrW"
    Local $aResult = DllCall("user32.dll", "long_ptr", $sFuncName, "hwnd", $hWnd, "int", $iIndex)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[0]
EndFunc   ;==>_WinAPI_GetWindowLong

Thanks got what i wanted ;)
Link to comment
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
 Share

  • Recently Browsing   0 members

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