 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Tom Guest
|
Posted: Sun Dec 06, 2009 3:08 pm Post subject: |
|
|
Thanks
Got it work. This looks FANTASTIC
Hopefully an easy question...
Anyway for one popup to kill another popup quickly ?
Thanks |
|
| Back to top |
|
 |
gwarble
Joined: 23 May 2009 Posts: 127 Location: north bay, california
|
Posted: Sun Dec 06, 2009 8:44 pm Post subject: |
|
|
i guess i should finish some documentation for this function since the thread is getting kind of long maybe its not all being read... but the last example of the first post does show how to do that
| Code: | var := Notify("first")
Notify("","",0,"Wait",var) ;= kills immediately
var := Notify("second")
Notify("","",-5,"Wait",var) ;= kills after 5 seconds
var := Notify("third")
Notify("","",5,"Wait",var) ;= waits 5 seconds or until its gone, but dont force kill it
var := Notify("fourth") |
i'm glad you like the function... i find it pretty useful and appreciate the feedback
- gwarble
Last edited by gwarble on Sun Dec 06, 2009 10:52 pm; edited 1 time in total |
|
| Back to top |
|
 |
Tom Guest
|
Posted: Sun Dec 06, 2009 10:27 pm Post subject: |
|
|
Thanks gwarble
My first notifier is:
| Code: | | Notify("Notification On","",0,"TC=Black TS=8 AX=off") |
The second is:
| Code: | | Notify("Notification Off","",0,"TC=Black TS=8 AX=off") |
How can the second kill the first ? |
|
| Back to top |
|
 |
gwarble
Joined: 23 May 2009 Posts: 127 Location: north bay, california
|
Posted: Sun Dec 06, 2009 10:48 pm Post subject: |
|
|
it can't... look at the code above, you need a "wait" call before the second... with a reference variable so it knows which to wait for (ie: var above)
try that code in a new script and watch
- gwarble |
|
| Back to top |
|
 |
Tom Guest
|
Posted: Wed Dec 09, 2009 1:14 pm Post subject: |
|
|
Thanks gwarble
I understand that now..
Is there any way to detect if another popup is active ?
If I try to kill one and it doesn't exist I can a very polite error message !
Thanks again. |
|
| Back to top |
|
 |
gwarble! Guest
|
Posted: Thu Dec 10, 2009 2:00 am Post subject: |
|
|
no there isn't at this point, but different return values could easily be added if the wait succedes or not...
until i have a chance to change it u can quickly change:
| Code: | _Notify_Wait_:
;Critical
If (Image)
{
Gui %Image%:+LastFound
If NotifyGuiID := WinExist()
{
WinWaitClose, , , % Abs(Duration)
If (ErrorLevel && Duration < 1)
{
Gui, % Image + GL - GF + 1 ":Destroy"
DllCall("AnimateWindow","UInt",NotifyGuiID,"Int",ST,"UInt", "0x00050001")
Gui, %Image%:Destroy
Return 1 ;successfully closed
}
}
Return 0 ;unsuccessful
}
Else
{
Notify("No Notification specified to wait for!","waiting for all notifications is not yet implemented",10,"IN=8",A_WinDir "\explorer.exe")
Return 0
} |
or something to that effect... then use:
| Code: | If !Notify("","",0,"Wait",NotifyID)
MsgBox, Error! |
|
|
| Back to top |
|
 |
Tom Guest
|
Posted: Thu Dec 10, 2009 11:51 am Post subject: |
|
|
Thanks gwarble!
Sorted  |
|
| Back to top |
|
 |
Tom Guest
|
Posted: Thu Dec 10, 2009 8:39 pm Post subject: |
|
|
Hmm.. got an error Label _Notify_Wait_: already in use ??
I've not specified it ! help  |
|
| Back to top |
|
 |
