Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Always bottom even if active possible ?


  • Please log in to reply
11 replies to this topic
Richard
  • Guests
  • Last active:
  • Joined: --
Hi,

I'm a new user of AutoHotKey and it works great !

I have the following need and I can't find a way to solve it.

I want a window to be always on bottom and I use the following script :

#Persistent
SetTimer, CheckBottom, 10
CheckBottom:
IfWinExist, MyWindow
  WinSet, Bottom
return

It doesn't works as I want because if I click on this window, it becomes active, topmost, and then goes bottom thanks to this script (and stay active as I want !).

The effect of this is all other displayed windows are flashing !

Is there a way to tell the window to stay bottom and never go topmost even when it is activated ?

Thanks,

Richard.

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004

Is there a way to tell the window to stay bottom and never go topmost even when it is activated ?

The activation must be prevented. I would use WinHide, and then if you need to work with a window again, make sure you have a hotkey that turns off the timer-check, then uses WinShow, then WinActivate. When you are done manually working with the window, use a hotkey to WinHide, then turn on the timer again.

I cant presently think of any other way how to handle it, although interception of each mouseclick and checking the window under the cursor, then allowing or nulling the mouseclick, is probably possible.

EDIT: You could also move the window off screen, or just minimize it and make sure not to touch that particular tab.
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Richard
  • Guests
  • Last active:
  • Joined: --
Thanks, but i don't want to prevent the activation of this window...

I just want to prevent it to leave bottom if I activate it...

Hiding it is not a solution because I want it to be always accessible...

Is there a solution ?

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
I understand the requirement now.

The answer to the question:

Always bottom even if active possible ?

is no, since by definition, the active window is topmost.

However, the following code will accomplish what you want:
#Persistent 
SetTimer, CheckBottom, 100 
CheckBottom: 
IfWinNotActive, MyWindow 
  WinSet, Bottom,, My Window
return

(i changed the timer interval from 10 to 100 since i think 10 millisec uses up too many cpu cycles)
EDIT: edited WinSet line to specify the window
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Richard
  • Guests
  • Last active:
  • Joined: --

I understand the requirement now.

The answer to the question:

Always bottom even if active possible ?

is no, since by definition, the active window is topmost.


The active window can be bottom the others. You can just try with the previous script. If the choosen window is active it is set bottom and is always active (i just try it again with a notepad and i can write in it while i only view a part of it since it is bottom the others...)

However, the following code will accomplish what you want:

#Persistent 
SetTimer, CheckBottom, 100 
CheckBottom: 
IfWinNotActive, MyWindow 
  WinSet, Bottom,, My Window
return

(i changed the timer interval from 10 to 100 since i think 10 millisec uses up too many cpu cycles)
EDIT: edited WinSet line to specify the window


I try your script, but as I said, I don't want the choosen window to be on top even if it is the active window....

In fact, I want this window to act as a desktop bottom all the other windows, and I want to put menus on it accessible at any time...

Perhaps I'm not using the right tool to do that ?

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
o.k. We need to be very specific in our terminology. I originally interpreted "bottom" to mean bottom of the window stack, not graphically below the other windows. I will review the posts and post again unless someone else solves it before i do.
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Richard
  • Guests
  • Last active:
  • Joined: --
Thanks for your help and sorry about the terminology I used (i'm French and Windows programming is not my speciality)

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
On July 26, 2005, in http://www.autohotke...opic.php?t=3320 i had suggested the following:

4) WinRestore, NoActivate option.

From the helpfile:

WinRestore: Remarks:
This command operates only upon the topmost [of the stack, not graphically] matching window except when WinTitle is ahk_group GroupName, in which case all windows in the group are affected.

Chris responded with:

You might try the following. If it produces a useful effect for you, I'll either document it in the help file (under WinRestore) or build it in somewhere:
DllCall("ShowWindow", UInt, WinExist("Untitled - Notepad", Int, 4) ; 4 = SW_SHOWNOACTIVATE, 8 = SW_SHOWNA

which unfortunately did not work for me (Win2000). You can certainly try the code Chris suggested though. I'm not sure if the goal is currently possible, sorry. Perhaps another can help, maybe shimanov.

parentheses corrected:
DllCall("ShowWindow", UInt, WinExist("Untitled - Notepad", Int, 4)) ; 4 = SW_SHOWNOACTIVATE, 8 = SW_SHOWNA 
return

1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Richard
  • Guests
  • Last active:
  • Joined: --
Thanks, but i'm also under Windows 2000 :(

shimanov
  • Members
  • 610 posts
  • Last active: Jul 18 2006 08:35 PM
  • Joined: 25 Sep 2005
Rajat's "Desktop Sidebar" demonstrates a method which may be your best hope without resorting to something more exotic. The only drawback, is that it removes the window button from the taskbar and from the task switcher (i.e., Alt+Tab).

Richard
  • Guests
  • Last active:
  • Joined: --
Thanks a lot !

I will try using that solution.

AutoHotKey is really a great product with a great community !

Richard.

Richard
  • Guests
  • Last active:
  • Joined: --
That's it !!!

It works like a charm !

I just have to do that to make my window always bottom (even if active) :

WinGet, Prnt, ID, Program Manager
WinGet, Chld, ID, My Window
DllCall("SetParent", Int, Chld, Int, Prnt)

Thanks a lot.

Richard.