Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Notify() - multiple easy tray area notifications - v0.4991


  • Please log in to reply
319 replies to this topic
segalion
  • Members
  • 50 posts
  • Last active: Oct 16 2014 09:20 AM
  • Joined: 02 Feb 2011

I'm getting this same problem as quoted above.
http://www.autohotke...read-will-exit/

I have no idea how the GUI numbers are going out of bounds though. My user reported the error so I cannot reproduce it..

 

Long time ago, I found problems with functions on timers that work with HEX format. Sometimes, timers are launched when SetFormat is in HEX mode, an make then fail...

 

I have reduce those problems with "SetFormat, Integer, D" just before reading the number inside label...

_Notify_Flash_25:
    SetFormat, Integer, D
    StringReplace, FlashGN, A_ThisLabel, _Notify_Flash_


gwarble
  • Members
  • 624 posts
  • Last active: Aug 12 2016 07:49 PM
  • Joined: 23 May 2009

Hey all, thanks for the great feedback and suggestions and bug reports... I haven't looked at this function in a while (but still use it every day, hundreds of times across a dozen or so computers)

 

I will try to make the time to go through the issues posted but free time for fun stuff like this is pretty limited...

 

so working backwards:

 

segalion: thanks for the tip, i'll implement this in the main function, looks like a good idea

 

erln: options1="GC=BA908E TC=White MC=White AX Image=%filename%" is incorrect AHK code, you probably don't want to send %filename% in a string to a function that has no global vars... try options1 := "GC... AX Image=" filename

 

robertcollier4: Thanks, looks like we came up with a lot of the same ideas for our functions!

 

jimmyfrancoeur: you'd have to make a persistant application using Notify() and its "update" function, if you read backwards in the thread you should find discussion on this ability and its usage, but basically use "Update" parameter...

 

guest re: gui numbers going out of bounds... i'm not sure of the cause yet but segalion suggests a solution i will implement, further testing will be asked... thanks for the bug report

 

Larctic: not sure what problem you're having, but you should manually close each notification and see if it solves it...

 

guest re: WinWaitClose 0 defaults to 0.5s... thanks, will implement this bug fix! i usually use "-.01" as my "user" fix

 

JamixZol: thanks for explaining, i don't think i ever documented the wallpaper "feature" more than in this thread

 

guest3456 (i guess you're a user and not a guest!): i'll check the links after this post, thanks... and i'll look back and try to document the wallpaper if still needed (it wasn't ever fully bug tested or feature enhanced)

 

Bartimus: if you still need help post again, sorry i haven't dug into your code post enough to know the problem, except there could likely be a bug with how Notify handles that long and complex file path!

 

k hope that helps for tonight...

- gwarble

[email protected]

 

Edit: I've updated the links in the first post to my own server:

http://www.gwarble.com/ahk/Notify/

http://www.gwarble.c...tify/Notify.ahk

 

test5.gif



erln
  • Members
  • 8 posts
  • Last active: Dec 22 2015 10:42 AM
  • Joined: 24 Jun 2013

Hey all, thanks for the great feedback and suggestions and bug reports... I haven't looked at this function in a while (but still use it every day, hundreds of times across a dozen or so computers)

 

I will try to make the time to go through the issues posted but free time for fun stuff like this is pretty limited...

 

so working backwards:

 

segalion: thanks for the tip, i'll implement this in the main function, looks like a good idea

 

erln: options1="GC=BA908E TC=White MC=White AX Image=%filename%" is incorrect AHK code, you probably don't want to send %filename% in a string to a function that has no global vars... try options1 := "GC... AX Image=" filename

 

robertcollier4: Thanks, looks like we came up with a lot of the same ideas for our functions!

 

jimmyfrancoeur: you'd have to make a persistant application using Notify() and its "update" function, if you read backwards in the thread you should find discussion on this ability and its usage, but basically use "Update" parameter...

 

guest re: gui numbers going out of bounds... i'm not sure of the cause yet but segalion suggests a solution i will implement, further testing will be asked... thanks for the bug report

 

Larctic: not sure what problem you're having, but you should manually close each notification and see if it solves it...

 

guest re: WinWaitClose 0 defaults to 0.5s... thanks, will implement this bug fix! i usually use "-.01" as my "user" fix

 

JamixZol: thanks for explaining, i don't think i ever documented the wallpaper "feature" more than in this thread

 

guest3456 (i guess you're a user and not a guest!): i'll check the links after this post, thanks... and i'll look back and try to document the wallpaper if still needed (it wasn't ever fully bug tested or feature enhanced)

 