Tom Guest
|
Posted: Fri Dec 11, 2009 11:12 am Post subject: Issues with link.. |
|
|
Hi
I sure I've missed some thing, but using this code I have a slight issue:
#Include Notify.ahk
| Code: | F10::
var:=Notify("HELLO CLICK ME","",3,"GC=" BGColour " TC=Red TS=8 AC=Clicked AX=off")
return
Clicked:
Notify("","",0,"Wait",var)
var2:=Notify("OWWWW !!","",3,"GC=" BGColour " TC=Red TS=8 AX=off")
return |
Press F10 and a popup appears saying 'Hello Click Me', clicking the popup I get a new popup saying 'Owwww !!'
However whilst the second popup is on screen, if I click F10 again, I don't get a new 'Hello Click Me' I get a new 'Owwww !!' BUT I can now click on this new one and it responds to the click and open a new 'Owwww !!'..
Any Ideas ?? |
|
| Back to top |
|
 |
Tom Guest
|
Posted: Fri Dec 11, 2009 9:30 pm Post subject: |
|
|
hmmm... changing it to this seems to work ? Any issues doing this ?
| Code: |
F10::
var:=Notify("HELLO CLICK ME","",3,"GC=" BGColour " TC=Red TS=8 AC=Clicked AX=off")
Return
Clicked:
Notify("","",0,"Wait",var)
var2:=Notify("OWWWW !!","",3,"GC=" BGColour " TC=Red TS=8 AC=off AX=off")
Notify("","",3,"Wait",var2)
Return
|
Thanks  |
|
| Back to top |
|
 |
gwarble
Joined: 23 May 2009 Posts: 127 Location: north bay, california
|
Posted: Sun Dec 20, 2009 8:04 am Post subject: |
|
|
hey, sorry i didnt see these posts til now...
i'm able to duplicate this behavior and i'll have to look closer into the cause of this bug but its mainly because the notify_wait is waiting for the active window (pausing that thread, while the other thread is animateWindow'ing....)
i'll fix it sometime next month probably
- gwarble |
|
| Back to top |
|
 |
Tom Guest
|
Posted: Sun Dec 20, 2009 10:38 am Post subject: |
|
|
| gwarble wrote: | hey, sorry i didnt see these posts til now...
i'm able to duplicate this behavior and i'll have to look closer into the cause of this bug but its mainly because the notify_wait is waiting for the active window (pausing that thread, while the other thread is animateWindow'ing....)
i'll fix it sometime next month probably
- gwarble |
My fix of
| Code: | var2:=Notify("OWWWW !!","",3,"GC=" BGColour " TC=Red TS=8 AC=off AX=off")
Notify("","",3,"Wait",var2) |
Does seem to work ok !! |
|
| Back to top |
|
 |
gwarble
Joined: 23 May 2009 Posts: 127 Location: north bay, california
|
Posted: Sun Dec 20, 2009 5:47 pm Post subject: |
|
|
yeah it does, the problem is that if your script was trying to do something else during that second "wait" it would be paused
- gwarble |
|
| Back to top |
|
 |
Newbie_0815 Guest
|
Posted: Mon Dec 21, 2009 4:30 pm Post subject: |
|
|
add this to close notify with rightclick
| Code: | 50GuiContextMenu:
51GuiContextMenu:
52GuiContextMenu:
53GuiContextMenu:
54GuiContextMenu:
55GuiContextMenu:
56GuiContextMenu:
57GuiContextMenu:
58GuiContextMenu:
59GuiContextMenu:
60GuiContextMenu:
61GuiContextMenu:
62GuiContextMenu:
63GuiContextMenu:
64GuiContextMenu:
65GuiContextMenu:
66GuiContextMenu:
67GuiContextMenu:
68GuiContextMenu:
69GuiContextMenu:
70GuiContextMenu:
71GuiContextMenu:
72GuiContextMenu:
73GuiContextMenu:
74GuiContextMenu:
75GuiContextMenu:
76GuiContextMenu:
77GuiContextMenu:
78GuiContextMenu:
79GuiContextMenu:
StringReplace, GK, A_ThisLabel, GuiContextMenu
GK:=GK - GN +1
GoSub _Notify_Kill_%GK%
return |
|
|
| Back to top |
|
 |
Newbie_0815 Guest
|
Posted: Mon Dec 21, 2009 5:19 pm Post subject: |
|
|
| sorry, that was bullsh** |
|
| 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
|