AutoHotkey Community

It is currently May 27th, 2012, 3:39 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: November 2nd, 2005, 11:20 am 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
Hi,

I'm using AutoHotkey 1.0.40.03 (same problem with another 1.0.4xxx version I used before) on Windows 2000 and have a strange problem with TrayTip, as to be seen in all detail here:

http://www.autohotkey.com/forum/viewtop ... sc&start=0


It's not even working correctly in this tiny script:

Code:
;http://www.autohotkey.com/forum/viewtopic.php?t=135&highlight=auto+reload
$^s::
IfWinActive, AutoHotkey
{
   Send, ^s
    Reload
    TrayTip, Timed TrayTip, updated AutoHotkey script
    SetTimer, RemoveTrayTip, 6000
    return

    RemoveTrayTip:
    SetTimer, RemoveTrayTip, Off
    TrayTip
return
}
else
   Send, ^s
return
;http://www.autohotkey.com/forum/viewtopic.php?t=135&highlight=auto+reload


Sometimes TrayTip shows up for a second, but mostly only just for 0.1 seconds or so... :?

_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2005, 12:35 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Dear brotherS,

have your tried this?
Code:
$^s::
  Send, ^s
  IfWinActive, AutoHotkey
    {
       TrayTip, Timed TrayTip, updated AutoHotkey script
       SetTimer, RemoveTrayTip, 6000
     }
return

RemoveTrayTip:
    SetTimer, RemoveTrayTip, Off
    TrayTip
    Reload
return
*not tested*
I have cleand up the code a bit, but it should do exactly what I think your code is supposed to do. Please check. Thanks.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2005, 12:46 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
Also if it can't work in the first script postet there seems to be a problem...
This script works at my pc at work but doesn't at my laptop at home (same ahk-version):

Code:
#Persistent
Gui, Add, Groupbox, x10 r2.5 w180 section, Zeiteingabe
Gui, Add, Text, xs+10 ys+20 section, HH/MM/SS
Gui, Add, Edit, xs+0 ys+20 w20 vHours gSchnelleEingabeHour Number Limit2,
Gui, Add, Edit, xs+25 ys+20 w20 vMinutes gSchnelleEingabeMinutes Number Limit2,
Gui, Add, Edit, xs+50 ys+20 w20 vSeconds gSchnelleEingabeSeconds Number Limit2,
Gui, Add, Button, xs+0 ys+50 gSubmit Default, OK
Gui, Add, Button, xs+40 ys+50 gHide, Hide
Gui, Add, Button, xs+90 ys+50 gExit, Exit
Gui, Show,, TrayTimer
return


Submit:
Gui, Submit,
CountDown = %Hours%%Minutes%%Seconds%  ; 6 digits = HHmmSS
C = %A_TickCount%
SetTimer ShowTime
return


Hide:
WinHide, TrayTimer
return

Exit:
ExitApp
return


;Show Window
^!o::
WinShow, TrayTimer
WinActivate, TrayTimer
GuiControl, Focus, Hours
return


;Update Time
ShowTime:
   T = 20000101%CountDown%
   T += (C-A_TickCount)/1000,Seconds
   FormatTime FormdT, %T%, H : mm : ss
   TrayTip,,%FormdT%
   IfEqual FormdT, 0 : 00 : 00, SetTimer ShowTime, Off
Return





SchnelleEingabeHour:
Gui, Submit, NoHide
Chars := StrLen(Hours)
if Chars = 2
{
   GuiControl, Focus, Minutes
   Send, {SHIFTDOWN}{HOME}{SHIFTUP}
}
return


SchnelleEingabeMinutes:
Gui, Submit, NoHide
Chars := StrLen(Minutes)
if Chars = 2
{
   GuiControl, Focus, Seconds
   Send, {SHIFTDOWN}{HOME}{SHIFTUP}
}
return


SchnelleEingabeSeconds:
Gui, Submit, NoHide
Chars := StrLen(Seconds)
if Chars = 2
{
   GuiControl, Focus, Hours
   Send, {SHIFTDOWN}{HOME}{SHIFTUP}
}
return

<EDIT 02.11.2005 Thalon>
At home I can open the gui, but if I close it to show the remaining time as tooltip I do not see anything!
It is just a small timer-programm (open gui with ctrl-alt-o, enter time and submit with enter or button, then a counter is shown as tooltip (counterprogram written by laszlo(?), just added gui..))
</EDIT>

I'll try to shorten it when I am at home...

Thalon


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2005, 2:31 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
Something worth checking if you haven't already (from the manual):
"Similarly, if the following REG_DWORD value exists and has been set to 0, TrayTip will not function:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced >> EnableBalloonTips"

brotherS' and Thalon's scripts both appear to display traytips fine for me on a pc and a laptop.

Thalon, if you get your script worknig for yourself, you'll probably want to get rid of the "pop" sound when updating the traytip, by the following (from the manual again):
"Windows XP usually plays a sound when displaying a balloon tip. This sound can be disabled by adding 16 to the Options parameter."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2005, 2:47 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I've heard other people report problems with TrayTip too. Here is the code in case any programmers in the audience can spot a bug it:
Code:
if (!g_os.IsWin2000orLater()) // Older OSes do not support it, so do nothing.
   return OK;
NOTIFYICONDATA nic = {0};
nic.cbSize = sizeof(nic);
nic.uID = AHK_NOTIFYICON; // Must match tray icon's uID or Shell_NotifyIcon() will fail.
nic.hWnd = g_hWnd;
nic.uFlags = NIF_INFO;
nic.uTimeout = ATOI(aTimeout) * 1000;
nic.dwInfoFlags = ATOI(aOptions);
strlcpy(nic.szInfoTitle, aTitle, sizeof(nic.szInfoTitle)); // Empty title omits the title line entirely.
strlcpy(nic.szInfo, aText, sizeof(nic.szInfo));   // Empty text removes the balloon.
Shell_NotifyIcon(NIM_MODIFY, &nic);


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2005, 3:17 pm 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
toralf wrote:
have your tried this:
...
I have cleand up the code a bit, but it should do exactly what I think your code is supposed to do. Please check. Thanks.

Wow, this works! :D

Thanks toralf!

_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2005, 3:19 pm 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
evl wrote:
Something worth checking if you haven't already (from the manual):
"Similarly, if the following REG_DWORD value exists and has been set to 0, TrayTip will not function:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced >> EnableBalloonTips"

brotherS' and Thalon's scripts both appear to display traytips fine for me on a pc and a laptop.

Hmm, I don't have "EnableBalloonTips" there at all... but toralf's version is working... is it set to 1 for you?

_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2005, 3:37 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
brotherS wrote:
toralf's version is working
That is good to know. your code had
1) a subroutine inside of a hotkey routine
2) too many return statements (to my taste)
3) to reload the script before the death time of the tooltip was reached.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2005, 3:47 pm 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
Thanks for telling me details, that's how I learn best. Now let me try some other scripts :)

_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2005, 11:19 am 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
@all
I will try this useful tipps!

Thalon


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2005, 12:48 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
brotherS wrote:
Hmm, I don't have "EnableBalloonTips" there at all... but toralf's version is working... is it set to 1 for you?


That's correct then - it would only be there if you'd created it one way or another - the default when the value doesn't exist is for the traytip to be displayed.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2005, 8:47 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
So, I tried it at my notebook again:
EnableBalloonTips has been zero, but setting it to 1 or also deleting it doesn't change anything...

But it doesn't really matter...
The script was only written to remind me watching into browser-game when I am at work ^^

Thalon


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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