#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 by , 17 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
comment:2 by , 17 years ago
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 by , 17 years ago
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.

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