AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

B's 1st.

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
BoBo
Guest





PostPosted: Thu Feb 03, 2005 6:29 pm    Post subject: B's 1st. Reply with quote

Code:
;
; AutoHotkey Version: 1.0.23.x
; Language:       German\English
; Platform:       Win9x/NT
; Author:         BoBo (visit www.autohotkey.com/forum/index.php to get in touch)
;
; Script Funktion:
; Ziel ist es eine dynamische Textmeldung am
; Bildschirmrand anzuzeigen. Dies wird mittels
; einer AHK GUI erreicht, deren Position sich
; auf dem Bildschirm zur Laufzeit verändert.
; Have phun.
;
; Script function:
; Target - displaying a dynamic text message at the
; border of your screen. That has been accomplished
; using an AHK GUI. Its position is changing at
; runtime. - End of BoBo Fish translation -
; Feedback appreciated. Have phun.
;
; -------------------------------------------


Fade = 0                           ; Mit Einblendung beginnen | Start with Fade IN  [0=IN, 1=OUT]

Loop                              ; Demo Loop | Demo loop
{
Sleep, 2500
If Fade = 2                           ; Richtungswechsel | Swap direction
   Fade -= 2

GUI: ;---------------------------------------

Text = AHK-Update arrived !               ; Text setzen | Set text
TextVPos = 700                        ; Vert. Textpos. am Bildschirmrand | Vert. text pos. @ screen border
FontSize = 14
Font = Arial
Color = EEAA99                        ; GUI Farbe setzen | Set GUI colour
FadingSpeed = 5                        ; Ein-/Ausblendungsgeschwindigkeit | Fading speed

; ------------------------------------------

Screen = %A_ScreenWidth%               ; Bildschirmabhängige Kenngrößen ermitteln | Get screen parameters
Pos = %A_ScreenWidth%
EndPos = %A_ScreenWidth%

Gui, Color, %Color%
Gui, Font, s%FontSize%, %Font%
Gui, Add, text, ,%Text%
DetectHiddenWindows, on
WinSet, TransColor, %Color% 150,, %Text% ; GUI Hintergrund transparent setzen | Set GUI background transparent
WinSet, AlwaysOnTop, On

Gui, -Caption
Gui, Show, X%Pos% Y%TextVPos%
Gui, Cancel

WinGetPos, X, Y, GUIWidth, Height,, %Text%   ; GUI Breite ermitteln | Get GUI width

If Fade = 0                           ; Einblendungswerte ermitteln | Get Fade IN parameters
   {
   EndPos = %Pos%                     ; Startposition = Bilschirmrand | Start position = screen width
   EndPos -= %GUIWidth%               ; Endposition = Bilschirmrand - GUIBreite | Final postion = screen width - GUI width
   }

If Fade = 1                           ; Ausblendungswerte ermitteln | Get Fade OUT parameters
   {
   Pos   -= %GUIWidth%                   ; Startposition = Bilschirmrand - GUIBreite | Start postion = screen width - GUI width      
   }

Loop                              ; Ein-/Ausblendungsberechnung | Fade IN/OUT math
   {
   If Fade = 0
      Pos --
   If Fade = 1
      Pos ++
   Gui, show, X%Pos% Y%TextVPos%         ; Anzeige der GUI an veränderter Position | Display the GUI @ changed postion
   If Pos = %EndPos%
      {
      Fade ++
      Break
      }
   Sleep, %FadingSpeed%
   }
}

Commented Shocked
Inspired by Tekl's MAC-Ejecattack-bitmap-fading-script Exclamation
Thx, pal. Wink
Back to top
Rajat



Joined: 28 Mar 2004
Posts: 1687

PostPosted: Thu Feb 03, 2005 6:47 pm    Post subject: Reply with quote

looks cool !

though i had to go through the script to see where is the problem when it just wouldn't let me make a window active and otherwise do nothing... it was TextVPos = 700 (my res is 800*600) ... changed it to 500 and your script worked cool!

maybe Chris wud change the post title to something useful !! Wink
_________________
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Thu Feb 03, 2005 6:57 pm    Post subject: Reply with quote

