Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#847 closed Bug (No Bug)

Image not showing in GUI when called by _Timer_SetTimer

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: Cc:

Description

It seems that when a gui is called by _timer_settimer the image will not show. In the example provided, the function is called directly first and the image is shown in the GUI, then when the function is called with the timer, the image will not show.

Environment = 3.3.0.0 under WIN_XP/Service Pack 3 X86

#include <WindowsConstants.au3>
#include <WinAPI.au3>		
#include <_Timers.au3>

$IMAGE_GENERAL_ARRAY = "";PUT path to an image on your computer.


$GUISPLASH = GUICreate("Speed Indicator", 600, 66, -1, 10, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOOLWINDOW)
GUICtrlCreatePic($IMAGE_GENERAL_ARRAY, 0, 0, 600, 66)
GUISetState(@SW_HIDE, $GUISPLASH)

_test("","","","")

_Timer_SetTimer($GUISPLASH, 10000, "_test")


While 1
	Sleep(50)
WEnd


Func _test($HWND, $MSG, $IIDTIMER, $DWTIME)
	GUISetState(@SW_SHOW, $GUISPLASH)
	_WinAPI_Beep(400, 200)
	Sleep(200)
	_WinAPI_Beep(400, 200)
	Sleep(1000)
	GUISetState(@SW_HIDE, $GUISPLASH)
EndFunc   ;==>_test

Attachments (0)

Change History (3)

comment:1 Changed 10 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

Code works for me. It's poorly written and ill-thought out, but it works.

comment:2 Changed 10 years ago by Jpm

We cannot support interference between Basic AutoIt functions and all windows API called by DllCall(UDF).
We can understand that a lot of time there is no conflict but in your case definitly there is one that I cannot figure out why. Internal tracing proof that Autoit is handling the receive message the same way, with or without the your timer addition.

It would be better you use AdLib if you want some function interaction with a timer.
don't mix. Remember AutoIt is not a multiThread application.

comment:3 Changed 10 years ago by anonymous

Thank you Jpm for taking the time to explain that. Adlib wouldn't work for this particular instance in my app because it would/may conflict with other adlibs I have with certain instances and conditions. What I did in the mean time was put this with a regular TimerInit and TimerDiff with conditions in the main loop until I figure a better way of doing what I want.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.