 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
a_h_k
Joined: 02 Feb 2008 Posts: 626
|
Posted: Sat Jan 30, 2010 2:22 am Post subject: Make MsgBox AlwaysOnTop + Inactive |
|
|
| As the title says |
|
| Back to top |
|
 |
geekdude
Joined: 23 Nov 2009 Posts: 64
|
Posted: Sat Jan 30, 2010 3:56 am Post subject: |
|
|
umm... because you are well known, i will givu u script, but next time, show some effort
| Code: | WinGetActiveTitle, Title
MsgBox, The active window is "%Title%".
winset, alwaysontop, a
winactivate, %title%
return |
_________________ /\ /\ This is Kitty
(>';'<) Cut, copy, and paste kitty onto your sig.
((")(")) Help Kitty gain World Domination.
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination. |
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Sat Jan 30, 2010 4:26 am Post subject: |
|
|
I was going to provide a similar code,
but I suppose that you want the MsgBox to appear without being activated...
right? _________________ "Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried."
Antonio França
My stuff: Google Profile |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Sat Jan 30, 2010 6:39 am Post subject: |
|
|
| Quote: | | I suppose that you want the MsgBox to appear without being activated... |
| Code: | FileAppend, % "#NoTrayIcon`nWinActivate, ahk_id" WinExist( "A" ), temporary.ahk
FileSetAttrib, +H, temporary.ahk
Run, temporary.ahk
MsgBox, 262144, Title, Message
FileDelete, temporary.ahk |
EDIT - For some reason I thought MsgBox would supersede a timer . This is inspired by TheHangman's post below: | Code: | hwnd := WinExist( "A" )
SetTimer, DeactivateMsgBox, 10
MsgBox, 262144, Title, Message
Return
DeactivateMsgBox:
If Not WinActive( "ahk_class #32770" )
Return
WinActivate, ahk_id %hwnd%
SetTimer, DeactivateMsgBox, Off
Return |
_________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Last edited by jethrow on Sat Jan 30, 2010 8:26 am; edited 1 time in total |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Sat Jan 30, 2010 7:26 am Post subject: |
|
|
Have a look at Notify(), pretty, always on top and you can make it "clickable" as well but doesn't get in the way due to its toaster popup style. _________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
TheHangman Guest
|
Posted: Sat Jan 30, 2010 7:40 am Post subject: |
|
|
hmm.... that code (by geekdude) will not work. He forgot that the script (thread) halts until the msgbox is dismissed. This (crude) code shows a way to do it, basicly it starts a new thread to continue running the main code.
| Code: |
WinGetActiveTitle, Title
msgboxTitle = Always On Top
SetTimer, Continue, -50
MsgBox,, %msgboxTitle%, The active window is "%Title%".
Continue:
WinWait, %msgboxTitle%
WinSet, alwaysontop, On, %msgboxTitle%
winactivate, %title%
ToolTip, original window activated and script continues
WinWaitClose, %msgboxTitle%
ToolTip
MsgBox, the Always On Top msgbox has been closed
ExitApp |
|
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 626
|
Posted: Mon Feb 01, 2010 6:44 am Post subject: |
|
|
This is what i had when i posted this thread
| Code: | SetTitleMatchMode, 3
GroupAdd, MsgBox_group,, Hotkey is now running
SetTimer, here, -1000 ;use no less than ~1000, so doesn't open MsgBox as hidden
MsgBox,,, Hotkey is now running, 2
here:
WinWait,, Hotkey is now running
WinSet, AlwaysOnTop, On,, Hotkey is now running
GroupDeactivate, MsgBox_group, R
Return |
Tweaked it a bit, and currently using...
| Code: | SetTitleMatchMode, 3
GroupAdd, MsgBox_group,, Hotkey is now running
SetTimer, here, -1
MsgBox, 262144,, Hotkey is now running, 2 ;thnks jethrow! (saves an extra line)
here:
WinShow,, Hotkey is now running ;so can use SetTimer...-1
WinWait,, Hotkey is now running
GroupDeactivate, MsgBox_group, R
Return |
It's not perfect, but it works ok
| MasterFocus wrote: | | I suppose that you want the MsgBox to appear without being activated? | Ideally, it would appear inactive right from the get-go (i think this could be done using "Gui")
| hugov wrote: | | Have a look at Notify(), pretty, always on top and you can make it "clickable" as well but doesn't get in the way due to its toaster popup style | Before i would consider sth like that, i would like to exhaust all possible options using ahk's standard MsgBox & identical-to-MsgBox GUI |
|
| Back to top |
|
 |
a_h_k
Joined: 02 Feb 2008 Posts: 626
|
Posted: Mon Feb 01, 2010 7:12 am Post subject: |
|
|
| For interest, my other "parallel" thread --> Script not Exiting |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|