Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 01, 2015, 02:59:17 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Always on top  (Read 2251 times)

oblivion

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 386
    • View Profile
    • Donate to Member
Always on top
« on: October 04, 2011, 01:56:45 PM »
Just a quick question -- I hope!

I want to make a GUI button that I can float over another application, but I can't work out if I can create a GUI with an always-on-top type of attribute.

If I can't, can anyone suggest something I could bolt on that would have a similar effect?

-- bests, Tim

...this space unintentionally left blank.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,391
    • View Profile
    • Donate to Member
Re: Always on top
« Reply #1 on: October 04, 2011, 01:59:56 PM »
Just add the following to your AHK code (assuming it's the first GUI):

Code: Autohotkey
  1. Gui, +AlwaysOnTop
  2.  

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,534
    • View Profile
    • Donate to Member
Re: Always on top
« Reply #2 on: October 04, 2011, 02:13:08 PM »
Or grab a copy of WinButtons, that even has a nice configuration editor WinButtonEdit, and can easily be configured to be Always On Top :D

oblivion

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 386
    • View Profile
    • Donate to Member
Re: Always on top
« Reply #3 on: October 04, 2011, 04:38:33 PM »
Just add the following to your AHK code (assuming it's the first GUI):

Code: Autohotkey
  1.  
  2. Gui, +AlwaysOnTop
  3.  

Thanks! (I was sure I'd checked all the possibilities for Gui in the help -- I must be getting old.)  :-[
-- bests, Tim

...this space unintentionally left blank.

oblivion

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 386
    • View Profile
    • Donate to Member
Re: Always on top
« Reply #4 on: October 12, 2011, 05:05:17 PM »
Or grab a copy of WinButtons, that even has a nice configuration editor WinButtonEdit, and can easily be configured to be Always On Top :D
I looked quite hard at it. I think if I was starting from the point of wanting a button-based launcher-type thing, I'd have used it. But as it was, I was trying to add functionality to something I'd already written, and after making my own head spin for a while, decided against.

For what it's worth, I'd set up a couple of context-sensitive hotkeys but wanted to replicate the functionality of one of them with something a bit more visible. I created a timer loop that checks to see if two specific applications are running and, if the one of them relevant to the hotkey has focus, puts a small (64x64) button onscreen, with alwaysontop set and the notaskbar attribute too so it's not too obtrusive, and if either of the applications closes, the button's destroyed again.

It works well except for the slight timelag caused by the fact that I've put a 2 second delay on it so as not to take too much cpu when there's little happening. That bit I haven't really experimented with much, to be honest, but as long as it doesn't do anything nasty like leak memory, I'm quite happy with the way it works.

Thanks for both your help, anyway: gave me the focus on the thinking I needed to get what I wanted to happen!  :Thmbsup:
-- bests, Tim

...this space unintentionally left blank.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,534
    • View Profile
    • Donate to Member
Re: Always on top
« Reply #5 on: October 13, 2011, 01:51:52 PM »
except for the slight timelag caused by the fact that I've put a 2 second delay on it
I'm using a loop delay of 0.1 second in WinButtons, and I don't see much cpu load while it's running, but that could be my system, as I'm running it on an i7-860 (quad-core with HT, so 8 virtual CPU's 8))

oblivion

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 386
    • View Profile
    • Donate to Member
Re: Always on top
« Reply #6 on: October 13, 2011, 01:59:21 PM »
except for the slight timelag caused by the fact that I've put a 2 second delay on it
I'm using a loop delay of 0.1 second in WinButtons, and I don't see much cpu load while it's running, but that could be my system, as I'm running it on an i7-860 (quad-core with HT, so 8 virtual CPU's 8))

Some people are just showoffs.  :mrgreen:

Once I get over myself a bit  ;) I'll see if I can elbow my code into Winbuttons, mostly because I like the idea of a graphic button.  8)
-- bests, Tim

...this space unintentionally left blank.