marcoauto

GDI outline text scaled in gui

6 posts in this topic

#1 ·  Posted

ciao,

I need to scale an outlined GDI text in a GUI. The problem is that I can't do this. The outline is often out of the GUI

I started from this script:

https://www.autoitscript.com/autoit3/docs/libfunctions/_GDIPlus_PathTransform.htm

that fit a string to windows and I changed

 $aBounds = _GDIPlus_PathGetWorldBounds($hPath) ;Get bounding rectangle of the path

$aBounds = _GDIPlus_PathGetWorldBounds($hPath) ;Get bounding rectangle of the path

with 

$aBounds = _GDIPlus_PathGetWorldBounds($hPath,$hMatrix,$hPen) ;Get bounding rectangle of the path with pen size

but doesn't work

so, I tried to change other thins, but nothing... Sometimes works, but if I change the string often result change

This is my script:

#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <array.au3>

Example()

Func Example()
    Local $iW, $iH, $hGUI, $hGraphic, $hBrush, $hPen, $hPath, $hFamily, $tLayout, $hMatrix, $aBounds

    ; Create GUI
    $iW = 650
    $iH = 300
    $hGUI = GUICreate("GDI+", $iW, $iH)
    GUISetState(@SW_SHOW)

    ; Draw a string using path
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (antialiasing)
;~  _GDIPlus_GraphicsClear($hGraphic, 0xFF000000)

    $MergedImageBackgroundColor = 0x00000000
    _GDIPlus_GraphicsClear($hGraphic, $MergedImageBackgroundColor)

    $hBrush = _GDIPlus_BrushCreateSolid(0xFFDD2200)
    $stroke_size = 15
    $hPen = _GDIPlus_PenCreate(0xFFFFBB00, $stroke_size)    ;stroke size in pixel
        $hPen2 = _GDIPlus_PenCreate(0xFFFFff00, 2)  ;stroke size in pixel
    _GDIPlus_PenSetLineJoin($hPen,$GDIP_PENSETLINEJOIN_ROUND)

    $hPath = _GDIPlus_PathCreate() ;Create new path object
;~  $fSize = 20
    $hFamily = _GDIPlus_FontFamilyCreate("Myriad Pro") ;Create font family object
    $tLayout = _GDIPlus_RectFCreate() ;Create string bounding rectangle X=0, Y=0

    Local $hFormat = _GDIPlus_StringFormatCreate()
    _GDIPlus_PathAddString($hPath, "autoitForeverLollipop", $tLayout, $hFamily);, 0, $fSize, $hFormat) ;Add the outline of the string to the path
;~     _GDIPlus_PathAddString($hPath, $sText, $tLayout, $hFamily, 0, $fSize, $hFormat)

    ; Tranform Path to fit to window
    $aBounds = _GDIPlus_PathGetWorldBounds($hPath) ;Get bounding rectangle of the path
    $aPoints = _GDIPlus_PathGetPoints($hPath)
    ConsoleWrite($aBounds[0] & @CRLF)
    ConsoleWrite($aBounds[1] & @CRLF)
    ConsoleWrite($aBounds[2] & @CRLF)
    ConsoleWrite($aBounds[3] & @CRLF)
    ConsoleWrite($aPoints[$aPoints[0][0]][0] & " - " & $aPoints[1][0] & " + 2*" & $stroke_size & " = " & $aPoints[$aPoints[0][0]][0]-$aPoints[1][0]+2*$stroke_size & @CRLF)
;~ $aBounds[0] = $aBounds[0]

    $aBoundsNp = _GDIPlus_PathGetWorldBounds($hPath,0,$hPen) ;Get bounding rectangle of the path with pen
    ConsoleWrite($aBoundsNp[0] & @CRLF)
    ConsoleWrite($aBoundsNp[1] & @CRLF)
    ConsoleWrite($aBoundsNp[2] & @CRLF)
    ConsoleWrite($aBoundsNp[3] & @CRLF)
    ConsoleWrite($iW & " / 2 = "  & $iW / 2 & @CRLF)
    ConsoleWrite("$ih / 2 = "  & $iH / 2 & @CRLF)
