AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Notify() v0.44 - multiple tray area notifications
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Tom
Guest





PostPosted: Sun Dec 06, 2009 3:08 pm    Post subject: Reply with quote

Thanks
Got it work. This looks FANTASTIC Very Happy

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

PostPosted: Sun Dec 06, 2009 8:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
Tom
Guest





PostPosted: Sun Dec 06, 2009 10:27 pm    Post subject: Reply with quote

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

PostPosted: Sun Dec 06, 2009 10:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Tom
Guest





PostPosted: Wed Dec 09, 2009 1:14 pm    Post subject: Reply with quote

Thanks gwarble Smile

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





PostPosted: Thu Dec 10, 2009 2:00 am    Post subject: Reply with quote

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





PostPosted: Thu Dec 10, 2009 11:51 am    Post subject: Reply with quote

Thanks gwarble!

Sorted Very Happy
Back to top
Tom
Guest





PostPosted: Thu Dec 10, 2009 8:39 pm    Post subject: Reply with quote

Hmm.. got an error Label _Notify_Wait_: already in use ??

I've not specified it ! help Confused
Back to top
Tom
Guest





PostPosted: Fri Dec 11, 2009 11:12 am    Post subject: Issues with link.. Reply with quote

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





PostPosted: Fri Dec 11, 2009 9:30 pm    Post subject: Reply with quote

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 Smile
Back to top
gwarble



Joined: 23 May 2009
Posts: 127
Location: north bay, california

PostPosted: Sun Dec 20, 2009 8:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Tom
Guest





PostPosted: Sun Dec 20, 2009 10:38 am    Post subject: Reply with quote

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

PostPosted: Sun Dec 20, 2009 5:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
Newbie_0815
Guest





PostPosted: Mon Dec 21, 2009 4:30 pm    Post subject: Reply with quote

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





PostPosted: Mon Dec 21, 2009 5:19 pm    Post subject: Reply with quote

sorry, that was bullsh**
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 6 of 9

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group