Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/21/2019 in all areas

  1. I was asking @eltorro serveral times for any support for XML DOM wrapper (COM) - with no success So I took matters into my hands ..... I want to present XMLWrapperEx.au3 - BETA Version Want to join to the project ? Here is some description: ; #INDEX# ======================================================================================================================= ; Title .........: XMLWrapperEx.au3 ; AutoIt Version : 3.3.10.2++ ; Language ......: English ; Description ...: Functions to use for reading and writing XML using msxml. ; Remarks .......: BETA Version ; Author ........: mLipok ; Version .......: "1.1.1.01" ; _XML_MiscProperty_UDFVersion() #CS This UDF is created on the basis of: https://www.autoitscript.com/forum/topic/19848-xml-dom-wrapper-com/ For this reason, I attach also the last known (to me) previous version ($_XMLUDFVER = "1.0.3.98" _XMLDomWrapper_1.0.3.98_CN.au3 ) For the same reason I continue to recognize the achievements of the work of my predecessors (they are still noted in each Function header). . . . . !!!!!!!!! This is BETA VERSION (all could be changed) !!!!!!!!! . . . WORK IN PROGRES INFORMATION: For now 2015-09-01 the descripion (Function Header) can not entirely correctly describe the function. TODO: in many places I used "TODO" as a keyword to find what should be done in future . I want to: PREVENT THIS: The unfortunate nature of both the scripts is that the func return results are strings or arrays instead of objects. .     I want to: USE THIS CONCEPT:     .   All function should use Refernce to the object as first Function parameter     .   All function should return in most cases objects. There should be separate functions to Change Object collection to array     .   All function should use COM Error Handler in local scope.     .   All function should return @error which are defined in #Region XMLWrapperEx.au3 - @ERROR Enums     .    All function should have the same naming convention     .    All variables should have the same naming convention     .    There should not to be any Global Variable - exception is $g__oXMLDOM_Events     .   It should be possible easy to use XML DOM Events     .        https://msdn.microsoft.com/en-us/library/ms764697(v=vs.85).aspx     .   It should be possible easy to Debug     .    Ultimately, you should be able to do anything with your XML without having to use your own Error Handler. #CE More info inside zip archive. This UDF can be downloaded from here: REMARK: This UDF was formerly named: XMLWrapperEx.au3
    1 point
  2. Here a small tool to watermark any image supported by GDI+. This version is the enhanced version from AutoIt Windows Screenshooter. Screenshot: Download: AutoIt Watermark Image v0.89 beta build 2014-08-25.7z (942 download previously) Source code is too long to publish here -> PASTEBIN You are not allowed to sell this code or use it or just parts of it in a commercial project or modify it and distribute it with a different name! Some fonts may no be displayed properly because it is not GDI+ compatible! Appreciate any feedback (bugs, feature request, criticisms, etc.). @JScript: I created this on your request Coded and tested on Win7 x64 with Aero and AutoIt v3.3.12.0. Command line parameters Credits: Authenticity (GDIP.au3), funkey (_GetFontInfoFromFilePtr()), Yashied (WinAPIEx.au3) and Melba23 (NoFocusLines.au3) Thanks to (alph. order): davidkim, funkey, JScript and Myicq for active supporting this little project! Br, UEZ History
    1 point
  3. ...looking around found this posting and tried the DDE. Found that it does not like the server example compiled as 64 bit. The client example work compiled as 32 and 64bit. I don't know anything about DLL calls. Could you fix the UDF to make it 64bit friendly ? Thanks ( the emoji is to manipulate you emotionally into doing it )
    1 point
  4. Nine

    Hook stdIO streams?

    For what I understand, Windows does not provide any mechanism to retroactively give another process a standard IO handle if it was created without one. You can AttachConsole () your own console to a running program, but the inverse seems not possible beside injecting code. But I may be wrong...
    1 point
  5. It means you have to give the messagebox a variable. Then the variable will hold the result value, so then the code knows if you pressed one or the other button. $iMsgBoxAnswer = MsgBox(8245, "Startup", "Startup failed! " & @CRLF & "Error Returned: " & @error & @CRLF & "Do you want to retry?") Select Case $iMsgBoxAnswer = 4 ;Retry Init() Case $iMsgBoxAnswer = 7 ;No Exit EndSelect
    1 point
  6. water

    Hook stdIO streams?

    If you can grab the process-ID (PID) using function ProcessList (or somethign similar) I think it should be possible to connect to the streams using StdoutRead / StdinWrite.
    1 point
  7. borsTiHD, It's almost impossible just to point out the cause of the problem. But I'm pretty sure the problem can't be solved in GUIListViewEx.au3. You need to look for the problem in your own code. So the problem is that $NM_CUSTOMDRAW notifications sent from the operating system to the header control do not work because the return values do not reach the parent control, ie. the listview control. $CDDS_PREPAINT notifications are correctly sent from the operating system, but $CDRF_NOTIFYITEMDRAW return values do not reach the listview control. This means that the subsequent $CDDS_ITEMPREPAINT and $CDDS_ITEMPOSTPAINT are simply not generated by the operating system. The consequence is that custom draw functionality does not work in the header control. Only the default functionality works. Ie. there are only default colors. It's probably not just $NM_CUSTOMDRAW notifications that do not work, but all notifications. In the header control there is only default functionality with respect to the functionality that's controlled by notifications. To figure out the cause of the problem you have to do some proper debugging. There are two easy methods you can use. One is to copy code from your original script to a new blank script. Start by just copying the GUI itself, the listview and the GUIListViewEx.au3 functionality. When you run the script you should see a fully functional listview that also has colors in the header control. Then you copy features one at a time from the original script to the new one and test after each feature. When the header colors are missing, you know which feature is causing the problem. From there you can then try to solve the problem. Another method is to make a copy of the original script, and then delete features one at a time and test after each deleted feature. When the colors appear in the header control, you have identified the problem. Lars.
    1 point
  8. Lately, in this forum, there were many questions and problems referring to the use of ie.au3 UDF using the latest version of AutoIt v3.3.14.x. I would like to present the correct usage of the UDF. I hope that it will help many users to prevent problems. #include <ie.au3> #include <MsgBoxConstants.au3> ; STEP 1 ; YOU MUST SET ANY COM ERROR HANDLER IN ONE OF THE FOLLOWING WAY ; STEP 1: CASE 1 ; you should set COM Error Handler Function for ie.au3 UDF _IEErrorHandlerRegister(_User_ErrFunc) ; STEP 1: CASE 2 ; eventually if you not want to recieve additional information ; you can use just the same function without parameter ; _IEErrorHandlerRegister() ; STEP 1: CASE 3 ; or use your own global COM Error Handler ;~ Global $oCOMErrorHandler = ObjEvent("AutoIt.Error", _User_ErrFunc) ; STEP 2 ; if you do not wish to get in Console Output Pane information like the following: ; --> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType ; You can uncomment this following line: ; _IEErrorNotify(False) _Example() Func _Example() ; First lets create some IE Object Local $oIE = _IECreate('google.com') ; you should always check for @error in any function (even you own made) If @error Then MsgBox($MB_ICONERROR, '_IECreate', '@error = ' & @error & @CRLF & '@extended = ' & @extended) ; Set @error when you return from function with Failure Return SetError(1,0,0) Endif ; here we try to get reference to LuckyStrike button Local $oLuckyStrike = _IEGetObjByName($oIE, 'btnI') ; you should always check for @error in any function (even you own made) If @error Then MsgBox($MB_ICONERROR, '_IEGetObjByName', '@error = ' & @error & @CRLF & '@extended = ' & @extended) ; Set @error when you return from function with Failure Return SetError(2,0,0) Endif ; here we try to click LuckyStrike button with previously achieved Object which is a reference to HTML DOM OBJECT in IE Instance _IEAction($oLuckyStrike, 'click') ; you should wait when page is loading _IELoadWait($oIE) ; some user interaction If MsgBox($MB_YESNO, 'Question', 'Do you want to back ?') = $IDYES Then _IEAction($oIE, 'back') EndIf EndFunc ;==>_Example ; User's COM error function. ; After SetUp with ObjEvent("AutoIt.Error", ....) will be called if COM error occurs Func _User_ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptFullPath & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_User_ErrFunc Regards, mLipok
    1 point
  9. I agree that arrays are a little nebulous in the au3 documentation. Here's a little excerpt from the help that clearly shows the mechanism (including the 0-based indexing): #include <Array.au3> Local $aArray_Base[10][3] For $i = 0 To 9 For $j = 0 To 2 $aArray_Base[$i][$j] = $i & " - " & $j Next Next _ArrayDisplay($aArray_Base, "2D - Original") The best long-term solution would be additions to the help that are clearly labeled as 1-dimensional, 2-dimensional and, say, 3-dimensional arrays ... as separate topics.
    1 point
  10. This one is much easier, if you just want to have an attachment. $ourfile = "c:\try.txt" ShellExecute("D:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE", "/a " & $ourfile)
    1 point
  11. The functions can even handle requests based on graph formula in the format y=mx+c... #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) GUICreate("", 340, 330) GUISetOnEvent($GUI_EVENT_CLOSE,"close") ;*********************************************************************** ; Prepare Labels for Axes ;*********************************************************************** $yMax = 10 ;this is the upper label for y axis $yMin = -10 ;this is the lower label for y axis $xMax = 10 ;this is the upper label for x axis $xMin = -10 ;this is the lower label for x axis GUICtrlCreateLabel($yMax,15,10,20,15,$SS_RIGHT) GUICtrlCreateLabel($yMin,15,280,20,15,$SS_RIGHT) GUICtrlCreateLabel($xMax,307,295,20,15,$SS_CENTER) GUICtrlCreateLabel($xMin,38,295,20,15,$SS_CENTER) ;*********************************************************************** ; Prepare Graphic control and zero lines ;*********************************************************************** $GraphWidth = 273 ;this is simply the pixel width of the control $GraphHeight = 273 ;this is simply the pixel height of the control $graph = GUICtrlCreateGraphic(48, 15, $GraphWidth, $GraphHeight) GUICtrlSetBkColor(-1,0xFFFFFF) ;graph background colour GUICtrlSetColor(-1,0x000000) ;graph border colour GUICtrlSetGraphic(-1,$GUI_GR_HINT,0) ;turn off hints ;---- X - Zero line ---- GUICtrlSetGraphic($graph,$GUI_GR_MOVE,Gen_Abs_Pix_x(0,$xMin,$xMax,$GraphWidth),Gen_Abs_Pix_y($yMin,$yMin,$yMax,$GraphHeight)) GUICtrlSetGraphic($graph,$GUI_GR_LINE,Gen_Abs_Pix_x(0,$xMin,$xMax,$GraphWidth),Gen_Abs_Pix_y($yMax,$yMin,$yMax,$GraphHeight)) ;---- Y - Zero line ---- GUICtrlSetGraphic($graph,$GUI_GR_MOVE,Gen_Abs_Pix_x($xMin,$xMin,$xMax,$GraphWidth),Gen_Abs_Pix_y(0,$yMin,$yMax,$GraphHeight)) GUICtrlSetGraphic($graph,$GUI_GR_LINE,Gen_Abs_Pix_x($xMax,$xMin,$xMax,$GraphWidth),Gen_Abs_Pix_y(0,$yMin,$yMax,$GraphHeight)) GUICtrlSetGraphic(-1,$GUI_GR_HINT,1) ;turn on hints ;*********************************************************************** ; PLOT POINTS ;*********************************************************************** for $i = $xMin to $xMax step 1 ;change step value for more plot points (e.g. step 0.5) ;---- Move to start pos ---- if $i = $xMin Then GUICtrlSetGraphic($graph,$GUI_GR_MOVE,Gen_Abs_Pix_x($xMin,$xMin,$xMax,$GraphWidth), Gen_Abs_Pix_y(0,$yMin,$yMax,$GraphHeight)) EndIf ;--------------------------- ;Stating that X equals each step of the loop means that we can get the control to plot ;points based on the Y = mX + c model. $x = $i ;for each step of the loop... $y = $x ;plot points based on Y = mX + c model. !!!!!CHANGE THIS LINE!!!!! GUICtrlSetGraphic($graph,$GUI_GR_LINE,Gen_Abs_Pix_x($x,$xMin,$xMax,$GraphWidth), Gen_Abs_Pix_y($y,$yMin,$yMax,$GraphHeight)) next GUISetState() While 1 Sleep(100) WEnd ;*********************************************************************** ; Absolute pixel reference generation functions ;*********************************************************************** func Gen_Abs_Pix_x($x,$low,$high,$width) $out = (($width/($high-$low))*(($high-$low)*(($x-$low)/($high-$low)))) Return $out EndFunc func Gen_Abs_Pix_y($y,$low,$high,$height) $out = ($height - (($height/($high-$low))*(($high-$low)*(($y-$low)/($high-$low))))) Return $out EndFunc func close() Exit EndFuncoÝ÷ Ù«miÈfz{oÝ÷ Ù«miÈfz{oÝ÷ Ù«miÈfz{oÝ÷ Ù«miÈfz{oÝ÷ ØZ+¶¬¢wr§çmæ±zÉb+ljwZÊ,zÛazZ(¦Ë^¦Ú4ÚÚ zÙ¨­êe¢Úh{ljÛZroÝ÷ Ùë"IèÂazº^¢^«Þ¦º¹ÇÞr©'µç`­ªaxºw-ìnëmêh{HßÙ­¯(§Ú zÖ®,êÞËajܨ¹Æ§¦º¹Ç¬¢g§Ç¢jeÆ­yØ+jlºÈ§e ÚåIëF­ªaƧvÜ(²)©çîËb¢{ºÚ"µÍ[ÈÙ[ÐX×Ô^Þ ÌÍÞ ÌÍÛÝË ÌÍÚYÚ ÌÍÝÚY B ÌÍÛÝ]H ÌÍÝÚYÊ ÌÍÚYÚIÌÍÛÝÊJJ ÌÍÚYÚIÌÍÛÝÊJ ÌÍÞIÌÍÛÝÊKÊ ÌÍÚYÚIÌÍÛÝÊJJJB] ÌÍÛÝ][[Â[ÈÙ[ÐX×Ô^ÞJ ÌÍÞK ÌÍÛÝË ÌÍÚYÚ ÌÍÚZYÚ B ÌÍÛÝ]H ÌÍÚZYÚH ÌÍÚZYÚÊ ÌÍÚYÚIÌÍÛÝÊJJ ÌÍÚYÚIÌÍÛÝÊJ ÌÍÞKIÌÍÛÝÊKÊ ÌÍÚYÚIÌÍÛÝÊJJJJB] ÌÍÛÝ][[ Any ideas/criticism welcome!!
    1 point
×
×
  • Create New...