The loop is only for demo purposes. Of course it takes the focus away which is quite anoying if to use it on a constant basis. But normaly you would use it just to: Fade in | Message: SmartGUI rulez ! | fade out | Done.

Shocked Gosh, I've to send you a monitor > 800x600 ...
Back to top
BoBo
Guest





PostPosted: Thu Feb 03, 2005 7:03 pm    Post subject: Reply with quote

Code:
TextVPos = 700
If TextVPos >= %A_ScreenHeigth%
    MsgBox, "Let's collect money to buy Rajat a real monitor, to replace his mice movie theater"
Back to top
Rajat



Joined: 28 Mar 2004
Posts: 1687

PostPosted: Thu Feb 03, 2005 7:09 pm    Post subject: Reply with quote

BoBo wrote:
Code:
TextVPos = 700
If TextVPos >= %A_ScreenHeigth%
    MsgBox, "Let's collect money to buy Rajat a real monitor, to replace his mice movie theater"


you never fail to make me smile! Very Happy
_________________
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 2951
Location: Minnesota

PostPosted: Thu Feb 03, 2005 10:44 pm    Post subject: Reply with quote

LOL!!!! Rajat, I love your new sig. Better than all it's predecessors combined! Laughing Laughing

P.S. 1600x1200 here... I feel for you. Confused
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1687

PostPosted: Thu Feb 03, 2005 11:32 pm    Post subject: Reply with quote

jonny wrote:
LOL!!!! Rajat, I love your new sig. Better than all it's predecessors combined! Laughing Laughing

P.S. 1600x1200 here... I feel for you. Confused


how abt the current sig? Very Happy

1600x1200! ... i wish!
_________________
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 2951
Location: Minnesota

PostPosted: Fri Feb 04, 2005 12:16 am    Post subject: Reply with quote

Lol! An AHK-pun. Nice.
Back to top
View user's profile Send private message
ranomore



Joined: 06 Nov 2004
Posts: 170
Location: Salt Lake City, UT

PostPosted: Fri Feb 04, 2005 4:36 am    Post subject: Reply with quote

Everyone's already commented. This is way cool Bobo. Sorry I'm late.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Fri Feb 04, 2005 7:37 am    Post subject: Reply with quote

Rajat wrote:
... change the post title to something useful !! Wink
Suggest titles ... BoBo pick one ... I'll change it.

BoBo wrote:
it takes the focus away which is quite anoying if to use it on a constant basis.
With the latest version, it's easier to prevent that. Here is the revised section:
Code:
Gui, Color, %Color%
Gui, Font, s%FontSize%, %Font%
Gui, Add, text, ,%Text%
Gui, +Disabled +AlwaysOnTop +LastFound  ; Also make it the "last found" window.
WinSet, TransColor, %Color% 150  ; GUI Hintergrund transparent setzen | Set GUI background transparent
Gui, -Caption
Gui, Show, Hide X%Pos% Y%TextVPos%

WinGetPos, X, Y, GUIWidth, Height,, %Text%   ; GUI Breite ermitteln | Get GUI width   ; This line and those below were not changed.
And also the "NoActivate" option is added to this line:
Code:
Gui, show, NoActivate X%Pos% Y%TextVPos%         ; Anzeige der GUI an veränderter Position | Display the GUI @ changed postion
Back to top
View user's profile Send private message Send e-mail
BoBo
Guest





PostPosted: Fri Feb 04, 2005 8:50 am    Post subject: Reply with quote

Cool Very Happy
Thx Chris for that "patch". That'll make things smarter Very Happy

@ all
Have phun Wink
Back to top
Rajat



Joined: 28 Mar 2004
Posts: 1687

PostPosted: Fri Feb 04, 2005 8:07 pm    Post subject: Reply with quote

Chris wrote:
Suggest titles ... BoBo pick one ... I'll change it.

1. Text Notifier
2. OSD Notifier
3. BoBo's Tested and Commented Script!
_________________
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 2951
Location: Minnesota

PostPosted: Fri Feb 04, 2005 8:30 pm    Post subject: Reply with quote

Quote:
3. BoBo's Tested and Commented Script!


Laughing Laughing Laughing Laughing

I vote this one.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group