# Starting a thread on a timer

**URL:** <https://clarionhub.com/t/starting-a-thread-on-a-timer/8337>\
**Category:** questions\
**Tags:** timer, threads\
**Created:** [June 26, 2025, 12:17pm UTC](https://clarionhub.com/t/starting-a-thread-on-a-timer/8337 "2025-06-26T12:17:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffH](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/258eb7/32.png) [@JeffH](https://clarionhub.com/u/JeffH)\
**Post date:** [June 26, 2025, 12:17pm UTC](https://clarionhub.com/t/starting-a-thread-on-a-timer/8337/1 "2025-06-26T12:17:36Z")

</div>

I have a popup window for reminders that opens a new MDI window. If someone has a modal window open then the program will halt with an error that the application is not active. I found the following code to prevent this issue. ( from the newsgroups )

Global Map:-

```clarion
module('win32')
  apiGetFocus,long,pascal,name('GetFocus')
  apiIsWindowEnabled(long hwnd),long,pascal,name('IsWindowEnabled')
end

```

in code

```clarion
if apiIsWindowEnabled(frame{prop:handle}) <> 0 and apiGetFocus() <> frame{prop:handle}
 
end

```
