DonationCoder.com Software > Post New Requests Here
IDEA: Replace Hourglass with Quote from text file
nosh:
Random quotes, funny facts, system information like cpu usage...
-Coeluh (April 22, 2009, 03:37 AM)
--- End quote ---
Little (expandable) thumbnails of girlie pix!!!
No? OK, I'll just shut up.
r0bertdenir0:
Something like this maybe...
That's the basic structure I think - you'd just have to modify the IF statements that generate the tooltip so that it reads from a joke file, shows weather info, or even show reads nosh's My Pictures folder to show those girlie pix in a splash screen...
#SingleInstance,Force
#UseHook On
SetBatchLines,-1
IDC_APPSTARTING := 32650
IDC_WAIT := 32514
ShowWaitCursorTip:
{
loop
{
hCurAppStarting := DllCall("LoadCursor", "Uint", NULL, "Int", IDC_APPSTARTING, "Uint")
hCurWait := DllCall("LoadCursor", "Uint", NULL, "Int", IDC_WAIT, "Uint")
VarSetCapacity(CurrentCursorStruct, 20, 0)
NumPut(20, CurrentCursorStruct)
result := DllCall("GetCursorInfo", "str", CurrentCursorStruct)
hCursor := NumGet(CurrentCursorStruct, 8)
sTip :=
If(hCursor==hCurAppStarting)
{
sTip := "This should just take a sec..."
}
If(hCursor==hCurWait)
{
sTip := "This may take some time.... probably lots..."
}
ToolTip, %sTip%
Sleep, 20
}
Return
}
^!X::Gosub, EXIT
EXIT:
ExitApp
skooter1121:
Thanks (TaxiDriverWithStuckCapsLockKey)
But, I was unable to get your script to work.
I tried to load OpenOffice as a test case, but your "This should just take a sec..." would not show.
I've attached a text file of Oscar Wilde quotes I have created. I'd like to use it if possible.
-S
skrommel:
:) Try HourglassQuotes!
It displays a quote when the PC is busy, either from a file or from www.quotableonline.com.
Place the quotes in a text file and edit the files= and timer= lines.
To keep the quote from dissapearing, just click inside the window. It dissappears when it loses focus.
Skrommel
--- ---;HourglassQuotes.ahk
; Displays a quote when the PC is busy
;Skrommel @ 2009
delay=9 ;seconds to show the quote
file= ;file with quotes. if empty, retrieve quote from internet
internet=http://www.quotableonline.com/index.php ;url to page with random quote
html1:="<div class=leftnavText><blockquote id=blockquote > " ;text to look for before the quote
html2:="</blockquote>" ;text to look for after the quote
filter:=" " ;string to remove from the quote
#NoEnv
#SingleInstance,Force
applicationname=HourglassQuotes
IniRead,counter,%applicationname%.ini,Settings,counter
If (counter="Error" Or counter<1 Or counter>999999)
counter=1
If file=
Gosub,DOWNLOAD
Else
Gosub,READ
Loop
{
Sleep,1000
;Stolen from Sean at http://www.autohotkey.com/forum/topic32959.html
VarSetCapacity(ci,20,0),NumPut(20,ci)
DllCall("GetCursorInfo","Uint",&ci)
hCursor:=NumGet(ci,8)
If showing<>1
If hCursor In 65575,65557 ;65575=appstarting 65557=wait
{
Gui,Destroy
Gui,+ToolWindow +AlwaysOntop
Gui,Color,FFFFFF
Gui,Add,Text,w200,%quote%
Gui,Show,x0 y0 NoActivate,%applicationname%
Gui,+LastFound
guiid:=WinExist()
SetTimer,QUOTEOFF,% delay*-1000
showing=1
If file=
Gosub,DOWNLOAD
Else
Gosub,READ
If quote=
Continue
}
}
ExitApp
READ:
FileReadLine,quote,%file%,%counter%
If ErrorLevel=1
{
counter=1
FileReadLine,quote,%file%,%counter%
}
Else
counter+=1
IniWrite,%counter%,%applicationname%.ini,Settings,counter
Return
DOWNLOAD:
UrlDownloadToFile,% internet,quote.htm
FileRead,quote,quote.htm
StringGetPos,pos,quote,% html1
StringTrimLeft,quote,quote,% pos+StrLen(html1)
StringGetPos,pos,quote,% html2
StringLeft,quote,quote,% pos
StringReplace,quote,quote,% filter,,All
Return
QUOTEOFF:
active:=WinExist("A")
If (active=guiid)
{
SetTimer,QUOTEOFF,-1000
Return
}
showing=0
Gui,Destroy
Return
lanux128:
:) Try HourglassQuotes!
It displays a quote when the PC is busy.-skrommel (May 10, 2009, 08:59 AM)
--- End quote ---
cool, works nicely. :up:
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version