SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Dec 2010
    Location
    Istanbul
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to get work GetCursorPos function for putty ?

    Hi all,
    I want to use GetCursorPos in order to get current for the putty screen.

    (I do not know if any other solution, to get actual cursor -except search whole putty screen with a custom for - if loop)

    I used the function as below and get error
    msgbox TeWindow("short name:=A").TeTextScreen("micclass:=TeTextScreen").G etCursorPos

    Then I made a search and found the page below with those codes
    http://www.sqaforums.com/showflat.php?Number=203979

    Extern.Declare micLong,"GetCursorPos","user32.dll","GetCursorPos" ,micLong

    And call it

    Extern.GetCursorPos(NULL)

    I did not use this extern code , because I can already see function when press . after TeTextScreen")

    I get confused, what do I need to do ?
    I look serious because I am serious.

  2. #2
    Member
    Join Date
    Jun 2003
    Posts
    170
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get work GetCursorPos function for putty ?

    It's a different function with the same name. The GetCursorPos you're seeing in that link is a windows API function which will give you the position of the mouse pointer on your windows desktop screen.

    GetCursorPos for terminal emulator is a different function entirely. What error are you getting?

  3. #3
    Member
    Join Date
    Dec 2010
    Location
    Istanbul
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get work GetCursorPos function for putty ?

    I get this error
    Wrong number of arguments or invalid property assignment: 'TeWindow(...).TeTextScreen(...).GetCursorPos'

    I see that this function returns two values so I tried this
    but got same error.
    Array myArray
    myArray = TeWindow("short name:=A").TeTextScreen("micclass:=TeTextScreen").G etCursorPos
    msgbox myArray(0)

    All I want to do is get cursor position in the emulator screen (putty)
    I look serious because I am serious.

  4. #4
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: How to get work GetCursorPos function for putty ?

    Wrong syntax.

    Try this.

    TeWindow("short name:=A").TeTextScreen("micclass:=TeTextScreen").G etCursorPos row, col

    Print row & " : " & col

    I am curious to know why you are looking for the cursor position.
    Rajkumar

  5. #5
    Member
    Join Date
    Dec 2010
    Location
    Istanbul
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get work GetCursorPos function for putty ?

    Hi Rajkumar
    Thanks for the reply, I tried your post but QTP gave this HLLAPI error

    HLLAPI dll not found.

    As far as I know, putty is an HLLAPI supported emulator.
    How can i fix this ? where is the problem ?


    What I am looking for is, I want to get result of last command in the putty screen and result place can change..

    How you achieve this problem ?
    Because if you just start putty or clear or reset etc.
    active (current) row -the last prompt line- changes and goes up, and goes down with every command until it reaches bottom line..

    How you get results from the putty screen correctly without giving a fixed GetText rectangle?
    I look serious because I am serious.

  6. #6
    Member
    Join Date
    Jun 2003
    Posts
    170
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get work GetCursorPos function for putty ?

    Have you tried using plink? It's part of the putty suite and is used to run commands on a unix host via a windows command prompt. You can then get the output from teh stdout of the command prompt. I have written the function below to run a unix command and return the output:

    Public Function Unix_Run_Command (Host, User, Password,Command)

    Dim WshShell
    Dim CMD

    Set WshShell = CreateObject("WScript.Shell")

    CMD = Chr(34 ) & Chr(34) & Parameter("RootPath") & "apps\plink.exe" & Chr(34) & " -ssh -pw " & Password & " " & User & "@" & Host & " " & Chr(34) & Command & Chr(34) & Chr(34)

    Set oShell = WshShell.Exec ("%comspec% /C " & CMD)

    Reporter.ReportEvent micDone, "Plink", "Using plink to run command: '" & Command & "' on Unix host '" & Host

    Unix_Run_Command = oShell.StdOut.ReadAll

    Set WshShell = Nothing

    End Function

  7. #7
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: How to get work GetCursorPos function for putty ?

    [ QUOTE ]
    As far as I know, putty is an HLLAPI supported emulator.


    [/ QUOTE ]

    Rastek,

    That isn't true. Putty is a supported emulator but not HLLAPI based.
    Rajkumar

  8. #8
    Member
    Join Date
    Dec 2010
    Location
    Istanbul
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get work GetCursorPos function for putty ?

    Rajkumar that means there is no way to get current row from putty ?
    I look serious because I am serious.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:12 AM.

Copyright BetaSoft Inc.