AutoHotkey Community

It is currently May 27th, 2012, 7:23 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: June 9th, 2006, 1:20 pm 
I have written a tool which exports a table from a database into Word. This tool utilises a lot of word macros to process the information parsed from the database, so it can sometimes take upwards of an hour. To speed up the process I have switched off the screen updating, the user therefore has no indication of how long the export will take and sometimes kills the process thinking its locked up when it hasn't.

I want autohotkey to get a handle to the macro container fire an animated gif, keep it on top of all windows then kill the animated GIF when the process has finished/ macro container is closed. Is there anyone out there who knows how to do this.

Thanks a lot for any advice.

Richard


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2006, 1:49 pm 
Have you checked AHK's Progress command already ??

Quote:
Progress / SplashImage
--------------------------------------------------------------------------------
Creates or updates a window containing a progress bar or an image.


Report this post
Top
  
Reply with quote  
PostPosted: June 9th, 2006, 2:04 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Dear Ricardo111, :)

Ricardo111 wrote:
Thanks a lot for any advice.


Animated GIF's are not supported in AHK.
Alternatively, it may help to flash the Tray Icon of your script.

The following is BoBo's technique of Animating Tray Icon.

Code:
#Persistent
SetTimer, ChangeIcon, 500
Return

^#X::ExitApp

ChangeIcon:
If (!Icon) {
Menu,Tray,Icon,%A_AhkPath%,1
Icon=1
}
else {
Menu,Tray,Icon,%A_AhkPath%,4
Icon=0
}
Return


Regards, :)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2006, 2:05 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Here is an another way....

Code:
#Persistent

FlashPause=500
IconSize=32

Gui, Color, EEAA99
Gui +LastFound 
WinSet, TransColor, EEAA99
Gui  +AlwaysOnTop -Caption
Gui, Margin, 0,0
Gui, Add, Picture, w%IconSize% h%IconSize% Icon4 vPic gTrayMenu, User32.dll
Gui, Show, x20 y20, Program Alert
SetTimer, ChangeIcon, %FlashPause%
Return

ChangeIcon:
If (!Icon) {
GuiControl, ,Pic,*ICON4 *w%IconSize% *h%IconSize% User32.dll
Icon=1
}
else {
GuiControl, ,Pic, Null
Icon=0
}
Return

TrayMenu:
Menu,Tray,Show
Return


Regards, :)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2006, 3:33 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Or make an animation non-Gif based...
Code:
;~ SetBatchLines -1
message = RUNNING, WAIT PLEASE!
len := StrLen(message)
xMargin := 50
initialYPos := 20
charW := (A_ScreenWidth - 3 * xMargin) / len

Gui +ToolWindow +AlwaysOnTop +Disable -SysMenu -Caption
Gui Color, 000000
Gui Font, s48, Courier New
Gui Font, , Andale Mono
Loop Parse, message
{
   xPos := xMargin + charW * A_Index
   Gui Add, Text, vp%A_Index% cLime x%xPos% y%initialYPos%, %A_LoopField%
   xPos%A_Index% := xPos
   yPos%A_Index% := initialYPos
}
Gui +LastFound
WinSet, Transparent, 128
Gui Show, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%, Splash
SetTimer Animate, 200
Return

GuiEscape:
ExitApp

Animate:
   yMin := 0
   Loop %len%
   {
      Random r, 5, 20
;~       Random r, 20, 100   ; Much faster, for tests...
      yPos%A_Index% += r
      if (yPos%A_Index% > yMin)
         yMin := yPos
      Gosub MoveControls
   }
   if (yMin > A_ScreenHeight)
   {
      Loop %len%
      {
         yPos%A_Index% := initialYPos
      }
      yMin := 0
      Gosub MoveControls
   }
Return

MoveControls:
   Loop %len%
   {
      xPos := xPos%A_Index%
      yPos := yPos%A_Index%
      GuiControl Move, p%A_Index%, x%xPos% y%yPos%
   }
Return

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2006, 3:39 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Dear PhiLho, :D

This effect is Excellent!

Regards, :D

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2006, 8:58 am 
Guys,
Thanks a lot for the replies and ideas. I'll have a bash at implementing somthing today.

Regards,

Richard


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2006, 9:10 am 
Quote:
Dear PhiLho,
This effect is Excellent!
... and should be added to the Scripts&Functions section if not done already. Thx. :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2006, 1:28 pm 
Phillipe,
My compliments, that was exactly what was needed. Didn't need the animation to be as flash as you had it so I have simplified it for my own needs

Code:
message = Exporting, Please Wait!
len := StrLen(message)
xMargin := 200
initialYPos := 20
charW := (A_ScreenWidth - 3 * xMargin) / len

Gui +ToolWindow +AlwaysOnTop +Disable -SysMenu -Caption
Gui Color, 000000
Gui Font, s48, Courier New
Gui Font, , Andale Mono

xPos := xMargin + charW
Gui Add, Text, vpSod cLime x%xPos% y%initialYPos%, %message%
xPos := xPos
yPos := initialYPos

Gui +LastFound
WinSet, Transparent, 128
Gui Show, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%, Splash
SetTimer Animate, 600
WinWaitClose, DocProducer4
ExitApp
Return

GuiEscape:
ExitApp

Animate:
   yMin := 0
     yPos+= 5
     if (yPos > yMin)
        yMin := yPos

      if (yMin > A_ScreenHeight-100)
      {
       yPos := initialYPos
         yMin := 0
     
      }
   GuiControl Move, pSod, x%xPos% y%yPos%
Return


Best Regards,

Richard


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 13th, 2006, 2:54 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
BoBo wrote:
Quote:
This effect is Excellent!
... and should be added to the Scripts&Functions section if not done already. Thx. :D
Funny, when I read this comment, I was already working on an improved version... It is a kind of splash screen framework...

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 13th, 2006, 5:45 pm 
Offline

Joined: February 13th, 2006, 10:40 pm
Posts: 389
Location: Utah
I liked the effect, but my CPU was completely bogged down (1Ghz 384 Ram Dell Latitute Laptop) and even my mouse was moving slowly.

Rather Humorously i didnt read the code before i executed it, and i tried to right click the tray icon and of course it didnt work. So i had to read the code through the faded screen thing, and find that escape closed it :D :lol:

_________________
Image
"Power can be given overnight, but responsibility must be taught. Long years go into its making."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 14th, 2006, 9:04 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Yes, I try to remember to put this key in most of my scripts, it can be a lifesaver sometime...
I didn't knew it was so CPU intensive, I tested in on my Pentium 4 2.8GHz...
Of course, you can play with the SetTimer value, 200ms is perhaps a bit too much, we are not in a hurry, as long as it moves... :-)

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


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: Bing [Bot], oldbrother, sjc1000, thor, Yahoo [Bot] and 56 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