Jump to content

thawee

Active Members
  • Posts

    54
  • Joined

  • Last visited

thawee's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Thanks for you quick response, The reason I was asking these questions I was messing around with automating Avira Antivirus for funzzies. I am getting suck on the multi-level treelist & toolbox selections. I can Set the boxes in the treelist as selected / checked but it doesn't activate the selection, so the toolbox is active / usable. Thanks Thawee
  2. Makes sense, I have noticed that once in a blue moon SetSelected will check the box for me which has caused a ton of confusion for me.. I have tried using the _GUICtrlTreeView_SetChecked, and you are correct it checks the box nicely; however, For whatever reason in the script I am writing it doesn't activate the checked / selected item, so that a secondary toolbar becomes activated therefore allowing me to manipulate the newly active toolbar Is there a better way to manipulate tree lists ? Thanks for your response, Thawee
  3. Is there a good resource to learn about WMI? and how I can use it? Thanks Thawee
  4. I am fairly new to auto-it and programming in general. I would consider myself a basic programmer. I would like to interact with a windows application or function behind the scenes instead of calling the application and manipulating the front end. I have seen object calls like the code below: ;#RequireAdmin $obj = ObjGet("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore") $obj.Enable("") $obj.CreateRestorePoint($discription, 12, 100) If $disable Then $obj.Disable("") EndIf I have also seen code that uses DLLCall. For example: $TCount = DllCall("kernel32.dll", "long", "GetTickCount") How do i know what is in each DLL, and How do I learn to format my requests in a way that makes it work correctly. I really need some direction on how to find out more about these areas in detail!. I would greatly appreciate someone pointing me in the right direction. Most information I can find is elusive at best, and doesn't explain the details behind scenes. Thanks for everyone's help in advance. Thawee
  5. Thanks, I appreciate it very much Thawee
  6. I have seen many programs that use the DLLcall command, and I find myself very interested in using it. The issue I am confused on is how do we know which DLLs have what we want in them? Is there a good website I can go and read up on all the cool things stored in DLLs? Thanks Thawee
  7. Awesome!!! You figured it out! Man I have been banging my head against the wall for a while!! Thanks so much, Thawee
  8. I have split up the static text vs the changing text, and found that it does reduce some of the flicker. Is there any way to update a label with the core element for GuiSetData outside of the main loop? because I have noticed even if its in the main loop even if its not being updated at the moment it still causes a flicker effect. Maybe Making the whole program work with ;Opt("GUIOnEventMode",1) or something? GUICtrlSetData($iLabel_Text, $sText) ; Moved outside the main loop for example purposes. While 1 $sText = _RandomText(50) If $sText <> $sReadPrevious And TimerDiff($iTimer) > 150 Then $iTimer = TimerInit() $sReadPrevious = $sText EndIf Even if i put a control statement to keep from updating the Label continuously, it still flickers as if its being updated every second. As demonstrated here in the code below. #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> _Main() Func _Main() Local $hGUI, $iLabel, $sReadPrevious, $sText,$MenuUpdateCntr ;$iTimer, $hGUI = GUICreate("Example not with GDI+", 400, 300) $iLabel = GUICtrlCreateLabel("", 10, 10, 380, 280) ;GUICtrlSetBkColor(-1, 0x000) ;GUICtrlSetColor(-1, 0xFFFFFF) ;GUICtrlSetFont(-1, 20) GUISetState(@SW_SHOW, $hGUI) $iTimer = TimerInit() While 1 $sText = _RandomText(50) If $MenuUpdateCntr >= 400 Then $iTimer = TimerInit() $sReadPrevious = $sText GUICtrlSetData($iLabel,"This is a test of the flicker effect based on the size of the sentance. : " & $sText) $MenuUpdateCntr = 0 EndIf ;If $sText <> $sReadPrevious And TimerDiff($iTimer) > 150 Then ;EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch $MenuUpdateCntr = $MenuUpdateCntr + 1 WEnd EndFunc ;==>_Main Func _RandomText($iLength = 7) Local $sData = "", $sRandom For $A = 1 To $iLength $sRandom = Random(55, 116, 1) $sData = " TEXT TEXT" ;Chr($sRandom + 6 * ($sRandom > 90) - 7 * ($sRandom < 65)) & Chr($sRandom + 6 * ($sRandom > 90) - 7 * ($sRandom < 65)) Next Return $sData EndFunc Is it possible this flickering is a limitation of autoit? Thanks for continuing to help me out I appreciate it. Thawee
  9. #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> _Main() Func _Main() Local $hGUI, $iLabel, $iTimer, $sReadPrevious, $sText $hGUI = GUICreate("Example not with GDI+", 400, 300) $iLabel = GUICtrlCreateLabel("", 10, 10, 380, 280) ;GUICtrlSetBkColor(-1, 0x000) ;GUICtrlSetColor(-1, 0xFFFFFF) ;GUICtrlSetFont(-1, 20) GUISetState(@SW_SHOW, $hGUI) $iTimer = TimerInit() While 1 $sText = _RandomText(50) If $sText <> $sReadPrevious And TimerDiff($iTimer) > 150 Then $iTimer = TimerInit() $sReadPrevious = $sText GUICtrlSetData($iLabel,"This is a test of the flicker effect based on the size of the sentence. : " & $sText) EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc ;==>_Main Func _RandomText($iLength = 7) Local $sData = "", $sRandom For $A = 1 To $iLength $sRandom = Random(55, 116, 1) $sData = Chr($sRandom + 6 * ($sRandom > 90) - 7 * ($sRandom < 65)) & Chr($sRandom + 6 * ($sRandom > 90) - 7 * ($sRandom < 65)) Next Return $sData EndFunc Here is the modified code that produces a flicker effect for me. Thanks for your help. I have realized that the flicker effect gets worse the long the sentence is. I was thinking of breaking up the 2 segments, so that I would only be updating a small segment Maybe that would clean up most if not all of the flicker effect. Any ideas would be greatly appreciated. Thanks Thawee
  10. #include <GuiConstantsEx.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $hGUI, $hGraphic ; Create GUI $hGUI = GUICreate("GDI+", 400, 300) GUISetState() ; Draw a string _GDIPlus_Startup () $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGUI) ;_GDIPlus_GraphicsDrawString ($hGraphic, "Hello world", 140, 110) Used to be active but moved inside loop ; Loop until user exits Do _GDIPlus_GraphicsDrawString ($hGraphic, "Hello world", 140, 110) ;moved this from above the loop. Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_GraphicsDispose ($hGraphic) _GDIPlus_Shutdown () EndFunc ;==>_Main I was looking at GDIPlus, and I tried putting it into my script instead of the GUICtrlSetData and Label format. When I ran this script with the _GDIPlus_GraphicsDrawString ($hGraphic, "Hello world", 140, 110) Inside the loop it produced a Text That was really bolded. I am trying desprately to figure out how to just simply update any text on a gui window without flicker or weird side effects? Sorry for my lack of understand. I have read over the Gdi plus elements, and some of it is very confusing to me. Is there a simple way to refresh gui text data without causing odd side effects..Like the text bolding or flickering? Maybe I am doing it wrong? Thanks Thawee
×
×
  • Create New...