Jump to content

make gui change text according to variable


adarkz
 Share

Recommended Posts

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

Local $hGUI = 0, $hGraphics = 0, $hBrush = 0, $hFormat = 0, $hFamily = 0, $hFont = 0, $tLayout = 0
Global $txt = "OFF"
#region GUI
$hGUI = GUICreate("MyGUI", 250, 50, -1, -1, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED))
GUISetBkColor(0x000000)

_WinAPI_SetLayeredWindowAttributes($hGUI, 0x000000)
GUISetState(@SW_SHOW, $hGUI)
#endregion

#region Draw
_GDIPlus_Startup()

$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)

$hBrush = _GDIPlus_BrushCreateSolid(0xFF00FF00)

$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Arial")
$hFont = _GDIPlus_FontCreate($hFamily, 17, 1)
$tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)

_GDIPlus_GraphicsDrawStringEx($hGraphics, $txt, $hFont, $tLayout, $hFormat, $hBrush)

#endregion

While GUIGetMsg() <> $GUI_EVENT_CLOSE
Sleep(1000)
WEnd

#region Release ressources
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)

_GDIPlus_BrushDispose($hBrush)

_GDIPlus_GraphicsDispose($hGraphics)

_GDIPlus_Shutdown()

GUIDelete($hGUI)
#endregion

so i got this script from firefox 


my question is how do i make the gui text change when the variable $txt changes 

Link to comment
Share on other sites

  • Developers

@adarkz,
I see you did not read those rules, to which I linked, very carefully - you missed the part that says:

"
Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above
"

Do NOT start another thread on this - our patience has limits. :naughty:
Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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