
Rickbert
Members-
Posts
13 -
Joined
-
Last visited
Everything posted by Rickbert
-
#AutoIt on irc.freenode.net - TrayIRC 0.22
Rickbert replied to jvanegmond's topic in AutoIt Example Scripts
Not if they are doing their job correctly. Focus on doin yer lernin @ school, and chat on IRC when you get home. Us older people are counting on you to get a good job, so we can get our social security checks!! Thanks in advance! (Disclaimer: I am a network administrator for a School District ) -
I needed this a while ago, and in my research, I found the a DLL located on this web page: http://pragmaticlee.safedataisp.net (Look for PrinterObject2.zip) There isn't a lot of documentation, and I don't see much about licensing on his website, so you should get permission from the author before using. You have to register the .dll before you are able to use it. I modified the author's sample code to make an Autoit sample. Try running the code below (remembre to register the .dll first!). And I think you'll see the possibilities. I apologize that it's poorly documented, but hopefully it will help you. ;=============================================================================== ; ; Script Name: testPrintDLL.au3 ; ;=============================================================================== ; $oPrn = ObjCreate("RxVB.PrinterObject") $oprn.InitializePrinter() $oprn.Orientation = 1 $oprn.ColorMode = 2 $oprn.Copies = 1 $oprn.FontName = 'Arial' $oprn.FontSize = 12 $oprn.AppTitle = 'PrinterObject_Demo' $red = $oprn.ConvertToRGB(255,0,0) $black = $oprn.ConvertToRGB(0,0,0) $blue = $oprn.ConvertToRGB(1,125,255) $oprn.CurrentY = .5 $oprn.PrintLine($oprn.Ver) $oprn.PrintLine('This Was Printed On' & $oprn.PrName) $text = 'The GetCaps Method Was Used To Gather The Following Data For Portrait' $cap_array = $oprn.GetCaps $oprn.PrintLine($text) $oprn.PrintLine('dpix =' & $cap_array[1]) $oprn.PrintLine('dpiy =' & $cap_array[2]) $oprn.PrintLine('MarginLeft =' & $cap_array[3] / $cap_array[1] & 'Inches') $oprn.PrintLine('MarginRight =' & $cap_array[4] / $cap_array[1] & 'Inches') $oprn.PrintLine('PrintAreaHorz =' & $cap_array[5] / $cap_array[1] & 'Inches') $oprn.PrintLine('PrintAreaVert =' & $cap_array[6] / $cap_array[2] & 'Inches') $oprn.PrintLine('PhysWidth =' & $cap_array[7] / $cap_array[1] & 'Inches') $oprn.PrintLine('PhysHeight =' & $cap_array[8] / $cap_array[2] & 'Inches') $margin_left = $cap_array[3] / $cap_array[1] $print_area_horz = $cap_array[5] / $cap_array[1] $physical_width = $cap_array[7] / $cap_array[1] $margin_right = $physical_width - $print_area_horz - $margin_left $paper_center = $print_area_horz / 2 $th = $oprn.TextHeight('A') $oprn.CurrentY = $oprn.CY + $th $text = 'This is a string of text in Arial 14 pt' $oprn.PrintLine($text) $tw = $oprn.TextWidth($text) $th = $oprn.TextHeight($text) $oprn.PrintLine('Its width is' & $tw & '. Its height is' &$th & '.') $oprn.FontSize = 10 $text = 'This is a string of text in Arial 10 pt' $oprn.PrintLine($text) $tw = $oprn.TextWidth($text) $th = $oprn.TextHeight($text) $oprn.PrintLine('Its width is' & $tw & '. Its height is' & $th & '.') $text = 'This text is in Bold' $oprn.FontBold = True $oprn.PrintLine($text) $oprn.FontBold = False $text = 'This text is in Italic' $oprn.FontItalic = True $oprn.PrintLine($text) $oprn.FontItalic = False $text = 'This text is in StrikeThru' $oprn.FontStrikeThru = True $oprn.PrintLine($text) $oprn.FontStrikeThru = False $text = 'This text is in UnderLine' $oprn.FontUnderLine = True $oprn.PrintLine($text) $oprn.FontUnderline = False $text = 'This text is in Bold, Italic, StrikeThru, & Underline' $oprn.FontBold = True $oprn.FontItalic = True $oprn.FontStrikeThru = True $oprn.FontUnderLine = True $oprn.PrintLine($text) $oprn.FontBold = False $oprn.FontItalic = False $oprn.FontStrikeThru = False $oprn.FontUnderLine = False $text = 'This Line Is Centered' $tw = $oprn.TextWidth($text) $oprn.CurrentX = $paper_center - ($tw / 2) $oprn.PrintLine($text) $curX = $oprn.CX $curY = $oprn.CY $oprn.PrintLineS('CurrentX Before This Line =' & $curX & '. CurrentY =' & $curY & '. ') $curX = $oprn.CX $curY = $oprn.CY $oprn.ForeColor = $red $oprn.PrintLine('CurrentX After The First Text Was =' & $curX & '. CurrentY =' & $curY & '. ') $oprn.ForeColor = $black $oprn.PrintLine('') $oprn.PrintLine('') $oprn.FontUnderline = False $oprn.FontName = 'Arial' $oprn.FontSize = 10 $oprn.PrintLine('The Following Table Was Printed With TABS') dim $names[3], $headers[3] $headers[1] = 'First Name' $headers[2] = 'Last Name' $names[1] = 'Lee,Peedin' $names[2] = 'Leeanderthal,Peedin' $names[0] = 2 $oprn.PrintLineT($headers[1],1) $oprn.PointSet( $oprn.CX, $oprn.CY,$black) $oprn.PrintLineT($headers[2],2) $oprn.PointSet( $oprn.CX, $oprn.CY,$black) $oprn.PrintLine('') $oprn.PointSet( $oprn.CX, $oprn.CY,$black) For $aa = 1 to $names[0] $n = StringSplit($names[$aa],",") $oprn.PrintLineT($n[1],1) $oprn.PointSet( $oprn.CX, $oprn.CY,$black) $oprn.PrintLineT($n[2],2) $oprn.PointSet( $oprn.CX, $oprn.CY,$black) $oprn.PrintLine('') $oprn.PointSet( $oprn.CX, $oprn.CY,$black) Next $oprn.PrintLine(' ') $save_curX = $oprn.CX $save_curY = $oprn.CY $text = 'Use DrawLine To Create Square Corner Boxes' $oprn.PrintLine($text) $curY = $oprn.CY + .1 $curX = $oprn.CX + .1 $oprn.DrawLine($curX,$curY,$curX+2,$curY) ; --Top $oprn.DrawLine($curx,$curY,$curX,$curY+2) ; --Left $oprn.DrawLine($curX,$curY+2,$curX+2,$curY+2) ; --Bottom $oprn.DrawLIne($curX+2,$curY,$curX+2,$curY+2) ; --Right $oprn.CurrentY = $curY + 2.1 $oprn.CurrentX = 0 $text = 'Use DrawLineC To Create Colored-Square Corner Boxes' $oprn.PrintLine($text) $curY = $oprn.CY + .1 $curX = $oprn.CX + .1 $oprn.DrawLineC($curX,$curY,$curX+2,$curY,$blue) ; --Top $oprn.DrawLineC($curX,$curY,$curX,$curY+2,$blue) ; --Left $oprn.DrawLineC($curX,$curY+2,$curX+2,$curY+2,$blue) ; --Bottom $oprn.DrawLIneC($curX+2,$curY,$curX+2,$curY+2,$blue) ; --Right Exit Good Luck !!!
-
Reporting from Add/Remove Programs
Rickbert replied to pshankland's topic in AutoIt General Help and Support
Two things... One: You need to move your $displayname = .... line AFTER the If @error .... line. Two: The REGENUMKEY only returns the key, not the whole hive string, so your $displayname line needs to be like this: $DisplayName = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $SoftwareKey, "DisplayName") Hope this helps -
TrayGetMsg seems to hang script...
Rickbert replied to Rickbert's topic in AutoIt General Help and Support
You're absolutely right... have to be more carful about copy/pasting from the help file Thanks!! -
I wrote a script, which checks a database every x seconds, and pops up a message if new records are added to that database. I then added a tray menu to allow for quick access to some related web pages. I then noticed that the script stopped working correctly. The script below behaves similarly, the splash screen should appear for 2 seconds every 10 seconds that the script is run. However, the script seems to hang on the TrayGetMsg call. Interestingly, if you run the mouse cursor over the tray icon, the splash screen appears, and then goes away, as it should. Any ideas, or help would be appreciated. ; ;=============================================================================== ; #Include <Constants.au3> #NoTrayIcon Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. $settingsitem = TrayCreateMenu("Settings") $displayitem = TrayCreateItem("Display", $settingsitem) $printeritem = TrayCreateItem("Printer", $settingsitem) TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() $timer = TimerInit() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $aboutitem Msgbox(64,"about:","AutoIt3-Tray-sample") Case $msg = $exititem ExitLoop EndSelect $timerdiff = TimerDiff($timer) If $timerdiff > 10000 Then SplashTextOn("Splash","More than 10 seconds have passed") Sleep(2000) $timer = TimerInit() SplashOff() EndIf WEnd Exit
-
This is great! I would like to make a GUI that has several TABs each having an RDP connection to a different server. However, as soon as I put the "GUICtrlCreateObj" within a TabItem, my GUI Locks up, and I can't type in the RDP window, nor can I close the GUI without cancelling the process. Any clues?
-
I need a script to disable closeprocess
Rickbert replied to seletchi gabriel's topic in AutoIt General Help and Support
Now why would I be offended?? That was basic RTFM... it's all in the help file. -
I need a script to disable closeprocess
Rickbert replied to seletchi gabriel's topic in AutoIt General Help and Support
This does essentially what you want on Windows 2000 and Windows XP if WinExists("Windows Task Manager") Then WinActivate("Windows Task Manager") ControlDisable ( "Windows Task Manager", "", 1050) EndIf Though I am not sure why you would want to do this. -
Decrypting Ie History Files
Rickbert replied to spyrorocks's topic in AutoIt General Help and Support
I know this has been idle for a while, but I was looking for the same thing, and got this code working. There's almost no documentation in the code, but the fun is learnin as you go, right? Hope this helps..... ;~ The following was taken from the following web page: http://www.codecomments.com/archive299-2004-6-200442.html ;~ and (clumsily) converted from vbscript to AutoIt3 by me. ;~ ;~ Thanks to the original poster: Christoph Basedau Const $dump_file_name = "history_dump.txt" Const $dump_dir = "C:\" $objDump = ObjCreate("Scripting.FileSystemObject") With $objDump $dump = .createtextfile ($dump_dir & $dump_file_name, True, 0) EndWith $sh = ObjCreate("Shell.Application") Const $ssfHISTORY = 34 $history = $sh.NameSpace($ssfHISTORY) ;first level items a grouped by date ;(today, yesterday, last w) For $item In $history.items $dump.WriteLine($history.GetDetailsOf ($item, -1)) $dump.WriteBlankLines(1) If $item.isFolder Then $itFol = $item.GetFolder For $item2 In $itFol.items $dump.WriteLine(@TAB & $itFol.GetDetailsOf ($item2, -1)) $dump.WriteBlankLines(1) If $item2.isFolder Then $itFol2 = $item2.GetFolder For $item3 In $itFol2.items $url = $itFol2.GetDetailsOf ($item3, 0) $title = $itFol2.GetDetailsOf ($item3, 1) $date_vis = $itFol2.GetDetailsOf ($item3, 2) $dump.WriteLine(@TAB & @TAB & @TAB & $date_vis & " : " & $title) $dump.WriteLine($url) $dump.WriteBlankLines(1) Next EndIf Next $dump.WriteLine("********************************************************************************") $dump.WriteBlankLines(1) EndIf Next $dump.close () ; open textfile $sh.namespace ($dump_dir).parsename ($dump_file_name).InvokeVerb () -
That was exactly what I was looking for Thank you!! Rick
-
I have tried doing some searching on this, with no luck... Is there a tool out there that will allow us to create an AutoIT3 GUI screen with some kind of drag/drop, or "drawing" interface that will then generate the code for it? There used to be something like this for the AUTGUI application in AutoIT 2 It doesn't have to make pretty code, I can tweak it, but I'm horrible at typing code and "visualizing" what I am creating (and the results are typically less than optimal). If anyone can point me in a direction to find something like this, I would be forever greatful!! Rick