;~  ConsoleWrite($iW & " $aBounds[2] = "  & $iW / $aBounds[2] & @CRLF)
    ConsoleWrite($iW & " $aBoundsNp[2] = "  & $iW / $aBoundsNp[2] & @CRLF)
    ConsoleWrite($iH & " $aBoundsNp[3] = "  & $iH / $aBoundsNp[3] & @CRLF)
;~ _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI)
;~  _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI)
    $hMatrix = _GDIPlus_MatrixCreate()
    $iW = $iW - $stroke_size ;+ $stroke_size
    $iH = $iH - $stroke_size
    ConsoleWrite(" -$aBounds[0]+1*$stroke_size/72 = " &  -$aBounds[0]+1*$stroke_size/72 & @CRLF)
    ConsoleWrite(" -1.8+1*$stroke_size/72 = " &  -1.8+1*$stroke_size/72 & @CRLF)
    _GDIPlus_MatrixTranslate($hMatrix, -$aBounds[0]+2*$stroke_size/72, -$aBounds[1]+1*$stroke_size/72) ;Translate Matrix to the offset of the bounding rectangle
;~  _GDIPlus_MatrixTranslate($hMatrix, -1.59166666666667+0*($stroke_size/72), -$aBounds[1]+1*$stroke_size/72) ;Translate Matrix to the offset of the bounding rectangle
;~  _GDIPlus_MatrixScale($hMatrix, $iW / $aBounds[2], $iH / $aBounds[3], True) ;Scale Matrix
    _GDIPlus_MatrixScale($hMatrix, $iW / $aBounds[2], $iH / $aBounds[3], True) ;Scale Matrix
    _GDIPlus_PathTransform($hPath, $hMatrix) ;Translate and Scale Path

    $aBoundsNp = _GDIPlus_PathGetWorldBounds($hPath,0,$hPen) ;Get bounding rectangle of the path with pen
    ConsoleWrite($aBoundsNp[0] & @CRLF)
    ConsoleWrite($aBoundsNp[1] & @CRLF)
    ConsoleWrite($aBoundsNp[2] & @CRLF)
    ConsoleWrite($aBoundsNp[3] & @CRLF)

;~  _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI)
    _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI)
    _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI)

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Clean up resources
    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example

if you change the line 

_GDIPlus_PathAddString($hPath, "autoitForeverLollipop", $tLayout, $hFamily);, 0, $fSize, $hFormat) ;Add the outline of the string to the path

with a smaller string

_GDIPlus_PathAddString($hPath, "autoitFitted", $tLayout, $hFamily);, 0, $fSize, $hFormat) ;Add the outline of the string to the path

the result is ok

Can someone can help me?

Thankyou

Share this post


Link to post
Share on other sites



#2 ·  Posted

After I installed the font "Myriad Pro" your script worked unchanged properly. The result is ok.


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#3 ·  Posted

Can you please change 

_GDIPlus_PathAddString($hPath, "autoitFitted", $tLayout, $hFamily);, 0, $fSize, $hFormat) ;Add the outline of the string to the path

with

_GDIPlus_PathAddString($hPath, "123", $tLayout, $hFamily);, 0, $fSize, $hFormat) ;Add the outline of the string to the path

and tell me if the result is ok? Because for me is not ok. I've attached an image where you can see that the only correct result is where the string is "Autofitted". The other three string are wrong: "autoit" is cut to the right and a bit on the bottom, same thing for "123" and "autoitForeverLollipop" is cut on the left.

I think I'm wrong somewhere... 

After hours of tests I tried to divide by 72 the $strokeSize of the pen. I've tried 72 because the screen is 72dpi but I don't know if is a good idea.

these problems there are with all fonts that I've tried (Arial, too)

thanks and sorry for my bad english

marco

fitToWindows.jpg

Share this post


Link to post
Share on other sites

#4 ·  Posted

Does this work for you?

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>

Example()

