Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

display text on top but dont activate on click

$
0
0

Dear AutoIt community,

 

im a hobbyscripter and got quite far with this awesome tool and its functions/tutorials already but now im stuck and dont find an answer for my problem (beside d3d drawing, which would require c++/dll injection)

 

my goal is it to display text on top of a borderless game window which is not active and NOT ACTIVATABLE

(just like i would DrawText with D3D)

that means i also dont want the text/label to "activate" if i accidentaly click it, since that would open the taskbar and id loose gamecontrol until i click the game again.

 

so is there any way to disable activating clicks for that gui? or is there even an better solution?

 

here an example what i got so far:

(press END to exit)

AutoIt         
  1. #include <GUIConstantsEx.au3>
  2. #include <Misc.au3>
  3. Opt("GUIResizeMode",$GUI_DOCKALL)
  4.  
  5. ;;VARS
  6. global $EXIT = "23";Exit Hotkey = END
  7. global $DisplayText="!!!!!!!!!!!!!!!!!!! TEXT TO DISPLAY !!!!!!!!!!!!!!!!!!!     'END' -> exit"
  8. $X=800
  9. $Y=50
  10.  
  11. CreateDisplay()
  12.  
  13.    HotKeys()
  14.    GuiCtrlSetData($Label,$DisplayText)
  15.    WinSetOnTop($GUI4LABEL,"",1)
  16.    sleep(100)
  17.  
  18. Func CreateDisplay()
  19.    Global $GUI4LABEL = GUICreate("Display", 200, 200, 800, 3, 0x80000000, 128);$WS_POPUP = 0x80000000, $WS_EX_TOOLWINDOW = 128
  20.     GUISetBkColor(0xADFF2F)
  21.     ;Create Label with text
  22.     Global $Label = GUICtrlCreateLabel($DisplayText, 3, 3)    
  23.     $cgp = ControlGetPos($GUI4LABEL, "", $Label);get label size
  24.     WinMove($GUI4LABEL, "", $X, $Y, $cgp[2], $cgp[3]);form gui
  25.     ;OnTop
  26.     WinSetOnTop($GUI4LABEL,"",1)
  27.     ;Show no activate
  28.  
  29.  Func HotKeys()
  30.    ;;Hotkey END
  31.    if _IsPressed($EXIT) = 1 Then
  32.       Exit
  33.    EndIf
  34.    While _IsPressed ($EXIT) = 1
  35.       Sleep(1)
  36.    WEnd
  37.  

regards,

iB07


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>