Sign in to follow this  
Followers 0
strate

WinGetCaretPos()

8 posts in this topic

Does WinGetCaretPos() use GetCaretPos function from the User32.dll?


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites



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...

Share this post


Link to post
Share on other sites

If GetCaretPos isn't already used in WinGetCaretPos(), I'm trying get a response from the DllCall. I don't know Jack about DllCall or Pointers.


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

Dev's MVP's????

Does WinGetCaretPos calls GetCaretPos?


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites

I'm tempted to make you wait a couple more days for the answer since you are so impatient to get it. But to answer your question, yes, it uses GetCaretPos().

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