Bartimus: if you still need help post again, sorry i haven't dug into your code post enough to know the problem, except there could likely be a bug with how Notify handles that long and complex file path!

 

k hope that helps for tonight...

- gwarble

[email protected]

 

Edit: I've updated the links in the first post to my own server:

http://www.gwarble.com/ahk/Notify/

http://www.gwarble.c...tify/Notify.ahk

 

test5.gif

 

 

Thanks for reply



Trubbleguy
  • Members
  • 122 posts
  • Last active: Jan 15 2017 10:50 AM
  • Joined: 20 Jan 2007

Needed a way to recreate a Permanent message if it was being updated instead of replaced, the update routine has no error-level if the message was not there because it had been clicked, i added a line to the Update code to simply return a 2 if the window no longer existed, i can now instantly recreate the window and update the new window if notify returns a 2.

Thanks for a great bit of work on your part, I cant wait till you figure out a "DOCKING" option so i can dock into any window i choose to display it on.

My Code:
Tz:=Notify("Select new form or input box and press F2 to Paste",Data, ,0, "Update=" Notify_ID )
if tz=2
{
Notify_ID:=Notify( "", "",0) ;rebuild and show empty message
Notify("Select new form or input box and press F2 to Paste",Data, ,0, "Update=" Notify_ID ) ;update the message
}

Your Modified Code: (line 105 on)

  If Update <>			; option "Update=ID" being used, Notify window will not be created
  {			; title, message, image and progress position can be updated
      If Title <>
       GuiControl, %Update%:,_Title_,%Title%
       	if errorlevel               ;non existant control means its gone.
	   Return 2                 ;return 2 so i can recreate it
      If Message <>
       GuiControl, %Update%:,_Message_,%Message%
      If Duration <>
       GuiControl, %Update%:,_Progress_,%Duration%
      If Image <>
       GuiControl, %Update%:,_Image_,%Image%
      If Wallpaper <>
       GuiControl, %Update%:,_Wallpaper_,%Image%
      Return
  }



gwarble
  • Members
  • 624 posts
  • Last active: Aug 12 2016 07:49 PM
  • Joined: 23 May 2009
Thanks for pointing that out...

As for the dockable notify's, would love to have this also but havent had the time to implement it yet...
Could easily be a new function, say NotifyD() for docked version, with small changes to location to be relative to the hwnd given... but then it needs to use or recreate the functionality of DockA() (i think thats the one, from maj probably) to move along with the window...

Hard to create a comfortable syntax for this and notify's on the left edge of the screen... but definitely doable with a little thought... someday...

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011

Long time ago, I found problems with functions on timers that work with HEX format. Sometimes, timers are launched when SetFormat is in HEX mode, an make then fail...
 
I have reduce those problems with "SetFormat, Integer, D" just before reading the number inside label...

_Notify_Flash_25:
    SetFormat, Integer, D
    StringReplace, FlashGN, A_ThisLabel, _Notify_Flash_



hrmmm this is very strange to me, i dont really understand the bug you're suggesting. are you saying that another part of the script has changed the Integer format to Hex, and then when this timer is called, then it tries to use the Hex value for %FlashGN% ?

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011

Seems that there are a bug with the flash in notify. Sometimes after a long time it shows an error trying to execute new inexistent thread:

Usually:
Gui, 127:Color, Silver

I dont know how FlashGN2 get the 127 value.

One time it get the 126 value.

I'm getting this same problem as quoted above.
http://www.autohotke...read-will-exit/

I have no idea how the GUI numbers are going out of bounds though. My user reported the error so I cannot reproduce it..

Long time ago, I found problems with functions on timers that work with HEX format. Sometimes, timers are launched when SetFormat is in HEX mode, an make then fail...
 
I have reduce those problems with "SetFormat, Integer, D" just before reading the number inside label...
_Notify_Flash_25:
    SetFormat, Integer, D
    StringReplace, FlashGN, A_ThisLabel, _Notify_Flash_



hrmmm are you saying that another part of the script has changed the Integer format to Hex, and then when this timer is called, then it tries to use the Hex value for %FlashGN% and %FlashGN2% ?

i guess this could make sense, and is a very sneaky bug indeed. the default Notify seems to use gui nums 50-74 and then the %FlashGN2% seems to use gui nums 75-99 if i've done the math properly. this would seem to hold true, since segalion reported out of bounds guis of 126, 127, and i've had reports of 133, 135, and 138.