Func Example()
    Local $iW, $iH, $hGUI, $hGraphic, $hBrush, $hPen, $hPath, $hFamily, $tLayout, $hMatrix, $aBounds

    ; Create GUI
    $iW = 800
    $iH = 400
    $hGUI = GUICreate("GDI+", $iW, $iH)
    GUISetState(@SW_SHOW)

    ; Draw a string using path
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (antialiasing)
    _GDIPlus_GraphicsClear($hGraphic, 0xFF000000)

    $hBrush = _GDIPlus_BrushCreateSolid(0xFFDD2200)
    $iPenWidth = 8
    $hPen = _GDIPlus_PenCreate(0xFFFFBB00, $iPenWidth)

    $hPath = _GDIPlus_PathCreate() ;Create new path object

    $hFamily = _GDIPlus_FontFamilyCreate("Arial") ;Create font family object
    $tLayout = _GDIPlus_RectFCreate() ;Create string bounding rectangle X=0, Y=0
    _GDIPlus_PathAddString($hPath, "123", $tLayout, $hFamily) ;Add the outline of the string to the path

    ; Tranform Path to fit to window
    $aBounds = _GDIPlus_PathGetWorldBounds($hPath) ;Get bounding rectangle of the path

    $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, -$aBounds[0], -$aBounds[1]) ;Translate Matrix to the offset of the bounding rectangle
    _GDIPlus_MatrixScale($hMatrix, ($iW - Ceiling(($iPenWidth + 1) / 2)) / $aBounds[2], ($iH - Ceiling(($iPenWidth + 1)/ 2)) / $aBounds[3], True) ;Scale Matrix
    _GDIPlus_PathTransform($hPath, $hMatrix) ;Translate and Scale Path

    _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI)
    _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI)

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Clean up resources
    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example

 


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#5 ·  Posted

ciao Uez,

thanks for the reply, but unfortunately, the bug is still there.

If you write "Autoit" you will see the error

But I have found the solution. This works!!!!

Thankyou for the help!

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>

Example()

Func Example()
    Local $iW, $iH, $hGUI, $hGraphic, $hBrush, $hPen, $hPath, $hFamily, $tLayout, $hMatrix, $aBounds

    ; Create GUI
    $iW = 800
    $iH = 400
    $hGUI = GUICreate("GDI+", $iW, $iH)
    GUISetState(@SW_SHOW)

    ; Draw a string using path
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (antialiasing)
    _GDIPlus_GraphicsClear($hGraphic, 0xFF000000)

    $hBrush = _GDIPlus_BrushCreateSolid(0xFFDD2200)
    $iPenWidth = 16
    $hPen = _GDIPlus_PenCreate(0xFFFFBB00, $iPenWidth)
    _GDIPlus_PenSetLineJoin($hPen,$GDIP_PENSETLINEJOIN_ROUND)

    $hPath = _GDIPlus_PathCreate() ;Create new path object

    $hFamily = _GDIPlus_FontFamilyCreate("Arial") ;Create font family object
    $tLayout = _GDIPlus_RectFCreate() ;Create string bounding rectangle X=0, Y=0
    _GDIPlus_PathAddString($hPath, "Autoit", $tLayout, $hFamily) ;Add the outline of the string to the path

    ; Tranform Path to fit to window
    $aBounds = _GDIPlus_PathGetWorldBounds($hPath) ;Get bounding rectangle of the path
    $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixScale($hMatrix, ($iW - $iPenWidth) / ($aBounds[2]), ($iH - $iPenWidth) / $aBounds[3], False) ;Scale Matrix
    _GDIPlus_PathTransform($hPath, $hMatrix) ;Translate and Scale Path

    $aBounds = _GDIPlus_PathGetWorldBounds($hPath)
    _GDIPlus_MatrixSetElements($hMatrix, 1, 0, 0, 1, 0, 0) ;Reset Matrix
    _GDIPlus_MatrixTranslate($hMatrix, -$aBounds[0]+$iPenWidth/2, -$aBounds[1]+$iPenWidth/2)
    _GDIPlus_PathTransform($hPath, $hMatrix) ;Translate and Scale Path

    _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI)
    _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI)

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Clean up resources
    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example

 

Share this post


Link to post
Share on other sites

#6 ·  Posted

@marcoauto: well done! :thumbsup:

Even shorter:

