AutoHotkey Community

It is currently May 27th, 2012, 11:59 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: November 22nd, 2005, 8:52 pm 
Offline

Joined: February 7th, 2005, 11:11 am
Posts: 192
Location: Munich, Germany
Hi Chris!
I've the following script running in the background and exactly every 2 minutes the "A_GuiEvent" is triggered so that the alt-tab function switches my programs. Do you have any explanation for that behaviour?
This script is running under W98 with IE6 (from where the Calendar-Class is(?)).
Short version:
Code:
gui, add, MonthCal, gDatum vADat Multi
...
return

Datum:
if A_GuiEvent=Normal
{
...
send, !{tab}
}
return

Full proggi:
Code:
/*
This script shows a Calendar. If you click on a date this date is been put into the clipboard.
A shift-click on a second date puts "FirstDate - SecondDate" into the clipboard.
"strg-e" opens an InputBox. You may enter your prefered date-format there.
You can not compile this script because it's self-modifing!
There's no use to format the script with indents due to the self-modifing. All indents will be deleted after closing the Gui.
Have fun! www.kapege.de
*/
#NoTrayIcon
title=MiniCal
IniRead, X, %A_ScriptFullPath%, Coord, x, 1
IniRead, Y, %A_ScriptFullPath%, Coord, y, 1
IniRead, F, %A_ScriptFullPath%, Coord, Format, 1
; "+ToolWindow" prevents the MonthCal from appearing in the Alt-Tab list
gui, +ToolWindow -MaximizeBox -LastFound -SysMenu ; +AlwaysOnTop
gui, add, MonthCal, gDatum vADat Multi
gui, show, x%X% y%Y% NoActivate, %title%
return

Datum:
if A_GuiEvent=Normal
{
StringSplit, VonBis, ADat,-
FormatTime, ADat1, %VonBis1%, %F%
FormatTime, ADat2, %VonBis2%, %F%
if (ADat1=ADat2)
ADat=%ADat1%
else
ADat=%ADat1% - %ADat2%
Clipboard=%ADat%
send, !{tab}
}
return

^e::
InputBox, Format, %title%, Enter new date format,,150,110,,,,,%F%
if ErrorLevel=0
{
IniWrite, %Format%, %A_ScriptFullPath%, Coord, Format
F :=Format
}
return

GUIEscape:
GUIClose:
WinGetPos, x, y,,,A
IniWrite, %x%, %A_ScriptFullPath%, Coord, x
IniWrite, %y%, %A_ScriptFullPath%, Coord, y
ExitApp
return

; Do not delete the next line with the /* !!!
/*

[Coord]
x=1288
y=497
Format=dd.MM.yy

_________________
Peter

Wisenheiming for beginners: KaPeGe (German only, sorry)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2005, 2:10 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
This behavior appears to be an intentional feature of the MonthCal control. The reasoning behind it is that the control sends an MCN_SELCHANGE message "just in case" a new day has arrived. Of course, what it should do is send the notification only if the date has actually changed, but it doesn't.

I'd like to fix this annoying behavior by suppressing the message except when it occurs within 2 minutes after midnight. However, there doesn't appear to be any easy way to distinguish between a user-generated change of the control and one that occurs automatically every two minutes, so we might be stuck with it the way it is.

In any case, I'll add the behavior to the documentation.

Thanks.


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

All times are UTC [ DST ]


Who is online

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