the numbers 75-99 in hex, when converted to decimal are: 117-153

if i get a chance i will do some testing

HockeyZ39
  • Members
  • 14 posts
  • Last active: Oct 25 2013 04:01 AM
  • Joined: 15 Dec 2012

I cannot for the life of me get the "X-Close" or timeout label calls to work. Am I doing something wrong? The click label call works just fine. I am using the newest Notify lib.

 

 

Here is an example that doesn't work for me:

F3::
	Notify("Title",,3,"AC=lbClick AT=lbTimeout AX=lbClosed")
return

lbClick:
	MsgBox,% "click works"
return

lbTimeout:
	MsgBox,% "timeout works"
return

lbClosed:
	MsgBox,% "test success"
return


gwarble
  • Members
  • 624 posts
  • Last active: Aug 12 2016 07:49 PM
  • Joined: 23 May 2009
Sounds reasonable to me, i will see what i can find in tests as well

Going to try to get this function cleaned up and updated to new _l standards (not objects though, someone else has to tackle that)

So anyone know why i wouldn't have used Notify_Wait() or Notify_Update() type auxiliary functions? I might go that route, should make for cleaner code and easier to remember usage, thoughts?

gwarble
  • Members
  • 624 posts
  • Last active: Aug 12 2016 07:49 PM
  • Joined: 23 May 2009

I cannot for the life of me get the "X-Close" or timeout label calls to work. Am I doing something wrong? The click label call works just fine. I am using the newest Notify lib


Hmm, looks right, let me look into it

edit: actually it looks like this was never fully implemented! sorry i'll work it into the next update

HockeyZ39
  • Members
  • 14 posts
  • Last active: Oct 25 2013 04:01 AM
  • Joined: 15 Dec 2012

Hmm, looks right, let me look into it

edit: actually it looks like this was never fully implemented! sorry i'll work it into the next update

 

Awesome. Excellent work by the way!



HockeyZ39
  • Members
  • 14 posts
  • Last active: Oct 25 2013 04:01 AM
  • Joined: 15 Dec 2012

I actually have another question which may be alot easier than I am making it.

 

What would be the best way to trap a variable value from a constant loop at the time that the notify is called so that said variable can be included in the label called by the click action? 

 

The way I am going about it now seems quite messy. Basically when I call notify I append the desired value to a global variable. When the click label is called I loop through the text of all active notify windows (the value I am after is in the display text) then determine which one is missing and set that as the variable. I feel like I am probably overlooking a method that would be much easier.



gwarble
  • Members
  • 624 posts
  • Last active: Aug 12 2016 07:49 PM
  • Joined: 23 May 2009
Hmm, good question

not a bad way, but you could improve it probably by keeping track and not searching a list every time...

edit: nope, that won't work... i'll try to incorporate a solution into Notify() but the Return feature doesn't update any statics when clicked...

edit: try making these two edits to Notify.ahk:
tack on ,vvv to the end of the last static line near the top
on a new line right before
If IsLabel(_Notify_Action := Temp_Notify_Action)
put
vvv := A_Gui


so for your call:
v := Notify("Blue","","","AC=Label")
VarTrack_%v% := "Blue"
v := Notify("Red","","","AC=Label")
VarTrack_%v% := "Red"

then in your AC=Label routine put:
v := Notify("","","","Return=vvv")
Notify(VarTrack_%v% " clicked!")

HockeyZ39
  • Members
  • 14 posts
  • Last active: Oct 25 2013 04:01 AM
  • Joined: 15 Dec 2012

Hmm, good question

not a bad way, but you could improve it probably by keeping track and not searching a list every time...

edit: nope, that won't work... i'll try to incorporate a solution into Notify() but the Return feature doesn't update any statics when clicked...

edit: try making these two edits to Notify.ahk:
tack on ,vvv to the end of the last static line near the top
on a new line right before
If IsLabel(_Notify_Action := Temp_Notify_Action)
put
vvv := A_Gui


so for your call:
v := Notify("Blue","","","AC=Label")
VarTrack_%v% := "Blue"
v := Notify("Red","","","AC=Label")
VarTrack_%v% := "Red"

then in your AC=Label routine put:
v := Notify("","","","Return=vvv")
Notify(VarTrack_%v% " clicked!")

 

Beautiful! Worked perfectly. Thank you again.



gwarble
  • Members
  • 624 posts
  • Last active: Aug 12 2016 07:49 PM
  • Joined: 23 May 2009
Sweet, no prob... I'll add something like that to the next version