...
    ; Tranform Path to fit to window
    $aBounds = _GDIPlus_PathGetWorldBounds($hPath) ;Get bounding rectangle of the path
    $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, -$aBounds[0], -$aBounds[1]) ;Translate Matrix to the offset of the bounding rectangle
    _GDIPlus_MatrixScale($hMatrix, ($iW - $iPenWidth) / $aBounds[2], ($iH - $iPenWidth) / $aBounds[3], True) ;Scale Matrix
    _GDIPlus_PathTransform($hPath, $hMatrix) ;Translate and Scale Path
    _GDIPlus_MatrixSetElements($hMatrix, 1, 0, 0, 1, 0, 0)
    _GDIPlus_MatrixTranslate($hMatrix, $iPenWidth / 2, $iPenWidth / 2)
    _GDIPlus_PathTransform($hPath, $hMatrix)

    _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI)
    _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI)
...
1 person likes this

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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

  • Similar Content

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Guys this is my gui and i need the numeric value typed in the highlighted  inputbox. if this value is greater than 1 i need to perform some operations
      \
       
      Here is the summary about that field which i got from wininfo tool

      i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it... 

      here i am using the valu present in the field

      can you guys tell me what's wrong??? or how can i get that value?
       
      My_GUI.au3

    • Larnil
      By Larnil
      This script generates Barnsleys Fractal Fern using script only.
      ; version 2017-10-03 ; Barnsley Fractal Fern ; by larnil #include <GUIConstants.au3> Dim $x, $y, $xn, $yn, $n, $r, $dc $WinSize = 800 ; window size ;Create graphics windows AutoItSetOption("GUIOnEventMode", 1) $GUI = GUICreate("Barnsley Fractal Fern", $WinSize, $WinSize, -1, -1) $Graphic = GuiCtrlCreateGraphic(0, 0, $WinSize, $WinSize) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x00ff00) GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE,"Bye") ;Main $start = TimerInit() _Fern(800) ; hight of fern - can be larger than window MsgBox(0,"Time taken:",Round(TimerDiff($start)/1000,3) &" seconds") While 1 Sleep(100) WEnd Func Bye() Exit EndFunc Func _Fern($height) $f = $height/10.6 ; scale factor. Complete fern is within 0 <= y <= 9.9983 (with no scale) $offset_x = $height/2 - $height/40 ; Side adjustment. Fern is within −2.1820 < x < 2.6558 (with no scale) For $n = 1 To $height*200 ; Number of iterations $r = Random(0, 99, 1) Select Case $r < 85 ; 0-84 = 85% of the time $xn = 0.85 * $x + 0.04 * $y $yn = -0.04 * $x + 0.85 * $y + 1.6 Case $r > 84 AND $r < 92 ; 85-91 = 7% of the time $xn = 0.2 * $x - 0.26 * $y $yn = 0.23 * $x + 0.22 * $y + 1.6 Case $r > 91 AND $r < 99 ; 92-98 = 7% of the time $xn = -0.15 * $x + 0.28 * $y $yn = 0.26 * $x + 0.24 * $y + 0.44 Case Else ; 99-99 = 1% of the time $xn = 0 $yn = 0.16 * $y EndSelect $x = $xn $y = $yn GUICtrlSetGraphic($Graphic, $GUI_GR_PIXEL, $offset_x + $x * $f, $height - $y * $f) Next GUICtrlSetGraphic($Graphic, $GUI_GR_REFRESH) EndFunc ;==> Fern  
      Here is another example where I have used GDI (my very first attempt at using GDI by the way). This script can generate much larger Ferns and save them to file (png). I have used this script to generate a 20000 x 20000 pixel @ 600 dpi image. Looks really good printed out in full size.
      #include <GDIPlus.au3> #include <GUIConstantsEx.au3> ; Param Local Const $iPxColor = 0xFF00FF00 ; Pixel color for fractal Alpha/R/G/B Local Const $iBgColor = 0xFFFFFFFF ; Background color for image Alpha/R/G/B Local Const $iSize = 1000 ; Hight of fern in pixels - image will have this hight and width too Local Const $iIter = $iSize*400 ; Number of iterations - $iSize * 200 is a good starting point ; Call function ;$start = TimerInit() _Fern($iSize,$iIter) ;MsgBox(0,"Time taken:",Round(TimerDiff($start)/1000,3) &" seconds") ; Function for generating Barnsley Fractal Fern Func _Fern($Size,$Iter) _GDIPlus_Startup() ; initialize GDI+ Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($Size, $Size) ; create an empty bitmap Local $hBmpCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) ; get the graphics context of the image _GDIPlus_GraphicsClear($hBmpCtxt, $iBgColor) ; Set the background color for empty bitmap ; Here the magic happens $x=0 ; init $y=0 ; init $f = $Size/10.6 ; scale factor. Complete fern is within 0 <= y <= 9.9983 (with no scale) $offset_x = $Size/2 - $Size/40 ; Side adjustment. Fern is within −2.1820 < x < 2.6558 (with no scale) For $n = 1 To $Iter ; Number of iterations $r = Random(0, 99, 1) Select Case $r < 85 ; 0-84 = 85% of the time $xn = 0.85 * $x + 0.04 * $y $yn = -0.04 * $x + 0.85 * $y + 1.6 Case $r > 84 AND $r < 92 ; 85-91 = 7% of the time $xn = 0.2 * $x - 0.26 * $y $yn = 0.23 * $x + 0.22 * $y + 1.6 Case $r > 91 AND $r < 99 ; 92-98 = 7% of the time $xn = -0.15 * $x + 0.28 * $y $yn = 0.26 * $x + 0.24 * $y + 0.44 Case Else ; 99-99 = 1% of the time $xn = 0 $yn = 0.16 * $y EndSelect $x = $xn $y = $yn _GDIPlus_BitmapSetPixel($hBitmap, $offset_x + $x * $f, $Size - $y * $f, $iPxColor) ; Change pixel color for calculated X,Y Next ; ==> End of magic $File = "\Fractal_Fern_"&StringRight(Hex($iPxColor),6)&"-"&StringRight(Hex($iBgColor),6)&"-"&$iSize&".png" _GDIPlus_ImageSaveToFile($hBitmap, @MyDocumentsDir & $File) ;save bitmap to disk ShellExecute(@MyDocumentsDir & $File); Show it to the world in your default image viewer ; Cleanup GDI+ resources _GDIPlus_GraphicsDispose($hBmpCtxt) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() EndFunc ;==> _Fern  
       

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      in need the path/text present int above shown input box to be copied or retrieved into a variable .. how can i do that?
       
      Thanks
       
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Friends i am new to autoit and i am stuck in middle of automation of flashing tool..
      my requirement is i have a window and i have to get the value present in that window (below is the picture)

      in the above window i need to get the value of the highlighted field.the value of this filed keeps on changing...ii need to get the current value present in the field..below are the details of the window and field..

       
      CAN it be done?
       
      thanks

    • houser747
      By houser747
      I have previously used _IEFormElementGetObjByName and _IEFormElementSetValue to enter text into a search box on a form and then submit the form.
      I am now trying to enter text into a search box which is not part of a form. 
      Here is the HTML from the website that i'm trying to enter the data on and then submit the search.
      <div class="row">
          <div class="form-group col-xs-12">
              <span id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_lblSearchText" for="input-search">Registreringsbeteckning</span>
              <div class="input-group col-xs-12">
                  <span id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_preSearchText" class="input-group-addon">SE -</span>
                  <input name="ctl00$FullWidthWithSubmenuContent$FullWidthContent$MainContent$AircraftRegistry$txtSearchText" type="text" value="DTH" id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_txtSearchText" class="form-control" />
              </div>
          </div>
      </div>
      <div class="row">
          <div class="form-group col-xs-12">
              <label class="sr-only" for="">Sök</label>
              <input type="submit" name="ctl00$FullWidthWithSubmenuContent$FullWidthContent$MainContent$AircraftRegistry$btnSearch" value="Sök" id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_btnSearch" class="btn btn-primary ladda-button" data-style="expand-right" />
          </div>
      </div>
      Many thanks in advance
      cheers
      Roger