Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

VB Question

  • 30-11-2001 08:40PM
    #1
    Closed Accounts Posts: 53 ✭✭


    I need to write a small app that will check to see if a window is active every 5 mins and if not activate it. Does anyone know of an app that could be downloaded to do this? I think it could be done easily with VB using the appactivate command?? Does anyone know how it could run on a timer?


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    To run it on a timer just include a form in you vb app and add a timer control to it. Then within a class module, or bas file, create in instance of the form, without making it visible, and you have access to the timer. Note: the timercontrol's intervals only go up to 60 seconds so you'll have to code around this. Or you could write your own :)


    For activating the app you could use the SetFocusAPI method in user32. Look it up in the api viewer. All you need is to pass a windows handle for the application in question and it will bring it to the top and set the focus on it. Any questions don't be afraid to ask.


Advertisement