All Activity

This stream auto-updates   

  1. Today
  2. Check out google DiffMatchPatch if you ever need to sync text
  3. After just using the program again this arvo, it has occurred to me, that a check & delete an empty folder option would be a great addition ... I am always making sure a folder is really empty before deleting it ... so drag & drop simplicity would be cool.
  4. need to call the form from a dll and show it ;Delph 2010 ,Unit Form unit Form; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TMainForm = class(TForm) private { Private declarations } public { Public declarations } end; var MainForm: TMainForm; procedure ShowDllFormInPanel(Parent:THandle);stdcall procedure ShowDllForm;stdcall; implementation procedure ShowDllForm;stdcall; begin if MainForm = nil then MainForm:= TMainForm.Create(Application); MainForm.Show; end; procedure ShowDllFormInPanel(Parent:THandle);stdcall; begin Application.handle:=parent; if MainForm = nil then MainForm:= TMainForm.Create(Application); MainForm.ParentWindow:=Parent; MainForm.Show; end; {$R *.dfm} end. ; Delphi 2010, library UI; { Important note about DLL memory management: ShareMem must be the first unit in your library's USES clause AND your project's (select Project-View Source) USES clause if your DLL exports any procedures or functions that pass strings as parameters or function results. This applies to all strings passed to and from your DLL--even those that are nested in records and classes. ShareMem is the interface unit to the BORLNDMM.DLL shared memory manager, which must be deployed along with your DLL. To avoid using BORLNDMM.DLL, pass string information using PChar or ShortString parameters. } uses SysUtils, Classes, Form in 'Form.pas' {MainForm}; {$R *.res} exports ShowDllFormInPanel, ShowDllForm; begin end. ;autoit v 3.3.14.2 #Region ### START Koda GUI section ### Form= #include <GUIConstantsEx.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include<array.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 623, 449, 192, 114) $Tab1 = GUICtrlCreateTab(8, 0, 585, 441) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") GUICtrlCreateTabItem("") Local $hDLL = DllOpen("UI.DLL") Local $buffer $retVal=DllCall($hDLL,"None","ShowDllFormInPanel","hwnd",$TabSheet1) ; MsgBox(0, "DEBUG", "retVal[0]: " & $retVal[0] & ", retVal[4]: " & $retVal[4] & ", retVal[5]: " & $retVal[5] & ", buffer: " & $buffer) GUISetState(@SW_SHOW) DllClose($retVal) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Debug Source.zip
  5. Just a little program I whipped up a few days ago, that I thought some might appreciate. It uses hash checking to match source with destination, and if equal, deletes the source. It is pretty basic code, but does some nice tricky things ... including working by drag & drop for source and destination. NOTE - Source and Destination paths are never the same. The source file or folder must exist in the Destination folder. Essentially, I use this to clear folders on my transfer thumb drive ... thus making sure I have indeed backed up all. In reality, just a form of double-checking, because I do a lot of transfers between Netbook and Laptop and eventually external HDDs, using a thumb drive as the transfer medium ... between the PCs anyway. I keep multiple copies of everything ... and yes, even online (Google Drive) for smaller size content. Hopefully its basic usage should be self evident. Enjoy! WARNING - The process is an immediate one, when source is dragged & dropped on that input (providing Destination has already been set). There are no prompts. DeleteIf Same v1.1.zip (includes source, but not the icon which I got for myself as an online freebie) P.S. I have belatedly realized (as is often the case) that I should have labelled the first input as, Destination Path To Compare Inside, and other as, Source To Delete If A Match Within Destination. Oh well, just a slight amendment to each, but does make things clearer.
  6. What you describe is exactly what I did moving WIMs in a batch 'capture-alter-deploy' fashion with Imagex, DISM, and xcopy. I'd like to see the batch job that might be tedious with xcopy and/or how the teracopy batch is less so for my edification. Also, with xcopy being baked into the OS now it's hard not to crutch on it, convincing displays would be useful for the future inquirers. (also, hes not wrong that it would be a badass UI for xcopy, but again im not sure i fully understand the limitations)
  7. Gawd, I have not used xcopy in many years. Perhaps you are not aware of the many benefits of TeraCopy. I don't have it enabled as a full replacement for Windows copy and move, but I do have it enabled for right-click dragging, so I use it most of the time ... quickly and simply, with no fuss or mucking around ... and that's just the free version. I created my program here, because I wanted a bit more control ... especially when moving lots of content and many gigabytes ... my concern being over HDDs heating up too much (which they often do), and having less memory usage (no multiple TeraCopy windows open), etc. So the best way to describe my program perhaps, is a batch method with user determined pauses and CRC checking ... no holdups and precise reporting and easy options to deal with issues. So in short, xcopy is not up to that type of job ... not without a lot more mucking around ... and maybe not even then.
  8. TeraCopy Timer updated to v2.3. See first post above. (v2.3) Bugfix for '0 Mb's' being reported in Log file. Window position is now saved when program is closed. Added two options (buttons) to change either the Destination folder or Copy/Move process for all jobs. A dropbox is used to change the Destination folder. A smarter job naming method has been implemented.
  9. Thanks for the response Zedna. Does using Opt('MouseCoordMode',0) change that setting?
  10. Hello, I wrote a simple library to print using the script.dll the code pscript.au3: #include "pscriptCostant.au3" local $DllHandle ;------------------------------------------- ; Inizializza la Dll ;------------------------------------------- Func PscriptInit($Dll) local $ret $DllHandle = DllOpen($Dll) if $DllHandle = -1 Then ConsoleWrite("errore Laod Dll") Exit EndIf $ret = DllCall($DllHandle,"INT","PSInit") if $ret[0] <> $PSE_NOERROR then ConsoleWrite("Errore Init") Exit EndIf DllCall($DllHandle,"NONE","PSSetCoorSystem","INT",$APS_TOPLEFT) DllCall($DllHandle,"NONE","PSSetUnit","INT",$APS_MILL) EndFunc ;----------------------------------------------- ; Avvia Creazione Documento ;----------------------------------------------- Func PsStartDoc() DllCall($DllHandle,"NONE","PSBeginDoc") EndFunc ;------------------------------------------------- ; Termona Stampa Documento ;------------------------------------------------- Func PsEndDoc() DllCall($DllHandle,"NONE","PSEndDoc") EndFunc ;------------------------------------------------- ; Dialog di scelta stampante ;------------------------------------------------- Func PsPrintDialog() local $ret $ret = DllCall($DllHandle,"BOOLEAN","PSPrintDialog") Return $ret[0] EndFunc ;------------------------------------------------ ; Imposta formato Pagina ;------------------------------------------------ Func PsSetPageSize($Dimensione) DllCall($DllHandle,"NONE","PSSetPageSize","SHORT",$Dimensione) EndFunc ;------------------------------------------------ ; Recupera dimensione pagina ;------------------------------------------------ Func PsGetPageSize() local $ret $ret = DllCall($DllHandle,"SHORT","PSGetPageSize") return $ret[0] EndFunc ;---------------------------------------------------- ; Visualizza Anteprima di Stampa ;---------------------------------------------------- Func PsPrintPreview($Flagh) DllCall($DllHandle,"NONE","PSSetPrintPreview","INT",$Flagh) EndFunc ;----------------------------------------------------- ; Stampa una Stringa con parametri ;------------------------------------------------------ Func PsOutText($nTop, $nLeft, $xValue, $nJustify, $cFont, $nSize, $nStyle, $nTFColor, $nTBColor, $nAngle) EndFunc ;----------------------------------------------------- ; Stampa il Testo con i parametri standard ;----------------------------------------------------- Func PsTextOut($nTop, $nLeft, $xValue) DllCall($DllHandle,"NONE","PSTextOut","INT",PSFtoI($nTop),"INT", PSFtoI($nLeft),"STR",$xValue) EndFunc ;------------------------------------------------------ ; Stampa il Testo con i parametri passati ;------------------------------------------------------ Func PsTextOutEx($Top, $Left, $xValue, $Just = $APS_LEFT , $FontName = $APS_SYSTEM, $FontSize = 12, $FontStyle = $APS_PLAIN, $FontFColor = $APS_BLACK, $FontBColor = $APS_NONE, $Angle=0) DllCall($Dllhandle,"NONE","PSTextOutEx","INT",PSFtoI($Top),"INT",PSFtoI($left),"STR",$xValue,"INT",$Just,"STR",$FontName,"INT",PSFtoI($FontSize),"INT",$FontStyle,"INT",$FontFColor,"INT",$FontBColor,"INT",$Angle) EndFunc ;------------------------------------------------------ ; Aggiunge una nuova pagina ;------------------------------------------------------ Func PSNewPage() DllCall($DllHandle,"NONE","PSNewPage") EndFunc ;------------------------------------------------------ ; recupera il Font in uso ;------------------------------------------------------ Func PsGetFontName() local $Font $Font = DllCall($DllHandle,"NONE",'PSGetFontName',"str", "") return $Font[1] EndFunc ;-------------------------------------------------------- ; Inposta il Font ;-------------------------------------------------------- Func PsSetFontName($FontName) DllCall($DllHandle,"NONE","PSSetFontName","STR",$FontName) EndFunc ;-------------------------------------------------------- ; Imposta la dimensione del font ;-------------------------------------------------------- Func PsSetFontSize($Size) DllCall($DllHandle,"NONE","PSSetFontSize","INT", PSFtoI($Size)) EndFunc ;-------------------------------------------------------- ; Recupera la dimensione del Font ;--------------------------------------------------------- Func PsGetFontSize() Local $ret $ret = DllCall($DllHandle,"INT","PSGetFontSize") Return PSItoF($ret[0]) EndFunc ;---------------------------------------------------------- ; Imposta lo stile del Font ;---------------------------------------------------------- Func PsSetFontStyle($Stile) DllCall($DllHandle,"NONE","PSSetFontStyle","INT",$Stile) EndFunc ;---------------------------------------------------------- ; Recupera lo stile del Font ;---------------------------------------------------------- Func PsGetFontStyle() Local $ret $ret = DllCall($DllHandle,"INT","PSGetFontStyle") Return $ret[0] EndFunc ;---------------------------------------------------------- ; Imposta il Colore del Font ;---------------------------------------------------------- Func PsSetFontFColor($FontFColor) DllCall($DllHandle,"NONE","PSSetFontFColor","INT",$FontFColor) EndFunc ;---------------------------------------------------------- ; Recupera il colore del Font ;---------------------------------------------------------- Func PsGetFontFColor() local $ret $ret = DllCall($DllHandle,"INT","PSGetFontFColor") return $ret[0] EndFunc ;----------------------------------------------------------- ; Imposta il colore di fondo ;----------------------------------------------------------- Func PsSetFontBColor($FontBColor) DllCall($DllHandle,"NONE","PSSetFontBColor","INT",$FontBColor) EndFunc ;----------------------------------------------------------- ; Recupera il colore del fondo ;----------------------------------------------------------- Func PSGetFontBColor() local $ret $ret = DllCall($DllHandle,"INT","PSGetFontBColor") return $ret[0] EndFunc ;----------------------------------------------------------------------------- ;Function ...: #PSFtoI(AValue) -> Value ;Description : Converts a Double to an Integer for PSInt compatibility ;-----------------------------------------------------------------------------*/ Func PSFtoI($AValue) Return Int($AValue * 10000) EndFunc ;*----------------------------------------------------------------------------- ;Function ...: #PSItoF(AValue) -> Value ;Description : Converts a PSInt to a Double for PSInt compatibility ;-----------------------------------------------------------------------------*/ Func PSItoF($AValue) Return Round($AValue / 10000, 4) EndFunc pscriptCostant.au3 ;================================================== ; Costanti della Libreria ; Devices ;-----------------------------------------------------------------------------*/ Global Const $DEV_PRINTER = 1 ; Printer Global Const $DEV_PREVIEW = 2 ; Printer with Print preview Global Const $DEV_PDFFILE = 3 ; Print to a PDF File Global Const $DEV_RESERVED = 4 ; Reserved for future use Global Const $DEV_EMFFILE = 5 ; Print to a serie of EMF files ;----------------------------------------------------------------------------- ;*** OBSOLETE *** Special printer numbers ;-----------------------------------------------------------------------------*/ Global Const $PRN_DEFAULT = 0 ; Select Windows default printer Global Const $PRN_PREVIEW = -1 ; Print preview (Obsolete) Global Const $PRN_PDF = -2 ; Print to PDF File (Obsolete) ;----------------------------------------------------------------------------- ;Possible error codes ;-----------------------------------------------------------------------------*/ Global Const $PSE_NOERROR = 0 ; No error Global Const $PSE_NOPRINTER = 1 ; No printer installed Global Const $PSE_DLLNOTLOADED = 2 ; Could not load DLL Global Const $PSE_NOTINITIALIZED = 3 ; Library not initialized Global Const $PSE_TIMEDOUT = 5 ; Beta version timed out ;----------------------------------------------------------------------------- ;Misc. definitions ;-----------------------------------------------------------------------------*/ Global Const $APS_DEFAULT = -999 ; Default value for Integer and Double parameters ;----------------------------------------------------------------------------- ;Basic fonts definitions. Any other valid font is accepted ;-----------------------------------------------------------------------------*/ Global Const $APS_SYSTEM = "Courier New" ; System font Global Const $APS_COURIER = "Courier New" ; Courier new Global Const $APS_ARIAL = "Arial" ; Arial Global Const $APS_TIMES = "Times New Roman" ; Times new roman Global Const $APS_DINGBATS = "WingDings" ; WingDings Global Const $APS_VERDANA = "Verdana" ; Verdana ;----------------------------------------------------------------------------- ; Supported font styles definitions. ;-----------------------------------------------------------------------------*/ Global Const $APS_PLAIN = 0 ; Plain Global Const $APS_BOLD = 1 ; Bold Global Const $APS_ITALIC = 2 ; Italic Global Const $APS_UNDERLINE = 4 ; UnderLine Global Const $APS_STRIKEOUT = 8 ; StrikeOut Global Const $APS_BOLDITALIC = $APS_BOLD + $APS_ITALIC ; BoldItalic (Compatibility) ;----------------------------------------------------------------------------- ; Text justification definitions X,Y ;-------------------------------------------------------------------------|---*/ Global Const $APS_LEFT = 0 ; Text is left justified PageScript Global Const $APS_RIGHT = 1 ; Text is right justified PageScript Global Const $APS_CENTER = 2 ; Text is centered PageScript Global Const $APS_DECIMAL = 3 ; Text is aligned on the decimal 9,999.99 ;----------------------------------------------------------------------------- ; Units of mesurement used to calculate position on the document ;-----------------------------------------------------------------------------*/ Global Const $APS_TEXT = 0 ; Unit is text coordinates (Row, Col) Global Const $APS_MILL = 1 ; Unit is millimeter Global Const $APS_CENT = 2 ; Unit is centimeter Global Const $APS_INCH = 3 ; Unit is inch Global Const $APS_PIXEL = 4 ; Unit is pixel Global Const $APS_PICA = 5 ; Unit is pica (6 picas per inch) Global Const $APS_POINT = 6 ; Unit is point (72 points per inch) Global Const $APS_TWIPS = 7 ; Unit is twips (1440 twips per inch) Global Const $APS_CLIP = 8 ; Unit is text coordinates (Row, Col) but compatible with PageScript for Clipper ;----------------------------------------------------------------------------- ; Page orientation ;-----------------------------------------------------------------------------*/ Global Const $APS_PORTRAIT = 1 ; Print in portrait Global Const $APS_LANDSCAPE = 2 ; Print in landscape ;----------------------------------------------------------------------------- ; BarCode types ;-----------------------------------------------------------------------------*/ Global Const $APS_BC39 = 1 ; Code 3 of 9 Global Const $APS_BC128 = 2 ; Code 128 B Global Const $APS_EAN128A = 3 Global Const $APS_EAN128B = 4 Global Const $APS_EAN128C = 5 Global Const $APS_EAN8 = 6 Global Const $APS_EAN13 = 7 Global Const $APS_CODE128A = 8 Global Const $APS_CODE128B = 9 Global Const $APS_CODE128C = 10 Global Const $APS_UPCA = 11 Global Const $APS_UPCE0 = 12 Global Const $APS_CODABAR = 13 Global Const $APS_POSTNET = 14 Global Const $APS_INTER25 = 15 ;----------------------------------------------------------------------------- ; PDF Encoding ;------------------------------------------------------------------------------*/ Global Const $APS_PDF_WINANSI_ENC = 0 Global Const $APS_PDF_STD_ENC = 1 Global Const $APS_PDF_DOC_ENC = 2 ;----------------------------------------------------------------------------- ; PDF Version ;------------------------------------------------------------------------------*/ Global Const $APS_PDF14 = 0 Global Const $APS_PDF15 = 1 Global Const $APS_PDF16 = 2 Global Const $APS_PDF17 = 3 ;----------------------------------------------------------------------------- ; PDF Embedded fonts ;------------------------------------------------------------------------------*/ Global Const $APS_PDF_FNT_NONE = 0 Global Const $APS_PDF_FNT_FULL = 1 Global Const $APS_PDF_FNT_SUB = 2 ;----------------------------------------------------------------------------- ; Basic colors supported. Corresponds to Clipper's. We're using negative ; values because we don't want to interfere with RGS values that are ; represented by a positive integer. ;-----------------------------------------------------------------------------*/ Global Const $APS_BLACK = -1 ; Black Global Const $APS_BLUE = -2 ; Dark blue Global Const $APS_GREEN = -3 ; Dark green Global Const $APS_CYAN = -4 ; Dark cyan Global Const $APS_RED = -5 ; Dark red Global Const $APS_MAGENTA = -6 ; Dark magenta Global Const $APS_BROWN = -7 ; Brown (more orange than brown) Global Const $APS_PALEGRAY = -8 ; Pale gray Global Const $APS_GRAY = -9 ; Dark gray Global Const $APS_BBLUE = -10 ; Bright blue Global Const $APS_BGREEN = -11 ; Bright green Global Const $APS_BCYAN = -12 ; Bright cyan Global Const $APS_BRED = -13 ; Bright red Global Const $APS_BMAGENTA = -14 ; Bright magenta Global Const $APS_YELLOW = -15 ; Yellow Global Const $APS_WHITE = -16 ; White Global Const $APS_NONE = -255 ; Transparent (No color) ;----------------------------------------------------------------------------- ; Supported patterns used in conjunction with the filling color ;-----------------------------------------------------------------------------*/ Global Const $APS_SOLID = 0 ; Û Solid Global Const $APS_CLEAR = 1 ; Clear (no color / transparent) Global Const $APS_BDIAGONAL = 2 ; \\ Backward diagonal Global Const $APS_FDIAGONAL = 3 ; ; Forward diagonal Global Const $APS_CROSS = 4 ; ++ Cross Global Const $APS_DIAGCROSS = 5 ; XX Diagonal cross Global Const $APS_HORIZONTAL = 6 ; ÍÍ Horizontal Global Const $APS_VERTICAL = 7 ; ³³ Vertical ;----------------------------------------------------------------------------- ; Watermark type ;-----------------------------------------------------------------------------*/ Global Const $AWM_NONE = 0 ; No Watermark Global Const $AWM_FOREGROUND = 1 ; Watermark is printed in foreground Global Const $AWM_BACKGROUND = 2 ; Watermark is printed in background ;----------------------------------------------------------------------------- ; Coordinate system ;-----------------------------------------------------------------------------*/ Global Const $APS_LEFTTOP = 0 ; Left/Top coordinate system Global Const $APS_TOPLEFT = 1 ; Top/Left coordinate system ;----------------------------------------------------------------------------- ; Printer Caps. All caps are in pixels ;-----------------------------------------------------------------------------*/ Global Const $APC_PAPERWIDTH = 1 ; Paper width Global Const $APC_PAPERHEIGHT = 2 ; Paper height Global Const $APC_AREAWIDTH = 3 ; Printable area width Global Const $APC_AREAHEIGHT = 4 ; Printable area height Global Const $APC_TOPMARGIN = 5 ; Top margin Global Const $APC_LEFTMARGIN = 6 ; Left margin Global Const $APC_HPIXELS = 7 ; Number of horizontal pixels per inch Global Const $APC_VPIXELS = 8 ; Number of vertical pixels per inch Global Const $APC_BITSPIXEL = 9 ; Number of bits per pixel (1 = B&W printer) ;----------------------------------------------------------------------------- ; Print Preview Window State ;-----------------------------------------------------------------------------*/ Global Const $PWS_MINIMIZED = 0 ; Minimized Global Const $PWS_MAXIMIZED = 1 ; Maximized - Default Global Const $PWS_NORMAL = 2 ; Normal Global Const $PWS_NORMALCENTERED = 3 ; Normal centered (Only Width and Height required) Global Const $PWS_AUTO = 4 ; Saves and reuses the size and pos automaticaly ;----------------------------------------------------------------------------- ; PDF font character sets (As defined by Microsoft) ;-----------------------------------------------------------------------------*/ Global Const $ANSI_CHARSET = 0 ; Latin - Western European languages: English, French, German, Spanish, Italian, Portuguese... Global Const $ARABIC_CHARSET = 178 ; Arabic -Arabic, Syriac Global Const $BALTIC_CHARSET = 186 ; Baltic - Estonian, Latvian, Lithuanian Global Const $EASTEUROPE_CHARSET = 238 ; European - Eastern European languages: Czech, Croatian, Hungarian, Polish, Romanian, Slovak, Slovenian... Global Const $GREEK_CHARSET = 161 ; Greek Global Const $HEBREW_CHARSET = 177 ; Hebrew Global Const $RUSSIAN_CHARSET = 204 ; Cyrillic - Belarussian, Bulgarian, Russian, Serbian, Ukrainian... Global Const $TURKISH_CHARSET = 162 ; Turkish ;----------------------------------------------------------------------------- ; Predefined Paper selection (based on Windows API constants) ;-----------------------------------------------------------------------------*/ Global Const $DMPAPER_LETTER = 1 ; Letter 8 12 x 11 in Global Const $DMPAPER_FIRST = $DMPAPER_LETTER Global Const $DMPAPER_LETTERSMALL = 2 ; Letter Small 8 12 x 11 in Global Const $DMPAPER_TABLOID = 3 ; Tabloid 11 x 17 in Global Const $DMPAPER_LEDGER = 4 ; Ledger 17 x 11 in Global Const $DMPAPER_LEGAL = 5 ; Legal 8 12 x 14 in Global Const $DMPAPER_STATEMENT = 6 ; Statement 5 12 x 8 12 in Global Const $DMPAPER_EXECUTIVE = 7 ; Executive 7 14 x 10 12 in Global Const $DMPAPER_A3 = 8 ; A3 297 x 420 mm Global Const $DMPAPER_A4 = 9 ; A4 210 x 297 mm Global Const $DMPAPER_A4SMALL = 10 ; A4 Small 210 x 297 mm Global Const $DMPAPER_A5 = 11 ; A5 148 x 210 mm Global Const $DMPAPER_B4 = 12 ; B4 (JIS) 250 x 354 Global Const $DMPAPER_B5 = 13 ; B5 (JIS) 182 x 257 mm Global Const $DMPAPER_FOLIO = 14 ; Folio 8 12 x 13 in Global Const $DMPAPER_QUARTO = 15 ; Quarto 215 x 275 mm Global Const $DMPAPER_10X14 = 16 ; 10x14 in Global Const $DMPAPER_11X17 = 17 ; 11x17 in Global Const $DMPAPER_NOTE = 18 ; Note 8 12 x 11 in Global Const $DMPAPER_ENV_9 = 19 ; Envelope #9 3 78 x 8 78 Global Const $DMPAPER_ENV_10 = 20 ; Envelope #10 4 18 x 9 12 Global Const $DMPAPER_ENV_11 = 21 ; Envelope #11 4 12 x 10 38 Global Const $DMPAPER_ENV_12 = 22 ; Envelope #12 4 \276 x 11 Global Const $DMPAPER_ENV_14 = 23 ; Envelope #14 5 x 11 12 Global Const $DMPAPER_CSHEET = 24 ; C size sheet Global Const $DMPAPER_DSHEET = 25 ; D size sheet Global Const $DMPAPER_ESHEET = 26 ; E size sheet Global Const $DMPAPER_ENV_DL = 27 ; Envelope DL 110 x 220mm Global Const $DMPAPER_ENV_C5 = 28 ; Envelope C5 162 x 229 mm Global Const $DMPAPER_ENV_C3 = 29 ; Envelope C3 324 x 458 mm Global Const $DMPAPER_ENV_C4 = 30 ; Envelope C4 229 x 324 mm Global Const $DMPAPER_ENV_C6 = 31 ; Envelope C6 114 x 162 mm Global Const $DMPAPER_ENV_C65 = 32 ; Envelope C65 114 x 229 mm Global Const $DMPAPER_ENV_B4 = 33 ; Envelope B4 250 x 353 mm Global Const $DMPAPER_ENV_B5 = 34 ; Envelope B5 176 x 250 mm Global Const $DMPAPER_ENV_B6 = 35 ; Envelope B6 176 x 125 mm Global Const $DMPAPER_ENV_ITALY = 36 ; Envelope 110 x 230 mm Global Const $DMPAPER_ENV_MONARCH = 37 ; Envelope Monarch 3.875 x 7.5 in Global Const $DMPAPER_ENV_PERSONAL = 38 ; 6 34 Envelope 3 58 x 6 12 in Global Const $DMPAPER_FANFOLD_US = 39 ; US Std Fanfold 14 78 x 11 in Global Const $DMPAPER_FANFOLD_STD_GERMAN = 40 ; German Std Fanfold 8 12 x 12 in Global Const $DMPAPER_FANFOLD_LGL_GERMAN = 41 ; German Legal Fanfold 8 12 x 13 in Global Const $DMPAPER_ISO_B4 = 42 ; B4 (ISO) 250 x 353 mm Global Const $DMPAPER_JAPANESE_POSTCARD = 43 ; Japanese Postcard 100 x 148 mm Global Const $DMPAPER_9X11 = 44 ; 9 x 11 in Global Const $DMPAPER_10X11 = 45 ; 10 x 11 in Global Const $DMPAPER_15X11 = 46 ; 15 x 11 in Global Const $DMPAPER_ENV_INVITE = 47 ; Envelope Invite 220 x 220 mm Global Const $DMPAPER_RESERVED_48 = 48 ; RESERVED--DO NOT USE Global Const $DMPAPER_RESERVED_49 = 49 ; RESERVED--DO NOT USE Global Const $DMPAPER_LETTER_EXTRA = 50 ; Letter Extra 9 \275 x 12 in Global Const $DMPAPER_LEGAL_EXTRA = 51 ; Legal Extra 9 \275 x 15 in Global Const $DMPAPER_TABLOID_EXTRA = 52 ; Tabloid Extra 11.69 x 18 in Global Const $DMPAPER_A4_EXTRA = 53 ; A4 Extra 9.27 x 12.69 in Global Const $DMPAPER_LETTER_TRANSVERSE = 54 ; Letter Transverse 8 \275 x 11 in Global Const $DMPAPER_A4_TRANSVERSE = 55 ; A4 Transverse 210 x 297 mm Global Const $DMPAPER_LETTER_EXTRA_TRANSVERSE = 56 ; Letter Extra Transverse 9\275 x 12 in Global Const $DMPAPER_A_PLUS = 57 ; SuperASuperAA4 227 x 356 mm Global Const $DMPAPER_B_PLUS = 58 ; SuperBSuperBA3 305 x 487 mm Global Const $DMPAPER_LETTER_PLUS = 59 ; Letter Plus 8.5 x 12.69 in Global Const $DMPAPER_A4_PLUS = 60 ; A4 Plus 210 x 330 mm Global Const $DMPAPER_A5_TRANSVERSE = 61 ; A5 Transverse 148 x 210 mm Global Const $DMPAPER_B5_TRANSVERSE = 62 ; B5 (JIS) Transverse 182 x 257 mm Global Const $DMPAPER_A3_EXTRA = 63 ; A3 Extra 322 x 445 mm Global Const $DMPAPER_A5_EXTRA = 64 ; A5 Extra 174 x 235 mm Global Const $DMPAPER_B5_EXTRA = 65 ; B5 (ISO) Extra 201 x 276 mm Global Const $DMPAPER_A2 = 66 ; A2 420 x 594 mm Global Const $DMPAPER_A3_TRANSVERSE = 67 ; A3 Transverse 297 x 420 mm Global Const $DMPAPER_A3_EXTRA_TRANSVERSE = 68 ; A3 Extra Transverse 322 x 445 mm Global Const $DMPAPER_LAST = $DMPAPER_A3_EXTRA_TRANSVERSE Global Const $DMPAPER_USER = 256 ; User defined paper size ;----------------------------------------------------------------------------- ; Paper bin selection (based on Windows API constants) ;-----------------------------------------------------------------------------*/ Global Const $DMBIN_UPPER = 1 ; Upper bin Global Const $DMBIN_FIRST = $DMBIN_UPPER Global Const $DMBIN_ONLYONE = 1 ; Same as Upper bin Global Const $DMBIN_LOWER = 2 ; Lower bin Global Const $DMBIN_MIDDLE = 3 ; Middle bin Global Const $DMBIN_MANUAL = 4 ; Manual feed Global Const $DMBIN_ENVELOPE = 5 ; Envelope Global Const $DMBIN_ENVMANUAL = 6 ; Envelope manual feed Global Const $DMBIN_AUTO = 7 ; Auto select (depending on paper size) Global Const $DMBIN_TRACTOR = 8 ; Tractor feed Global Const $DMBIN_SMALLFMT = 9 ; Small forms Global Const $DMBIN_LARGEFMT = 10 ; Large forms Global Const $DMBIN_LARGECAPACITY = 11 ; Large capacity bin Global Const $DMBIN_CASSETTE = 14 ; Cassette Global Const $DMBIN_FORMSOURCE = 15 ; Form source Global Const $DMBIN_LAST = $DMBIN_FORMSOURCE Global Const $DMBIN_USER = 256 ; Device specific bins start here ; XEROX N4525 specific Trays numbers ; Contributed by Jeremy Suiter, England, UK. Thanks. Global Const $XEROX_4525_1_W98 = 1 ; Xerox N4525 Tray 1 Global Const $XEROX_4525_2_W98 = 2 ; Xerox N4525 Tray 2 ; Tray's 3,4,5 belong to optional 2,500 feeder unit Global Const $XEROX_4525_3_W98 = 258 ; Xerox N4525 Tray 3 Global Const $XEROX_4525_4_W98 = 259 ; Xerox N4525 Tray 4 Global Const $XEROX_4525_5_W98 = 260 ; Xerox N4525 Tray 5 ; Windows 2000 Pro/NT/XP Global Const $XEROX_4525_1_W2K = 262 ; Xerox N4525 Tray 1 Global Const $XEROX_4525_2_W2K = 261 ; Xerox N4525 Tray 2 ; Tray's 3,4,5 belong to optional 2,500 feeder unit Global Const $XEROX_4525_3_W2K = 260 ; Xerox N4525 Tray 3 Global Const $XEROX_4525_4_W2K = 259 ; Xerox N4525 Tray 4 Global Const $XEROX_4525_5_W2K = 258 ; Xerox N4525 Tray 5 ;----------------------------------------------------------------------------- ; Duplex mode support for printers with Duplex printing options ;-----------------------------------------------------------------------------*/ Global Const $DMDUP_SIMPLEX = 1 ; Simplex mode Global Const $DMDUP_VERTICAL = 2 ; Vertical Duplex Global Const $DMDUP_HORIZONTAL = 3 ; Horizontal Duplex Example : #include "pscript.au3" local $x =0 PscriptInit(@ScriptDir & "\PSCRIPT.dll") PsPrintPreview(1) if PsPrintDialog() Then PsSetPageSize($DMPAPER_A3) PsStartDoc() PsSetFontName($APS_VERDANA) PsSetFontStyle($APS_BOLD) PsSetFontFColor($APS_BRED) PsSetFontBColor($APS_YELLOW) PsSetFontSize(10) for $i=0 to 10 PsTextOut(($i*5)+50, 0, 'Prova Testo Stampa') PSNewPage() Next PsTextOutEx(0,100,"Prova Due",$APS_CENTER) PsEndDoc() EndIf the library is not finished yet, many functions are missing. I can not get printPreview to work. You can help me? Thank you.
  11. Yesterday
  12. Windows Image Acquition Object https://msdn.microsoft.com/en-us/library/windows/desktop/ms630826(v=vs.85).aspx#SharedSample011 The "WIA.Vector" COM Example posted earlier, Object example let me to other WIA COM Objects local $v $v = ObjCreate("WIA.vector") $v.Add(1) $v.Add(42) $v.Add(3) $v.Remove(1) $v.Remove(2) ConsoleWrite("$v(1) = " & $v(1) & @CRLF) $v.Clear $v.Add("This") $v.Add("Is") $v.Add("Cool") $v.Remove(1) $v.Remove(1) ConsoleWrite("$v(1) = " & $v(1) & @CRLF) Here are some quick and dirty examples I converted found on the net. Image Convert Format ; $lFormat = 2 ; 0 = BMP, 1 = GIF, 2 = JPEG, 3 = PNG, 4 = TIFF $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir WIA_ConvertImage($sInFile,$sOutFile, 4) Func WIA_ConvertImage($sInitialImage, _ $sOutputImage, _ $lFormat, _ $lQuality = 85) Select Case $lFormat = 0 $sFormatID = "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}" $sExt = "BMP" Case $lFormat = 1 $sFormatID = "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}" $sExt = "GIF" Case $lFormat = 2 $sFormatID = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}" $sExt = "JPEG" Case $lFormat = 3 $sFormatID = "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}" $sExt = "PNG" Case $lFormat = 4 $sFormatID = "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}" $sExt = "TIFF" EndSelect If $lQuality > 100 Then $lQuality = 100 $oWIA = ObjCreate("WIA.ImageFile") $oIP = ObjCreate("WIA.ImageProcess") $oIP.Filters.Add ($oIP.FilterInfos("Convert").FilterID) $oIP.Filters(1).Properties("FormatID") = $sFormatID $oIP.Filters(1).Properties("Quality") = $lQuality $oWIA.LoadFile($sInitialImage) ; --- $oWIA = $oIP.Apply($oWIA) If FileExists($sOutputImage & "\OutFile." & $sExt) Then FileDelete($sOutputImage & "\OutFile." & $sExt) EndIf $oWIA.SaveFile ($sOutputImage & "\OutFile." & $sExt) ConsoleWrite("File Saved : " & $sOutputImage & "\OutFile." & $sExt & @CRLF) EndFunc Image Resize $sInFile = "C:\Temp\Test.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_ResizeImage($sInFile,$sOutFile,100,200) Func WIA_ResizeImage($sInitialImage, _ $sResizedImage, _ $lMaximumWidth, _ $lMaximumHeight) $oWIA = ObjCreate("WIA.ImageFile") $oIP = ObjCreate("WIA.ImageProcess") $oIP.Filters.Add ($oIP.FilterInfos("Scale").FilterID) $oIP.Filters(1).Properties("MaximumWidth") = $lMaximumWidth $oIP.Filters(1).Properties("MaximumHeight") = $lMaximumHeight $oWIA.LoadFile($sInitialImage) $oWIA = $oIP.Apply($oWIA) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $oWIA.SaveFile($sResizedImage) EndFunc Image File Properties local $Img = ObjCreate("WIA.ImageFile") ; $Img.LoadFile ( "C:\Temp\Plastiflex Logo New.jpg") $Img.LoadFile (@ScriptDir & "\Vector.bmp") local $s = "Width = " & $Img.Width & @CrLf _ & "Height = " & $Img.Height & @CrLf _ & "Depth = " & $Img.PixelDepth & @CrLf _ & "HorizontalResolution = " & $Img.HorizontalResolution & @CrLf _ & "VerticalResolution = " & $Img.VerticalResolution & @CrLf _ & "FrameCount = " & $Img.FrameCount & @CrLf ;ConsoleWrite($s & @CRLF) If $Img.IsIndexedPixelFormat then $s = $s & "Pixel data contains palette indexes" & @CrLf EndIf If $Img.IsAlphaPixelFormat then $s = $s & "Pixel data has alpha information" & @CrLf EndIf If $Img.IsExtendedPixelFormat then $s = $s & "Pixel data has extended color information (16 bit/channel)" & @CrLf EndIf If $Img.IsAnimated then $s = $s & "Image is animated" & @CrLf EndIf If $Img.Properties.Exists("40091") then $v = $Img.Properties("40091").Value $s = $s & "Title = " & $v & @CrLf EndIf If $Img.Properties.Exists("40092") then $v = $Img.Properties("40092").Value $s = $s & "Comment = " & $v & @CrLf EndIf If $Img.Properties.Exists("40093") then $v = $Img.Properties("40093").Value $s = $s & "Author = " & $v & @CrLf EndIf If $Img.Properties.Exists("40094") then $v = $Img.Properties("40094").Value $s = $s & "Keywords = " & $v & @CrLf EndIf If $Img.Properties.Exists("40095") then $v = $Img.Properties("40095").Value $s = $s & "Subject = " & $v & @CrLf EndIf ConsoleWrite($s & @CRLF) Local $IP = ObjCreate("WIA.ImageProcess") For $fi In $IP.FilterInfos $s = $fi.Name & @CRLF & _ "==================================================" & @CRLF & _ $fi.Description ConsoleWrite( $s & @CRLF) Next Enjoy ptrex
  13. @smartkey AutoIt comes with a StringReplace function, to which yours seems very similar. What would this provide that the original does not, except two fewer parameters?
  14. RunWait stops the script until whatever you ran with it closes, that's probably half the problem you were having.
  15. Ok this seems wrong/sloppy but i got it working (i cleaned up the sleeps too). i compiled the install script with the installer. then compiled that script with the rest of of it and added a RunWait :-/ is there a way around this maybe incorporating ProcessWaitClose? Step 1 (compiled as 'CCleaner1.exe') #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** FileInstall("C:\Users\ccsetup.exe", "C:\ccsetup.exe", 1) AutoItSetOption('MouseCoordMode', 0) Run('C:\ccsetup.exe') Install() Func Install() Local $CCHandle = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup") While $CCHandle = 0x00000000 Sleep(1500) $CCHandle = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup") WEnd WinWait($CCHandle) WinActivate($CCHandle) WinWaitActive($CCHandle, '', 18) ControlClick($CCHandle, "", 1005) ControlCommand($CCHandle, "", 'Button4', 'UnCheck') ControlCommand($CCHandle, "", 'Button5', 'Check') ControlCommand($CCHandle, "", 'Button6', 'UnCheck') ControlCommand($CCHandle, "", 'Button7', 'UnCheck') ControlCommand($CCHandle, "", 'Button8', 'UnCheck') ControlClick($CCHandle, "", 'Button3') EndFunc ;==>Install Step 2 #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** FileInstall("C:\Users\CCleaner1.exe", "C:\CCleaner1.exe", 1) SplashTextOn("CCleaner", "Installing Please do not touch the keyboard or mouse until installation is complete.", 300, 100) AutoItSetOption('MouseCoordMode', 0) RunWait('C:\CCleaner1.exe') While 1 Local $CCHandle1 = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup Completed") While $CCHandle1 = 0x00000000 Sleep(1500) $CCHandle1 = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup Completed") WEnd WinWait($CCHandle1) WinActivate($CCHandle1) WinWaitActive($CCHandle1, '', 18) ControlCommand($CCHandle1, "", 'Button3', 'UnCheck') ControlClick($CCHandle1, "", 'Button1') Local $CCHandle2 = WinGetHandle("Piriform CCleaner") While $CCHandle2 = 0x00000000 Sleep(1500) $CCHandle2 = WinGetHandle("Piriform CCleaner") WEnd WinWait($CCHandle2) WinActivate($CCHandle2) WinWaitActive($CCHandle2, '', 18) ControlClick($CCHandle2, "&Options", 1003) WinWaitActive($CCHandle2) ControlClick($CCHandle2, "Monitoring", 1021) Send("{ESC}") WinWaitActive($CCHandle2, "Enable &system monitoring") ControlCommand($CCHandle2, "Enable &system monitoring", "Button12", 'UnCheck') WinWaitActive($CCHandle2, "&Enable Active Monitoring") ControlCommand($CCHandle2, "&Enable Active Monitoring", "Button15", 'UnCheck') Local $CCHandle3 = WinGetHandle("Disable Active Monitoring") While $CCHandle3 = 0x00000000 Sleep(1500) $CCHandle3 = WinGetHandle("Disable Active Monitoring") WEnd WinWait($CCHandle3) WinActivate($CCHandle3) WinWaitActive($CCHandle3, '', 18) Sleep(50) Send("{TAB 2}") Send("{ENTER}") ControlClick($CCHandle2, "&Cleaner", 1000) FileDelete('C:\CCleaner1.exe') FileDelete('C:\ccsetup.exe') If Not FileExists('C:\ccsetup.exe') Then Exit EndIf WEnd
  16. I use the following code to paste in a hard-coded file link to a file upload dialog box in IE WinWait("Choose File to Upload") $hChoose = WinGetHandle("Choose File to Upload") Sleep(1000) ControlSetText($hChoose, "", "Edit1", "C:\Path\To\File.doc") Sleep(1000) Send("{ENTER}") Sleep(1000) It may work fine without the Sleep's but on the particular box I have this running on I was getting inconsistent results without them.
  17. http://lmgtfy.com/?q=rtfm
  18. thats all i needed. thanks I don't know your nerd lingo.
  19. Look at function InputBox()
  20. RTFM. Look up InputBox in the help file.
  21. Please don't say read the help files and be nice. I am super new to doing this kind of stuff... I have tried and cannot find something that prompts a box that says: How many times do you want to loop? (then you type in a number like 12) and it loops 12 times. Here is my script below. I want to start this script, input the number of times I want to loop, and then start. Then it stops after it goes through that number of times. MouseClick("left",942,409,1) sleep(500) MouseClick("left",942,409,1) sleep(500) Send("{CTRLDOWN}{HOME}{CTRLUP}") sleep(500) Send("{CTRLDOWN}c{CTRLUP}") MouseClick("left",567,-833,1) sleep(500) Send("{CTRLDOWN}v{CTRLUP}") sleep(100) Send("{ENTER}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("hardware{ENTER}") sleep(400) Send("{TAB}laptop{ENTER}") sleep(400) MouseClick("left",942,409,1) sleep(500) MouseClick("left",942,409,1) sleep(500) Send("{CTRLDOWN}{HOME}{CTRLUP}") sleep(100) Send("{RIGHT}") sleep(100) Send("{CTRLDOWN}c{CTRLUP}") sleep(400) MouseClick("left",642,-457,1) sleep(400) Send("{CTRLDOWN}v{CTRLUP}") sleep(400) MouseClick("left",942,409,1) sleep(500) MouseClick("left",942,409,1) sleep(500) Send("{CTRLDOWN}{HOME}{CTRLUP}") sleep(100) Send("{RIGHT}") sleep(100) Send("{RIGHT}") sleep(100) Send("{CTRLDOWN}c{CTRLUP}") sleep(400) MouseClick("left",642,-457,1) sleep(400) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{ENTER}") sleep(400) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{TAB}") sleep(100) Send("{CTRLDOWN}v{CTRLUP}") sleep(400) Send("{TAB}") sleep(100) Send("{ENTER}") sleep(400) MouseClick("left",942,409,1) sleep(500) MouseClick("left",942,409,1) Send("{CTRLDOWN}{HOME}{CTRLUP}") sleep(100) Send("{SHIFTDOWN}{RIGHT}{RIGHT}{SHIFTUP}{CTRLDOWN}-{CTRLUP}") sleep(100) Send("{ENTER}") sleep(100) MouseClick("left",411,-937,1)
  22. @BusterProg, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link in my signature) Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. Jos
  23. Yeah I imagine thats faster I suppose it depends how many files he has to drop/ how often and If he wants to subclass his control..
  24. You might also use _WinAPI_DragQueryFileEx (with flag 1 - files only)
  25. I haven't been able to locate any explanation of how to detect and process an Undo request (ctrl+z ... not a GUI button) while a GUI is active in GUIOnEventMode. What is a good method to define a function for that specific keyboard input? (All the buttons and "click on label" elements of my GUI work fine, BTW ... so I'm pleased with OnEventMode.) If I can catch the key input, my GUI can determine what, if anything, to do. IOW, the key input shouldn't be associated with any particular control. Thanks in advance for any help.
  26. Hmm... good to know. Thanks for that orbs. But regarding running as SYSTEM, I thought that only applied if using the -s switch. But maybe it always does run as SYSTEM, but launches the executable separately according to the psexec params (ie. -i [session])? I'm sure this can be done, but am under the impression that's a bit beyond me currently. That said, the paexec source is available and could be studied to determine the exact mechanisms used. Who knows, maybe if I get more time I can start digging into this. I was actually kind of wondering if any UDF's are out there already, but looks like that isn't the case. No big deal, though. I've already been playing with the TCP listen and send functions more. With those, it's looking very doable to get where I want to go. So like you said, short term I'm going to be working around psexec's limitations, and hopefully long term I can come up with something native. Thanks Chimp. Wondering if WMI is what psexec is using to do its thing?
  1. Load more activity