# Re: How do I find a Windows process with a specific Window T

**URL:** <https://www.ruby-forum.com/t/re-how-do-i-find-a-windows-process-with-a-specific-window-t/87841>\
**Category:** Ruby\
**Created:** [March 6, 2007, 11:02am UTC](https://www.ruby-forum.com/t/re-how-do-i-find-a-windows-process-with-a-specific-window-t/87841 "2007-03-06T11:02:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scoundrel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@scoundrel](https://www.ruby-forum.com/u/scoundrel)\
**Post date:** [March 6, 2007, 11:02am UTC](https://www.ruby-forum.com/t/re-how-do-i-find-a-windows-process-with-a-specific-window-t/87841/1 "2007-03-06T11:02:19Z")

</div>

> Hi there. I’m still kind of new to scripting with Ruby. I have  
> written a small Ruby/Fox app that displays a message in a window at  
> regular intervals. The ‘regular intervals’ part is done using the  
> Windows Task Scheduler.

> I’d like only one message window to appear at a time though. What I  
> am seeing is that if I step away from my computer for a few hours,  
> there can sometimes be several of these popup windows on the desktop.

> I’d like the app to check (when it first starts up) to see if there  
> are any other instances of this popup window on the desktop, and if  
> so, just exit… or maybe kill the other window’s process (I haven’t  
> decided which yet).

May be it’s better to try another way:

1. Check that some file is being open or exists
2. Using Win32 API you can register unique objects that another instance  
of your application is running (as far as I can remember they called  
“atoms” in MSDN)
3. … and so on.

Finding a window isn’t the only and the best way to check if you are  
already running some process (it’s platform dependent and there can be  
another window with title ‘foo’).
