AutoHotkey Community

It is currently May 27th, 2012, 12:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 258 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 18  Next
Author Message
 Post subject:
PostPosted: December 6th, 2009, 3:08 pm 
Thanks
Got it work. This looks FANTASTIC :D

Hopefully an easy question...
Anyway for one popup to kill another popup quickly ?

Thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2009, 8:44 pm 
Offline

Joined: May 23rd, 2009, 4:48 am
Posts: 363
Location: north bay, california
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 December 6th, 2009, 10:52 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2009, 10:27 pm 
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 ?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 6th, 2009, 10:48 pm 
Offline

Joined: May 23rd, 2009, 4:48 am
Posts: 363
Location: north bay, california
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2009, 1:14 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 2:00 am 
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!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 11:51 am 
Thanks gwarble!

Sorted :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 8:39 pm 
Hmm.. got an error Label _Notify_Wait_: already in use ??

I've not specified it ! help :?


Report this post
Top
  
Reply with quote  
 Post subject: Issues with link..
PostPosted: December 11th, 2009, 11:12 am 
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 ??


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2009, 9:30 pm 
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 :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2009, 8:04 am 
Offline

Joined: May 23rd, 2009, 4:48 am
Posts: 363
Location: north bay, california
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2009, 10:38 am 
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 !!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2009, 5:47 pm 
Offline

Joined: May 23rd, 2009, 4:48 am
Posts: 363
Location: north bay, california
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2009, 4:30 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2009, 5:19 pm 
sorry, that was bullsh**


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 258 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 18  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Cristi®, Google Feedfetcher, tidbit and 54 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group