Jump to content

WinGetCaretPos()


strate
 Share

Recommended Posts

I need help.... Since I wasn't getting an answer (even though I think it is) I went ahead and started trying to do it on my own, it turned into a mess. Could somebody give me a hand?

$pointer = DllStructCreate("int;int")
if @error Then
    MsgBox(0,"","Error in DllStructCreate " & @error);
    exit
endif

$dll = DllOpen("user32.dll")
$result = DllCall($dll, "int", "GetCaretPos", "long_ptr",$pointer)
Select
    Case @error = 1 
        MsgBox(0,'','unable to use the DLL file')
    Case @error = 2
        MsgBox(0,'','unknown "return type"')
    Case @error = 3
        MsgBox(0,'','"function" not found in the DLL file. ')
EndSelect
if Not $result[0] Then
    MsgBox(0,"DllCall Error","DllCall Failed")
    exit
EndIf
DllClose($dll)

For $i = 1 To DllStructGetSize($pointer)
    $major = DllStructGetData($pointer,$i)
    MsgBox(262144,'Debug line ~59','Selection:' & @lf & '$major' & @lf & @lf & 'Return:' & @lf & $major & @lf & @lf & '@Error:' & @lf & @Error);### Debug MSGBOX
Next

MsgBox(262144,'Debug line ~42','Selection:' & @lf & '$result' & @lf & @lf & 'Return:' & @lf & $result & @lf & @lf & '@Error:' & @lf & @Error);### Debug MSGBOX
INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Link to comment
Share on other sites

I was wondering what your overall script intent was, not just this section. Sorry, I should have made myself more clear.

Are you attempting to locate the caret in a application like word or something?

Oh, I'm sorry, I wanna locate the caret in a telnet application.

I used Dll Explorer to get all of the functions being used by the process, and one of them was GetCaretPos. I think though that WinGetCaretPos calls GetCaretPos though, I've tried using WinGetCaretPos but it doesn't work with the telnet application.

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
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...