PartyPooper Posted January 8, 2006 Share Posted January 8, 2006 (edited) Thought Scripts and Scraps was a better place for this. Original thread. All credit should go to Larry, I just converted his code into a UDF and added some bits along with Gary Frost.Here's a simple example of how it is called and used:#include <GUIConstants.au3> #include <GUIwindow.au3> MainGUI() While 1 Sleep(500) WEnd Func MainGUI() _TransparentTextWindow("MyTextGUI", "Larry Rocks!", 200, 30) If @error Then MsgBox(262160, "ERROR", "Unable to create window - check parameters") Exit EndIf GUISetState(@SW_SHOW) EndFuncFormat for the UDF is as follows:#include <GUIConstants.au3> #include <GUIwindow.au3> _TransparentTextWindow ( "Title", "Text", Width, Height [, Left [, Top [, Font [, Font Weight [, Font Color [, Italics [, Underlined [, Striked Out [, Taskbar]]]]]]]]] )Parameters"Title" - The title of the transparent window created"Text" - The text to display in the window Width - [optional] The width of the windowHeight - [optional] The height of the windowLeft - [optional] The left side of the window. Default (-1) - the window is horizontally centered.Top - [optional] The top of the window. Default (-1) - the window is vertically centeredFont - [optional] The font name. Default (-1) - "Microsoft Sans Serif"Font Weight - [optional] The thickness of the font. Default (-1) - 450Font Color - [optional] Hex RGB color representation. Default (-1) - "0xFF0000"Italics - [optional] Italisized Font 0=normal, 1=italics. Default (0) - not italisizedUnderlined - [optional] Underlined Font 0=normal, 1=underlined. Default (0) - not underlinedStriked Out - [optional] Stiked Out Font 0=normal, 1=striked out. Default (0) - not striked outTaskbar - [optional] Taskbar display 0=Tray icon and Taskbar window, 1=Tray icon only. Default (0) - Tray icon and Taskbar windowReturn ValueSuccess: Displays a transparent window with a visible text overlayFailure: Sets @error to 1. RemarksFonts are system dependant, however, most systems have "Microsoft Sans Serif", "Time New Roman", "Terminal", "Courier New", "Arial", "Verdana".Generally speaking, a bold typeface can be achieved with font weights over 650, however, 1000 works well. GUIwindow.au3 should be placed in your AutoIt3 Includes folder. Requires Beta to run.Edit: Updated UDF (55 downloads) Edited January 12, 2006 by PartyPooper Link to comment Share on other sites More sharing options...
PartyPooper Posted January 12, 2006 Author Share Posted January 12, 2006 Slight mod and added comments for greater understanding. Link to comment Share on other sites More sharing options...
PartyPooper Posted January 12, 2006 Author Share Posted January 12, 2006 DUH!! uploaded wrong file. Fixed. Link to comment Share on other sites More sharing options...
PartyPooper Posted January 12, 2006 Author Share Posted January 12, 2006 (edited) Here's a quick and dirty bit of code I used to test the UDF with. Uses middle mouse button to grab the various screen/window parameters and display them at the bottom of the screen. Press <END> to exit the program. Don't forget to put the UDF in your AutoIt INCLUDE folder/s for it to work. expandcollapse popup#region -- Code Header ;****************************************************************************** ; PROGRAM: WinInfo ; C/RIGHT: @2005 MickK ; AUTHOR: MickK (aka PartyPooper) ; EMAIL: partypooper@optusnet.com.au ; WEBSITE: http://members.optusnet.com.au/partypooper ; INFO: This program uses the middle mouse button to grab the various ; parameters of the active screen and displays them as text in a ; transparent background window on the top line of the active screen. ;****************************************************************************** #endregion #region -- Declarations ;****************************************************************************** ; Standard Decs Global $Title = "WinInfo" Global $Version = "v1.0.0.1" Global $Programmer = "MickK" Global $g_szVersion = $Title & " by " & $Programmer ; Variables Global $MouseCoords [2] Global $PixelColor Global $WinPosn Global $WinTitle Global $Text ; Windows Global $MainGUI ;****************************************************************************** #endregion #region -- Includes ;****************************************************************************** #include <GUIConstants.au3> #include <GUIwindow.au3> #Include <Misc.au3> ;****************************************************************************** #endregion #region -- Processor Instructions ;****************************************************************************** #NoTrayIcon opt("MustDeclareVars", 1) opt("TrayAutoPause", 0) opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) ;****************************************************************************** #endregion #region -- Pre-Run Program Checks ;****************************************************************************** If WinExists($g_szVersion) Then Exit AutoItWinSetTitle($g_szVersion) ;****************************************************************************** #endregion #region -- Script Loop ;****************************************************************************** HotKeySet("{END}", "Quit") Do If _IsPressed (04) Then GetParameters() Sleep(100) Until 0 ;****************************************************************************** #endregion #region -- GetParameters() ;****************************************************************************** Func GetParameters() GUIDelete($MainGUI) $MouseCoords = MouseGetPos() $PixelColor = PixelGetColor($MouseCoords[0], $MouseCoords[1]) $WinPosn = WinGetPos("") $WinTitle = WinGetTitle ("") $Text = "Window: " & $WinPosn[0] & ", " & $WinPosn[1] & ", " & $WinPosn[2] & ", " _ & $WinPosn[3] & " Width: " & @DesktopWidth & " Height: " & @DesktopHeight _ & " Mouse: " & $MouseCoords[0] & ", " & $MouseCoords[1] & " Colour: " _ & $PixelColor & " Title: " & $WinTitle $MainGUI = _TransparentTextWindow ($Title, $Text, (@DesktopWidth - 1), 22, 1, (@DesktopHeight - 50), -1, -1, "0xFFFF00", 0, 0, 0, 1) If @error Then MsgBox(262160, "ERROR", "Unable to create window - check parameters") Exit EndIf GUISetState(@SW_SHOW) EndFunc ;****************************************************************************** #endregion #region -- Quit() ;****************************************************************************** Func Quit() Exit EndFunc ;****************************************************************************** #endregion Edited April 27, 2007 by PartyPooper Link to comment Share on other sites More sharing options...
NegativeNrG Posted January 12, 2006 Share Posted January 12, 2006 hey, goodjob on this, i needed this before . BTW, when you say DUH, you mean DOH right? cause duh means like, of course. [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
PartyPooper Posted January 12, 2006 Author Share Posted January 12, 2006 hey, goodjob on this, i needed this before .BTW, when you say DUH, you mean DOH right? cause duh means like, of course.Thanks. Yeah, too much coding and not enough pizza and coke Link to comment Share on other sites More sharing options...
Gigglestick Posted January 12, 2006 Share Posted January 12, 2006 (edited) From WikiPedia...The slang exclamation duh is used to express one's disapproval of the obviousness of something. For example, if you read a headline saying "Scientific study proves rain may make you wet", the response may well be "Well, duh!".Duh! got its start as a derogatory imitation of the sounds made by severely mentally handicapped people.Eventually, it worked its way into sarcastic usage. If somebody said "Rain is wet!", a response might be, "No, duh! I never would have guessed that!" In this sense, the responder is mocking the sounds of a mentally-handicapped person to imply that he himself would have to be mentally handicapped not to already know that rain is wet.In other words, PartyPooper was saying, "I'm such a dumbass!"Personally, I like the Futurama variation, "FLUH!" Edited January 12, 2006 by c0deWorm My UDFs: ExitCodes Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now