 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
BoBo Guest
|
Posted: Thu Feb 03, 2005 6:29 pm Post subject: B's 1st. |
|
|
| 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
Inspired by Tekl's MAC-Ejecattack-bitmap-fading-script
Thx, pal.  |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Thu Feb 03, 2005 6:47 pm Post subject: |
|
|
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 !!  _________________
 |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Thu Feb 03, 2005 6:57 pm Post subject: |
|
|
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.
Gosh, I've to send you a monitor > 800x600 ... |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Thu Feb 03, 2005 7:03 pm Post subject: |
|
|
| 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
|
Posted: Thu Feb 03, 2005 7:09 pm Post subject: |
|
|
| 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!  _________________
 |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Thu Feb 03, 2005 10:44 pm Post subject: |
|
|
LOL!!!! Rajat, I love your new sig. Better than all it's predecessors combined!
P.S. 1600x1200 here... I feel for you.  |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Thu Feb 03, 2005 11:32 pm Post subject: |
|
|
| jonny wrote: | LOL!!!! Rajat, I love your new sig. Better than all it's predecessors combined!
P.S. 1600x1200 here... I feel for you.  |
how abt the current sig?
1600x1200! ... i wish! _________________
 |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Fri Feb 04, 2005 12:16 am Post subject: |
|
|
| Lol! An AHK-pun. Nice. |
|
| Back to top |
|
 |
ranomore
Joined: 06 Nov 2004 Posts: 170 Location: Salt Lake City, UT
|
Posted: Fri Feb 04, 2005 4:36 am Post subject: |
|
|
| Everyone's already commented. This is way cool Bobo. Sorry I'm late. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Fri Feb 04, 2005 7:37 am Post subject: |
|
|
| Rajat wrote: | ... change the post title to something useful !!  | 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 |
|
 |
BoBo Guest
|
Posted: Fri Feb 04, 2005 8:50 am Post subject: |
|
|
Cool
Thx Chris for that "patch". That'll make things smarter
@ all
Have phun  |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1687
|
Posted: Fri Feb 04, 2005 8:07 pm Post subject: |
|
|
| 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 |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Fri Feb 04, 2005 8:30 pm Post subject: |
|
|
| Quote: | | 3. BoBo's Tested and Commented Script! |
I vote this one. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|