1. Win32Lib: code request
- Posted by Brian Broker <bkb at CNW.COM> Mar 30, 2000
- 449 views
Hi all, Does anybody have some code that will check if an instance of your program is already running, and if so, give the focus to that instance? I haven't really looked into it yet, I'm just hoping that somebody's already done the work to accomplish this. If not, I'll be sure to share my solution. thanx, Brian
2. Re: Win32Lib: code request
- Posted by Bernie Ryan <xotron at BUFFNET.NET> Mar 30, 2000
- 452 views
On Thu, 30 Mar 2000 01:45:11 -0500, Brian Broker <bkb at CNW.COM> wrote: >Hi all, > >Does anybody have some code that will check if an instance of your program >is already running, and if so, give the focus to that instance? I haven't >really looked into it yet, I'm just hoping that somebody's already done the >work to accomplish this. If not, I'll be sure to share my solution. > Brian: Use EnumWindows that uses a callback EnumWindowsProc and cycle through the top-levels windows using the EnumWindowsProc to check each window's title until it finds your window. Once you find it then you can set the focus. Bernie