Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/03/2017 in all areas

  1. I think he meant this. It's some pretty good toast lol
    2 points
  2. Authenticity

    Direct3D

    I'd like to list the following sources which I find to be very helpful: MSDN - Direct3D 9 Graphics (Windows)XNAIntroduction to 3D Game Programming With DirectX 9 by Frank D. Luna. The examples are based on his source code.Introduction to 3D Game Programming with DirectX 9.0c—A Shader Approach by Frank D. Luna. The examples are based on his source code.The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics by Randima Fernando and Mark J. KilgardThis library provides a basic interface for programming Direct3D applications, whether they're on your GUI on not. The examples show (and hopefully teach) how to use DirectX to implement: terrain, camera, particle systems, meshes, meshes geometries, and more. Because your application is one step (or 2) from device communication (Graphics card), your application can preform drawing much more faster than GDI or GDI+. What more is that Direct3D offers ways to compile what is called shader/effect files that can be evaluated and executed on the GPU. If you learn how to write code that put the GPU and CPU in work and harmony together, you'll get the most of Direct3D. The library is heavily based on AutoItObj UDF, so you will need to download the UDF to use this library. Thanks to the developers <3 D3D9.7z D3D9_Shader.7z History: Update 11.12.2010: - Added new implementation of D3D samples based on the aforementioned book's source code. The new implementation uses the current version of AutoItObject-v1.2.2.0 and utilizes some sort of OO principles. The major reason to follow the shader approach is because DirectX 10 and later versions have abandoned the fixed-function-pipeline in favor of the new programmable-pipeline. Update 30.10.2010: - Added effects examples - Modified library and examples to reflect library changes. All functions that create intrinsic objects such as a matrix or a vector require a reference to a variable and return the new object's pointer. - Modified library and examples to be compatible with the new AutoItObject version 1.2.0.0. The new AutoItObject version is required to be able to use this library and to run examples. - Fixed Terrain.au3 to use $D3DFMT_INDEX32 when necessary and not always. Update 09.11.2010: - Fixed leaking examples. Future Revisions: Implement real animations like: Skinned Meshes, Keyframes-based animations, etc.
    1 point
  3. @Melba23 - maybe time to rename that UDF. May I suggest "MelbaToast,au3"? I have seen your Toast.udf a million times - but all those potential sound bytes were hiding in plain sight. I apologize if that is only amusing to me ... on cold meds at the moment.
    1 point
  4. What examples didn't work in GDI+? I've used a lot of the example scripts and haven't found one that didn't work. There's also this one DirectX. It's a lot more complex and I never did much with it. OpenGL and DirectX are pretty much the only other alternatives for doing graphics if GDI+ isn't gonna work for you.
    1 point
  5. SQLDave, Welcome to the AutoIt forum. You are correct that HotKeySet is what you need, so something like this should work: ; Set the HotKeys HotKeySet("{F11}", "_MyID") ; You need to assign a function to the HotKey HotKeySet("{ESC}", "_Exit") ; You need some way to get out! ; Now run an infinite loop to keep the script alive While 1 Sleep(10) ; Needed to stop the script from frying the CPU WEnd Func _MyID() Send("my user ID") ; This will be entered at the cursor position EndFunc Func _Exit() Exit EndFunc As to moving over to AutoIt (why did you have to change anyway?), reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at this excellent tutorial - you will find other tutorials in the Wiki (the link is at the top of the page). Have fun - you know where we are if you need help. M23
    1 point
  6. Uhm... Objects use their own counting scheme, unrelated to AutoIt. If creating .Something() object increases reference count for object behind $vFoothen that object is alive until object behind $vMyVar is destroyed. Of course that reference count for object behind $vFoo is decreased when GetThing() returns. If that results in 0 reference count the object will destroy itself. AutoIt losses reference to that object anyhow, because it's declared as local. How is your dilemma related to optional Byref isn't all that clear to me.
    1 point
  7. Inververs

    Encrypting a string

    PHP <-> AutoIt
    1 point
  8. I don't see any violation of anything. And getting out of bed might lead to sneaky issues too, just as staying in. All in all... nothing. This is sensible request already implemented, but not allowed, for unknown reason.
    1 point
  9. Untested, you will need to un-comment all the lines that are commented, didn't want anyone inadvertently running the code, personally I would force reboot but you can give it a try without rebooting: #RequireAdmin #include <WinAPIFiles.au3> Local $sComputerName = "New Name" Local $sWorkGroup = "WORKGROUP-A" Local $sHKLMRoot If @OSArch = "x64" Then $sHKLMRoot = "HKLM64" Else $sHKLMRoot = "HKLM" EndIf Local $idMsgBox = MsgBox(49, "Computer Rename", "Rename Computer to: " & $sComputerName & @CRLF & "Join WorkGroup: " & $sWorkGroup & @CRLF & "Do you wish to continue?") If $idMsgBox = 6 Then ;~ RegDelete($sHKLMRoot & "\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname") ;~ RegDelete($sHKLMRoot & "\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname") ;~ RegWrite($sHKLMRoot & "\SYSTEM\CurrentControlSet\Control\Computername\Computername", "Computername", "REG_SZ", $sComputerName) ;~ RegWrite($sHKLMRoot & "\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername", "Computername", "REG_SZ", $sComputerName) ;~ RegWrite($sHKLMRoot & "\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", $sComputerName) ;~ RegWrite($sHKLMRoot & "\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $sComputerName) ;~ RegWrite($sHKLMRoot & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AltDefaultDomainName", "REG_SZ", $sComputerName) ;~ RegWrite($sHKLMRoot & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", $sComputerName) If @OSArch = "x64" Then DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1) ;~ Turns On 64 Bit Redirection ;~ RunWait('PowerShell.exe -Command "& {Add-Computer -WorkGroupName }"') DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 0) ;~ Turns Off 64 Bit Redirection Else ;~ RunWait('PowerShell.exe -Command "& {Add-Computer -WorkGroupName }"') EndIf EndIf
    1 point
  10. RSAT includes NetDom https://support.microsoft.com/en-us/help/2693643/remote-server-administration-tools-rsat-for-windows-operating-systems Although you can now use PowerShell to add a machine to the domain: Add-Computer –DomainName Domain.local –Credential (Get-Credential) https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.management/add-computer
    1 point
  11. InunoTaishou

    Python - pygame

    Got this idea a long time ago to create a really neat project using a raspberry pi, camera, some custom python code, and a monitor I pulled from an old laptop. The idea is to create an interactive and informational display using the monitor and it will hang on my wall. Custom code will display the time, date, weather forecast, and current events. Has a temperature/humidity for the room (also shown on the display) and a motion censor. Censor will be enabled when I enter the pin for when I leave my room, and turned off when I come back and re-enter the pin. Once the censor is enabled (my security feature is enabled) it will activate the camera, taking a snapshot as soon as it's triggered, email me the screenshot, and then continue to snap pictures every second. Once the person has left my room, zips everything up and then emails me the zip file. Figured it was a good way to play with python, play with the raspberry pi, and make sure anyone coming to my room isn't doing anything sneaky (since I live in the dorms) Started the code today and had to figure out how to draw a string like _GDIPlus_GraphicsDrawStringEx. Because I wanted to define movable areas to render all of my text (so the position of the text is dynamic, and can be moved around and the position changed whenever I want to). Since pygame doesn't have anything like that, and it doesn't support multi-line text, let alone aligned text, I had to come up with how to allow multi line, then moved onto alignment, and make sure everything fit inside the defined area, not drawing any extra text that would "bleed" outside the rect Here's the progress of the text. The greetings text has the left alignment, top line alignment. Time and date have center and center, and fps actually has the whole screen as the rect but uses right alignment + bottom line alignment, making it show in the bottom right corner Source can be found on github for anyone interested This is way incomplete, probably gonna take months to get to the final product, but I predict I'll need to draw text in a defined area a lot.
    1 point
  12. no problem with that, click here
    1 point
  13. Gianni

    Map Index to 2D Array

    $iY can also be calculated like this: Local $iY = Int($iIndex / $iCol)
    1 point
  14. IamKJ

    Image Search issues

    Just upped the tolerance a bit, somewhere between 50-100 is a good start, if there aren't too many images like the one you are searching for.
    1 point
  15. Not to detract for your question...but if the ultimate goal is to copy files there are much better way to do so (using AutoIt) than manipulating the Windows Explorer GUI. We might be able to make better recommendations if you can elaborate on what the end goal is. To get back to your question, many UDFs (User Defined Functions) are included with AutoIt (_GUICtrl*). These functions are designed to work with non-AutoIt GUIs. In theory there is nothing intrinsic about what you want to do that can't be done with AutoIt. Sorry it's not a direct solution, but if you search the forums for Explorer, I'm sure you'll find topics of use if that is really what you need to do to automate your task. BTW: necro-posting is generally frowned upon, particularly if you are expecting an answer from someone who hasn't visited the forums in a long time--not the case here, but just wanted to let you know since you mentioned posting on an old thread.
    1 point
  16. I'll try to illustrate it: PC 1 has a Remote Desktop connection to PC 2 PC 2 is only receiving mouse and keyboard inputs from PC 1 PC 1 is only receiving screen captures from PC 2 Thusly, Window and control handles/IDs on PC 2 are not directly accessible on PC 1. Window and control functions on PC 1 can not see or directly communicate with window/control handles/IDs on PC 2 You need to run AutoIt on the Remote PC (PC 2) if you want to interact with the windows/controls.
    1 point
  17. If you need to compile your script as 32-bit, and still use PowerShell on a 64-bit OS, add the following to the top of your script. #include <WinAPIFiles.au3> _WinAPI_Wow64EnableWow64FsRedirection(False) Adam
    1 point
  18. jannikrendle, Something to get you started... #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <editconstants.au3> Local $mygui = GUICreate('Test Gui', 300, 70) GUICtrlCreateLabel('Second to Run GUI', 10, 13, 100, 20) Local $mytime = GUICtrlCreateInput('', 110, 10, 20, 20, $ES_NUMBER) Local $start = GUICtrlCreateButton('Start Timer', 190, 10, 100, 20) GUICtrlSetLimit(-1, 2) Local $status = GUICtrlCreateLabel('', 10, 40, 280, 20, BitOR($SS_SUNKEN, $SS_CENTER)) GUICtrlSetColor($status, 0xff0000) GUICtrlSetFont($status, 10, 800) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $gui_event_close Exit Case $mytime ; ; if you want to do something with the input value do it here ; Case $start $timer = TimerInit() chk_time() AdlibRegister('chk_time', 1000) GUICtrlSetState($mytime, $GUI_DISABLE) GUICtrlSetState($start, $GUI_DISABLE) EndSwitch WEnd Func chk_time() Local $diff = Int(TimerDiff($timer)) If $diff > GUICtrlRead($mytime) * 1000 Then Exit MsgBox(0, '$$$$$$$$$$', 'Quitting', 2) GUICtrlSetData($status, 'Quitting in ' & GUICtrlRead($mytime) - Int($diff / 1000) & ' Seconds') EndFunc ;==>chk_time Note - one of many ways to do this...also, this is just an example. How you calc the time will depend on factors you have not given. kylomas
    1 point
  19. No. It will run. For example using PSEXEC. There are some limitations.
    1 point
  20. Why not? You can "send" activation command to the window even though it is not active.
    1 point
  21. From Local desktop it is a lot more difficult. It think it might work with th Control functions like ControlSend.
    1 point
  22. Hello everyone, here is my little contribution to AutoIt community. I was looking for a way to print tables from my scripts. None of the solutions was exactly working for me as there were always some limitations. If you need to be able to print table, while making sure that header is printed on each page (if large table), rows won't split up(across several pages) and you want to be able to adjust table size on page or each column size, you in the right place. Also you can choose between landscape and portrait mode It uses a browser to print table out. Simply, it generates a html file which is then open within browser and it initialize print. This version is tested with Chrome browser... Please be aware that there is a bug. When you try to disable row numbers, it will also remove table borders(lines). If anybody can figure out why, it would be appreciated by me and I am sure by others as well. Enjoy Jan UPDATE: found today that geniuses from Google stopped following standards and it no longer prints correctly with Chrome. It also ignores the portrait/landscape settings. However, I tested it with latest IE on Win 7 and it works fine!!! so I suggest you use IE to print... In case you don't have IE as main browser and you do have issues with your current browser then replace shellexecute and winwaitactive at the end of function with: local $hIE=run('"C:\Program Files\Internet Explorer\iexplore.exe" "' & $sFile & '"') ProcessWait($hIE) ; AutoIt Version: 3.3.10 ; Language: English ; Platform: Win ; Author: Jan Zoudlik ; NOTE: big thanks to DoctorDestructo from http://stackoverflow.com/ for main script with css styling etc ; and guinness, tproli, Lupo73 from https://www.autoitscript.com/forum/ for inspiration with their listview to html function ; Script Function: ; table print - example + _table_print function #include <File.au3> Local $aTestArray[4][4] = [[20, 50, 20, 7], ["head", "heading<br/>accross two lines", "heading", "X"],["data row 1",5,"data",6],["data row 2",5&"<br/>"&6,"data",6]] _table_print("test title",100,$aTestArray,True) Func _table_print($Title,$Table_Size,ByRef $2D_array, $Landscape=True, $Row_Numbers=True) ;table that will print as table should (tested with chrome and ie browsers)> header on each page, table cell won't be printed across two pages > so even multi line row will always stay on one page or will be as whole pushed to next page ;to break the line within the cell or heading use "<br/>" not @LF or @CRLF as it is html... if word within cell is wider then column width it will adjust columnm width so word will fit, it will auto(line)break sentance if wider than column ;the allingment withing table is : vertical middle - horizontal left(header is vertical down - horizontal middle) and row numbers are vertical middle - horizontal right... sufficient for me... ;file name automatically generated and saved in temp folder ;Title - self explaining - displayed on the top of the table on first page only ;Table_Size - in percent - how big table(width) should be compare to the paper size so 100 - table will spread accross whole paper printable area, 50 - table size will be approx half of the paper size ;2D_array - row 0, number in percent per each column (width of column) - all together it should add up 100%(97% if row_numbers are used as 3% is used as size for row count column) ;2D_array - row 1, column header - will repeat on each page ;2D_array - row 2-n, data ;$Row_Numbers - first column will contain row number(so there will be one extra column in table) ;$Landscape - to print in landscape or portrait mode... ;paper size is as per printer settings ;font size is set to 10; if adjustment needed for blind people, then search for font-size: 10px; and don't forget to also adjust line-height: 13px accordingly(so it is bigger than font) ;_table_print function CREATED BY Jan Zoudlik ;big thanks to DoctorDestructo from http://stackoverflow.com/ for main script with css styling etc and guinness, tproli, Lupo73 from https://www.autoitscript.com/forum/ for inspiration with their listview to html function $sHTMLTable='<!DOCTYPE html>' & @CRLF & _ '<html>' & @CRLF & _ ' <body>' & @CRLF & _ ' <table ' if $Row_Numbers then $sHTMLTable=$sHTMLTable & 'class="print t1" ' $sHTMLTable=$sHTMLTable & 'width="' & $Table_Size & '%"> <!-- Delete "t1" class to remove row numbers. -->' & @CRLF & _ ' <caption>' & $Title & '</caption>' & @CRLF if $Row_Numbers then $sHTMLTable=$sHTMLTable & ' <col width="3%">' & @CRLF for $column=0 to ubound($2D_array,2)-1 $sHTMLTable=$sHTMLTable & ' <col width="' & $2D_array[0][$column] & '%">' & @CRLF Next $sHTMLTable=$sHTMLTable & ' <thead>' & @CRLF & _ ' <tr>' & @CRLF if $Row_Numbers then $sHTMLTable=$sHTMLTable & ' <th>#</th>' & @CRLF for $column=0 to ubound($2D_array,2)-1 $sHTMLTable=$sHTMLTable & ' <th>' & $2D_array[1][$column] & '</th>' & @CRLF Next $sHTMLTable=$sHTMLTable & ' </tr>' & @CRLF & _ ' </thead>' & @CRLF & _ ' <tbody>' & @CRLF for $row=2 to ubound($2D_array)-1 $sHTMLTable=$sHTMLTable & ' <tr>' & @CRLF if $Row_Numbers then $sHTMLTable=$sHTMLTable & ' <td></td>' & @CRLF for $column=0 to ubound($2D_array,2)-1 $sHTMLTable=$sHTMLTable & ' <td>' & $2D_array[$row][$column] & '</td>' & @CRLF Next $sHTMLTable=$sHTMLTable & ' </tr>' & @CRLF Next $sHTMLTable=$sHTMLTable & ' </tbody>' & @CRLF & _ ' </table>' & @CRLF & _ ' </body>' & @CRLF & _ '</html>' & @CRLF $sCSSstyle='<style>' & @CRLF & _ ' /* THE FOLLOWING CSS IS REQUIRED AND SHOULD NOT BE MODIFIED. */' & @CRLF & _ ' div.fauxRow {' & @CRLF & _ ' display: inline-block;' & @CRLF & _ ' vertical-align: top;' & @CRLF & _ ' width: 100%;' & @CRLF & _ ' page-break-inside: avoid;' & @CRLF & _ ' }' & @CRLF & _ ' table.fauxRow {border-spacing: 0;}' & @CRLF & _ ' table.fauxRow > tbody > tr > td {' & @CRLF & _ ' padding: 0;' & @CRLF & _ ' overflow: hidden;' & @CRLF & _ ' }' & @CRLF & _ ' table.fauxRow > tbody > tr > td > table.print {' & @CRLF & _ ' display: inline-table;' & @CRLF & _ ' vertical-align: top;' & @CRLF & _ ' }' & @CRLF & _ ' table.fauxRow > tbody > tr > td > table.print > caption {caption-side: top;}' & @CRLF & _ ' .noBreak {' & @CRLF & _ ' float: right;' & @CRLF & _ ' width: 100%;' & @CRLF & _ ' visibility: hidden;' & @CRLF & _ ' }' & @CRLF & _ ' .noBreak:before, .noBreak:after {' & @CRLF & _ ' display: block;' & @CRLF & _ ' content: "";' & @CRLF & _ ' }' & @CRLF & _ ' .noBreak:after {margin-top: -594mm;}' & @CRLF & _ ' .noBreak > div {' & @CRLF & _ ' display: inline-block;' & @CRLF & _ ' vertical-align: top;' & @CRLF & _ ' width:100%;' & @CRLF & _ ' page-break-inside: avoid;' & @CRLF & _ ' }' & @CRLF & _ ' /*table.print > thead {white-space: nowrap;}*/ /* Uncomment if line-wrapping causes problems. */' & @CRLF & _ ' table.print > tbody > tr {page-break-inside: avoid;}' & @CRLF & _ ' table.print > tbody > .metricsRow > td {border-top: none !important;}' & @CRLF & _ '' & @CRLF & _ ' /* THE FOLLOWING CSS IS REQUIRED, but the values may be adjusted. */' & @CRLF & _ ' /* NOTE: All size values that can affect an elements height should use the px unit! */' & @CRLF & _ ' table.fauxRow, table.print {' & @CRLF & _ ' font-size: 10px;' & @CRLF & _ ' line-height: 13px;' & @CRLF & _ ' }' & @CRLF & _ '' & @CRLF & _ ' /* THE FOLLvOWING CSS IS OPTIONAL. */' & @CRLF if $Landscape then $sCSSstyle=$sCSSstyle & ' @page {size: landscape;} /* Delete to print in portrait mode*/' & @CRLF if $Row_Numbers then $sCSSstyle=$sCSSstyle & ' body {counter-reset: t1;} /* Delete to remove row numbers. */' & @CRLF & _ ' .noBreak .t1 > tbody > tr > :first-child:before {counter-increment: none;} /* Delete to remove row numbers. */' & @CRLF & _ ' .t1 > tbody > tr > :first-child:before { /* Delete to remove row numbers. */' & @CRLF & _ ' display: block;' & @CRLF & _ ' text-align: right;' & @CRLF & _ ' counter-increment: t1 1;' & @CRLF & _ ' content: counter(t1);' & @CRLF & _ ' }' & @CRLF $sCSSstyle=$sCSSstyle & ' table.fauxRow, table.print {' & @CRLF & _ ' font-family: Tahoma, Verdana, Georgia; /* Try to use fonts that dont get bigger when printed. */' & @CRLF & _ ' margin: 0 auto 0 auto; /* Delete if you dont want table to be centered. */' & @CRLF & _ ' }' & @CRLF & _ ' table.print {border-spacing: 0;}' & @CRLF & _ ' table.print > * > tr > * {' & @CRLF & _ ' border-right: 1px solid black;' & @CRLF & _ ' border-bottom: 1px solid black;' & @CRLF & _ ' padding: 0 3px 0 3px;' & @CRLF & _ ' }' & @CRLF & _ ' table.print > * > :first-child > * {border-top: 1px solid black;}' & @CRLF & _ ' table.print > thead ~ * > :first-child > *, table.print > tbody ~ * > :first-child > * {border-top: none;} ' & @CRLF & _ ' table.print > * > tr > :first-child {border-left: 1px solid black;}' & @CRLF & _ ' table.print > thead {vertical-align: bottom;}' & @CRLF & _ ' table.print > thead > .borderRow > th {border-bottom: none;}' & @CRLF & _ ' table.print > tbody {vertical-align:middle;}' & @CRLF & _ ' table.print > caption {font-weight: bold;}' & @CRLF & _ '</style>' & @CRLF & _ '' & @CRLF & _ '<script>' & @CRLF & _ '' & @CRLF & _ ' (function() { // THIS FUNCTION IS REQUIRED.' & @CRLF & _ ' if(/Firefox|MSIE |Trident/i.test(navigator.userAgent))' & @CRLF & _ ' var formatForPrint = function(table) {' & @CRLF & _ ' var noBreak = document.createElement("div")' & @CRLF & _ ' , noBreakTable = noBreak.appendChild(document.createElement("div")).appendChild(table.cloneNode())' & @CRLF & _ ' , tableParent = table.parentNode' & @CRLF & _ ' , tableParts = table.children' & @CRLF & _ ' , partCount = tableParts.length' & @CRLF & _ ' , partNum = 0' & @CRLF & _ ' , cell = table.querySelector("tbody > tr > td");' & @CRLF & _ ' noBreak.className = "noBreak";' & @CRLF & _ ' for(; partNum < partCount; partNum++) {' & @CRLF & _ ' if(!/tbody/i.test(tableParts[partNum].tagName))' & @CRLF & _ ' noBreakTable.appendChild(tableParts[partNum].cloneNode(true));' & @CRLF & _ ' }' & @CRLF & _ ' if(cell) {' & @CRLF & _ ' noBreakTable.appendChild(cell.parentNode.parentNode.cloneNode()).appendChild(cell.parentNode.cloneNode(true));' & @CRLF & _ ' if(!table.tHead) {' & @CRLF & _ ' var borderRow = document.createElement("tr");' & @CRLF & _ ' borderRow.appendChild(document.createElement("th")).colSpan="1000";' & @CRLF & _ ' borderRow.className = "borderRow";' & @CRLF & _ ' table.insertBefore(document.createElement("thead"), table.tBodies[0]).appendChild(borderRow);' & @CRLF & _ ' }' & @CRLF & _ ' }' & @CRLF & _ ' tableParent.insertBefore(document.createElement("div"), table).style.paddingTop = ".009px";' & @CRLF & _ ' tableParent.insertBefore(noBreak, table);' & @CRLF & _ ' };' & @CRLF & _ ' else' & @CRLF & _ ' var formatForPrint = function(table) {' & @CRLF & _ ' var tableParent = table.parentNode' & @CRLF & _ ' , cell = table.querySelector("tbody > tr > td");' & @CRLF & _ ' if(cell) {' & @CRLF & _ ' var topFauxRow = document.createElement("table")' & @CRLF & _ ' , fauxRowTable = topFauxRow.insertRow(0).insertCell(0).appendChild(table.cloneNode())' & @CRLF & _ ' , colgroup = fauxRowTable.appendChild(document.createElement("colgroup"))' & @CRLF & _ ' , headerHider = document.createElement("div")' & @CRLF & _ ' , metricsRow = document.createElement("tr")' & @CRLF & _ ' , cells = cell.parentNode.cells' & @CRLF & _ ' , cellNum = cells.length' & @CRLF & _ ' , colCount = 0' & @CRLF & _ ' , tbods = table.tBodies' & @CRLF & _ ' , tbodCount = tbods.length' & @CRLF & _ ' , tbodNum = 0' & @CRLF & _ ' , tbod = tbods[0];' & @CRLF & _ ' for(; cellNum--; colCount += cells[cellNum].colSpan);' & @CRLF & _ ' for(cellNum = colCount; cellNum--; metricsRow.appendChild(document.createElement("td")).style.padding = 0);' & @CRLF & _ ' cells = metricsRow.cells;' & @CRLF & _ ' tbod.insertBefore(metricsRow, tbod.firstChild);' & @CRLF & _ ' for(; ++cellNum < colCount; colgroup.appendChild(document.createElement("col")).style.width = cells[cellNum].offsetWidth + "px");' & @CRLF & _ ' var borderWidth = metricsRow.offsetHeight;' & @CRLF & _ ' metricsRow.className = "metricsRow";' & @CRLF & _ ' borderWidth -= metricsRow.offsetHeight;' & @CRLF & _ ' tbod.removeChild(metricsRow);' & @CRLF & _ ' tableParent.insertBefore(topFauxRow, table).className = "fauxRow";' & @CRLF & _ ' if(table.tHead)' & @CRLF & _ ' fauxRowTable.appendChild(table.tHead);' & @CRLF & _ ' var fauxRow = topFauxRow.cloneNode(true)' & @CRLF & _ ' , fauxRowCell = fauxRow.rows[0].cells[0];' & @CRLF & _ ' fauxRowCell.insertBefore(headerHider, fauxRowCell.firstChild).style.marginBottom = -fauxRowTable.offsetHeight - borderWidth + "px";' & @CRLF & _ ' if(table.caption)' & @CRLF & _ ' fauxRowTable.insertBefore(table.caption, fauxRowTable.firstChild);' & @CRLF & _ ' if(tbod.rows[0])' & @CRLF & _ ' fauxRowTable.appendChild(tbod.cloneNode()).appendChild(tbod.rows[0]);' & @CRLF & _ ' for(; tbodNum < tbodCount; tbodNum++) {' & @CRLF & _ ' tbod = tbods[tbodNum];' & @CRLF & _ ' rows = tbod.rows;' & @CRLF & _ ' for(; rows[0]; tableParent.insertBefore(fauxRow.cloneNode(true), table).rows[0].cells[0].children[1].appendChild(tbod.cloneNode()).appendChild(rows[0]));' & @CRLF & _ ' }' & @CRLF & _ ' tableParent.removeChild(table);' & @CRLF & _ ' }' & @CRLF & _ ' else' & @CRLF & _ ' tableParent.insertBefore(document.createElement("div"), table).appendChild(table).parentNode.className="fauxRow";' & @CRLF & _ ' };' & @CRLF & _ ' var tables = document.body.querySelectorAll("table.print")' & @CRLF & _ ' , tableNum = tables.length;' & @CRLF & _ ' for(; tableNum--; formatForPrint(tables[tableNum]));' & @CRLF & _ ' })();' & @CRLF & _ '</script>' $sFile=_TempFile ( @TempDir , "~", ".html" ) ;~ $sFile= @ScriptDir & "\Export.html" $hFile= FileOpen($sFile, 2 + 8) FileWrite($hFile,$sHTMLTable & $sCSSstyle) FileClose($hFile) If @error Then msgbox(0,"Print Error","Failed to close the file!") EndIf ShellExecute($sFile) WinWaitActive(StringTrimLeft($sFile,StringInStr($sFile,"\","",-1))) send("^p") EndFunc ;==>_table_print
    1 point
  23. ProgAndy

    Direct3D

    Thank you, this is very impressive. Now I know the development of AutoItObject-UDF was worth it.
    1 point
  24. Zedna

    Change AutoIT .exe icon

    If you use Scite4Autoit3 (AutoIt3Wrapper) then add this at top of your script #AutoIt3Wrapper_icon=your_icon.ico When you compile script (by F7 from Scite) AutoIt3Wrapper will change icon for you. Icon must be in script directoy at compile time in this case.
    1 point
×
×
  • Create New...