AutoHotkey Community

It is currently May 27th, 2012, 2:57 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: custom scrolling msgbox
PostPosted: March 18th, 2010, 7:48 am 
Offline

Joined: September 18th, 2009, 4:47 pm
Posts: 4
Location: Lewisville
I am trying to make a custom scrolling message go accross a window upon a button press. I want the message to be determined by whatever is typed into a text box.

Here is an html version of what I want it to look like:

<div align="center"><FONT
color="#ffffff" size="+10"><MARQUEE bgcolor="#000080"
direction="left" loop="20" width="100%"><STRONG>This is only a test this is only a test this is only a test this is only a test this is only a test></MARQUEE></FONT></DIV>


I would like it to pop up in a window without scrollbars and width 1900 hight 50 (pixels)

I would like the gui to look like this and close and replace any currently open scrolling message that was opened by it in the past:

Gui, Add, Edit, x12 y30 w450 h40 , Edit
Gui, Add, Button, x182 y110 w100 h30 , Enter
; Generated using SmartGUI Creator 4.0
Gui, Show, x127 y87 h379 w479, New GUI Window
Return

ButtonEnter:
GuiClose:
ExitApp


I hope this is enough info, and thanks for your help.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:46 am 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
Searching for marquee, you would have found this topic, where BoBo suggests searching for ticker.
Then, you would have found these topics:
1) http://www.autohotkey.com/forum/viewtop ... ght=ticker
2) http://www.autohotkey.com/forum/viewtop ... ght=ticker

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"
Image
Antonio França
My stuff: Google Profile


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 18th, 2010, 10:14 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Original Poster wrote:
I am trying to make a custom scrolling message go accross a window upon a button press. I want the message to be determined by whatever is typed into a text box.


This is not a total solution.. Just a demo for displaying an IE control:

Code:
#SingleInstance, Force
OnExit, QuitScript

FileDelete, % HTM := A_Temp "\marquee.htm"
FileAppend,
( Join %
<body leftmargin="0" topmargin="0"><div align="center"><FONT color="#ffffff" size="+10">
<MARQUEE bgcolor="#000080" direction="left" loop="20" width="100%"><STRONG>This is only
 a test this is only a test this is only a test this is only a test this is only a test
</MARQUEE></FONT></DIV>
)
, %HTM%

Gui -Caption +LastFound +Border
Gui, Margin, 0, 0

;IE Ctrl adapted from Sean's Code : www.autohotkey.com/forum/viewtopic.php?p=103987#103987
CLSID := "{8856F961-340A-11D0-A96B-00C04FD705A2}"
VarSetCapacity( IWEB,16 )  , NumPut( 0xD30C1661,IWEB ),   NumPut( 0X11D0CDAF,IWEB,4 )
NumPut( 0XC0003E8A,IWEB,8 ), NumPut( 0X6EE2C94F,IWEB,12 )
hModule := DllCall( "LoadLibrary", Str,"atl.dll" ), DllCall( "atl\AtlAxWinInit" )
hCtrl := DllCall( "CreateWindowEx", UInt,0, Str,"AtlAxWin", UInt,&CLSID, UInt,0x50000000
, Int,0, Int,0, Int,A_ScreenWidth+50, Int,55, UInt,WinExist(), UInt,0, UInt,0, UInt,0 )
DllCall( "atl\AtlAxGetControl", UInt,hCtrl, UIntP,ppunk )
DllCall( NumGet( NumGet( ppunk+0 )+4*0 ), UInt,ppunk, UInt,&IWEB, UIntP,ppwb )
DllCall( NumGet( NumGet( ppunk+0 )+4*2 ), UInt,ppunk ), pwb := NumGet( ppwb+0 )
Url := HTM
VarSetCapacity( wUrl,StrLen(Url)*2+2 ), Unicode( Url,wUrl ), VarSetCapacity( var,8*2,0 )
DllCall( NumGet(pwb+4*11),UInt,ppwb,UInt,&wUrl,UInt,&var,UInt,&var,UInt,&var,UInt,&var )

Gui, Show, % "y0 h55 w" A_ScreenWidth
Return         ; - - - - - - - - - - - - - - - - - - - - -  // end of auto-execute section

Unicode(ByRef sS, ByRef wS) {
 DllCall( "MultiByteToWideChar",UInt,0,UInt,0,UInt,&sS,Int,-1,UInt,&wS, Int,StrLen(sS)+1 )
}
Return

QuitScript:
GuiEscape:
 DllCall( NumGet(pwb+4*2),UInt,ppwb )
 ExitApp


Last edited by SKAN on March 19th, 2010, 9:36 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: Reply
PostPosted: March 19th, 2010, 4:04 pm 
Offline

Joined: September 18th, 2009, 4:47 pm
Posts: 4
Location: Lewisville
SKAN,
Thanks so much that is perfect. I am very green in coding, can that be centered at the top? Also I noticed it was referencing a PHP file right? What happens if the server its on goes away? Any Ideas on how to get the text to change in an easy GUI? If you have any ideas I could pay you for your time, as this is for a pet project of mine.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Reply
PostPosted: March 19th, 2010, 9:54 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Quote:
can that be centered at the top?


Trivial:
Code:
Gui, Show, % "y0 h55 w" A_ScreenWidth

I have updated my code. Please try it again.

Quote:
I noticed it was referencing a PHP file right?


I do not think so. I altered your HTML code in Dreamweaver only to apply webpage margins of zero to Left & Top... Only to tight-fit the marquee so it fills the entire IE control.

Also notice that IE control width is larger than the GUI Width by 50 pixels.. This is avoid the scrollbar from being displayed.

Quote:
Any Ideas on how to get the text to change in an easy GUI?


Please allow me some time.. I am occupied right now and will try to post it tommorow.

Quote:
If you have any ideas I could pay you for your time, as this is for a pet project of mine.


The Ask-for-Help forum is powered by volunteers who help only for joy of it. If you ever feel the need for paid assistance, you may post in General Chat.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], rbrtryn and 28 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