Jump to content

Ghost_Line

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Ghost_Line

  1. Thanks for that @Nine ! I feel a little dumb not having thought of _ArrayToString 😅
  2. Hello @Nine, I'm sorry to ask, but could you please give a small example on how give the content of an array as an argument ? I'm not sure to understand how WCD-IPC is working :(
  3. Hey guys ! I'm using actively _XML.au3 for professional purpose, and I ran into a ... I don't know if it's a problem or a feature. Anyway : this node (in an existing file) <szFooterLine0 Type="202">TEXT</szFooterLine0> become this <szFooterLine0[@Type=202]>TEXT</szFooterLine0> after some manipulation on the file (but not this node). For obvious reason, it's a problem Any hint ?
  4. Hey guys ! I've to modify a XML file, and I don't know how to take care of it (I'm still trying to get how to make it work, but ...). Here's a part of one of the files I've to check : for example, I've to check if lTaCreateNmbr exists, and if not, I've to create it with an arbitrary value. Thanks for your help ! <?xml version='1.0' encoding='utf-8'?> <TAS>   <NEW_TA>     <TA_CONTROL>       <lTaCreateNmbr>14</lTaCreateNmbr>       <iTaStatus>4</iTaStatus>       <szLastCalledModul>clsTemplateDispatch</szLastCalledModul>       <sModQuantityCnt>1</sModQuantityCnt>       <dModQuantityQty>1</dModQuantityQty>
  5. Yep, this query works fine in Studio (you can try it too since it's a generic MSSQL variable).
  6. Hello guys ! I'm stuck in something stupid (I guess), but since I've no clue on how to solve it, here I come I'm trying to collect the result of the query "select @@hostname" on MSSQL Server, but it doesn't work ... and I'm sure I'm connected to the database (I've successfully seen the database treeview). #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include<_sql.au3> #include<array.au3> Local $aData,$iRows,$iColumns ;Server ID and credentials for tCards Global $ServerAddressT = "10.200.88.1" Global $ServerUserNameT = "user" Global $ServerPasswordT = "password" Global $DatabaseNameT = "DataBASE" ;Connect to DB _SQL_RegisterErrorHandler();register the error handler to prevent hard crash on COM error $OADODB = _SQL_Startup() If $OADODB = $SQL_ERROR Then MsgBox(0 + 16 + 262144, "Error", _SQL_GetErrMsg()) If _sql_Connect(-1, $ServerAddressT, $DatabaseNameT, $ServerUserNameT, $ServerPasswordT) = $SQL_ERROR Then MsgBox(0 + 16 + 262144, "Error 1", _SQL_GetErrMsg()) _SQL_Close() Exit Else If _SQL_Execute(-1,"select @@SERVERNAME") = $SQL_ERROR then Msgbox(0 + 16 +262144,"Error",_SQL_GetErrMsg()) Else _ArrayDisplay(_SQL_GetTable(-1,"select @@SERVERNAME",$aData,$iRows,$iColumns)) ;~ $toto = _SQL_Execute(-1,"select @@SERVERNAME") ;~ _ArrayDisplay($toto) EndIf EndIf
  7. Back from the deads ... I've the same issue here, but it's something I think I can manage. I've only two regrets : - it miss a post copy control to see if it is about to rewrite the exact same file - it miss lot of return (for example, the MD5 key, or the detailled output when there's an error while copying, etc.) wraithdu , have you ever considered to extend the functionalities of this tool ?
  8. Hi ! My exact problem is taht I've to watch my filesystem for curious behaviors, like suddent files deleting, during the execution of a very ressource demanding program. As you can guess, that's why I've to know the name, timestamp (and eventually name of the deleter process), but this UDF only show me if a file is modified or if the size of a folder vary. I don't have any indication of a new file with a specific message, nor the deletion. Thanks for your concern !
  9. Hi guys, sorry for the grave digging, but I'm looking for a way to see, in real time and without too much CPU and memory load, what happen to the files in a folder of my server. The library in this topic work well, but not for the deletion and addition of files (they doesn't seem to be seemed by the program) when I use the File System Monitor proposed as an example. My guess is that, in Windows 7 and next versions, the "addresses" aren't the good ones : Case 0 $fs_event.item(Hex(0x00000001)) = "file added to the directory|FILE_ACTION_ADDED" $fs_event.item(Hex(0x00000002)) = "file removed from the directory|FILE_ACTION_REMOVED" $fs_event.item(Hex(0x00000003)) = "file was modified|FILE_ACTION_MODIFIED" $fs_event.item(Hex(0x00000004)) = "file was renamed old name|FILE_ACTION_RENAMED_OLD_NAME" $fs_event.item(Hex(0x00000005)) = "file was renamed new name|FILE_ACTION_RENAMED_NEW_NAME"When I try to look after the $fs_event value, it show me "1","2","3" in the middle of "true" values as "0x00000001", "0x00040000" etc.). Could you help me on this matter ? Thank you in advance
  10. Woot ! I can write again Bert : it seem to be a corporate security issue, since it work on "open internet". ViciousXUSMC : thanks a lot for your post !
  11. Hello guys, I'm looking for a simply usable function like _AddTextToPic() (written here : http://www.autoitscript.com/forum/topic/138197-place-text-in-image-and-save/ ) in order to add a picture into a picture. I explain : we use sticky printed paper with the logo and adress of each of our clients to identify parcels. Until now, I've used Paint.net and do them myself, but since I've been promoted, I've to let usable tools to my collegue before I go. That's why I want to make a little interface where the user has only to put the path to the client logo, some texts, and then to click Ok in order to generate the picture. Can anyone help me on this matter ? Thanks ! Edit : for some reasons, I can't post answers to my posts, so I edit the first I've successfuly adapted some scripts I've found in order to do this ! I can, without installing anything, "paste" texts and images in an existing picture. It's quick and REALLY dirty, but it work : #include <GDIPlus.au3> #include <WinAPI.au3> Example() _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Image.jpg", @MyDocumentsDir & "\GDIPlus_Imag.jpg", "CODE MAG :", 133, 49) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Imag.jpg", @MyDocumentsDir & "\GDIPlus_Image.jpg", "N° CAISSE :", 133, 125) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Image.jpg", @MyDocumentsDir & "\GDIPlus_Imag.jpg", "NOM MAGASIN :", 20, 200) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Imag.jpg", @MyDocumentsDir & "\GDIPlus_Image.jpg", "CODE MAG :", 556, 49) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Image.jpg", @MyDocumentsDir & "\GDIPlus_Imag.jpg", "N° CAISSE :", 556, 125) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Imag.jpg", @MyDocumentsDir & "\GDIPlus_Image.jpg", "NOM MAGASIN :", 443, 200) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Image.jpg", @MyDocumentsDir & "\GDIPlus_Imag.jpg", "CODE MAG :", 133, 349) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Imag.jpg", @MyDocumentsDir & "\GDIPlus_Image.jpg", "N° CAISSE :", 133, 425) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Image.jpg", @MyDocumentsDir & "\GDIPlus_Imag.jpg", "NOM MAGASIN :", 20, 500) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Imag.jpg", @MyDocumentsDir & "\GDIPlus_Image.jpg", "CODE MAG :", 556, 349) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Image.jpg", @MyDocumentsDir & "\GDIPlus_Imag.jpg", "N° CAISSE :", 556, 425) _AddTextToPic (@MyDocumentsDir & "\GDIPlus_Imag.jpg", @MyDocumentsDir & "\GDIPlus_Image.jpg", "NOM MAGASIN :", 443, 500) ShellExecute(@MyDocumentsDir & "\GDIPlus_Image.jpg") Func Example() Local $hImage1, $hImage2, $hGraphic ; Initialize GDI+ library _GDIPlus_Startup() $hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir&"\image.jpg") $hImage2 = _GDIPlus_ImageLoadFromFile("c:\temp\interface.bmp") $iScale = 0.55 $hBitmap_Scaled = _GDIPlus_ImageScale($hImage2, $iScale, $iScale, $GDIP_INTERPOLATIONMODE_NEARESTNEIGHBOR) ; Draw one image in another $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap_Scaled, 10, 75) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap_Scaled, 10, 375) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap_Scaled, 435, 75) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap_Scaled, 435, 375) ; Save resultant image _GDIPlus_ImageSaveToFile($hImage1, @MyDocumentsDir & "\GDIPlus_Image.jpg") ; Clean up resources _GDIPlus_BitmapDispose($hImage2) _GDIPlus_ImageDispose($hImage1) ; Shut down GDI+ library _GDIPlus_Shutdown() EndFunc ;==>Example Func _AddTextToPic ( $_ImagePath, $_Outputpath, $sString, $_X=0, $_Y=0 ) Local $hBitmap, $hImage, $hGraphic, $hFamily, $hFont, $tLayout, $hFormat, $aInfo, $hBrush1, $hBrush2, $iWidth, $iHeight, $hPen ; Initialize GDI+ library _GDIPlus_StartUp ( ) ; Load image and emboss text $hImage = _GDIPlus_ImageLoadFromFile ( $_ImagePath ) $hGraphic = _GDIPlus_ImageGetGraphicsContext ( $hImage ) $hFamily = _GDIPlus_FontFamilyCreate ( "Calibri" ) $hFont = _GDIPlus_FontCreate ( $hFamily, 14, 1 ) $hFormat = _GDIPlus_StringFormatCreate ( 0x4000 ) $hBrush2 = _GDIPlus_BrushCreateSolid ( 0xff000000 ) $hPen = _GDIPlus_PenCreate ( 0xC4000000, 1 ) ; Set Text Pos $tLayout = _GDIPlus_RectFCreate ( $_X, $_Y ) $aInfo = _GDIPlus_GraphicsMeasureString ( $hGraphic, $sString, $hFont, $tLayout, $hFormat ) _GDIPlus_GraphicsDrawStringEx ( $hGraphic, $sString, $hFont, $aInfo[0], $hFormat, $hBrush2 ) ; Save image _GDIPlus_ImageSaveToFile ( $hImage, $_Outputpath ) ; Free resources _GDIPlus_PenDispose ( $hPen ) _GDIPlus_BrushDispose ( $hBrush1 ) _GDIPlus_BrushDispose ( $hBrush2 ) _GDIPlus_StringFormatDispose ( $hFormat ) _GDIPlus_FontDispose ( $hFont ) _GDIPlus_FontFamilyDispose ( $hFamily ) _GDIPlus_GraphicsDispose ( $hGraphic ) _GDIPlus_ImageDispose ( $hImage ) _GDIPlus_ShutDown ( ) EndFunc ;==> _AddTextToPic ( ) This way, I can include it in a larger program I'm writing right now (as you can guess, printing stickers is only a small part of the whole thing :)).
  12. #RequireAdmin #include <GraphGDIPlus.au3> #include <GUIConstants.au3> AdlibRegister("findTemp", 900) AdlibRegister("_Draw_Graph", 1000) Local $hGUI, $hGraph, $temp, $Counter = 1, $iCheck, $msg, $xVal = 1 $hGUI = GUICreate("", 600, 350) ; create the GUI window ;~ $iCheck = GUICtrlCreateCheckbox("Reset on next interval", 462, 1) GUISetState() ; show the window CreateGraph() ; create the graph findTemp() ; find the temp _Draw_Graph() ; draw the graph While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Quit() EndSwitch WEnd Func CreateGraph() If IsArray($hGraph) = 0 Then ; if an array hasn't been made; then make it $hGraph = _GraphGDIPlus_Create($hGUI, 37, 24, 545, 300, 0xFF000000, 0xFF88B3DD) ; create the graph EndIf If $Counter > 24 Then ; if the counter is greater then 24; lets start making this move over one on the x range _GraphGDIPlus_Set_RangeX($hGraph, $xVal, $Counter, 24) ; this will move us one full tick over to the right from the start and finish of the x range $xVal += 1 ; add one to our start x range Else _GraphGDIPlus_Set_RangeX($hGraph, 0, 100, 100) ; set the x range from 0 - 24 putting all 24 ticks on screen _GraphGDIPlus_Set_RangeY($hGraph, 0, 100, 5) ; set the y range from 0 - 125 only putting 5 ticks on screen _GraphGDIPlus_Set_GridX($hGraph, 1, 0xFF6993BE) ; set the x grid _GraphGDIPlus_Set_GridY($hGraph, 1, 0xFF6993BE) ; set the y grid EndIf EndFunc ;==>CreateGraph Func _Draw_Graph() If $Counter > 100 Then ; if we've reached the end CreateGraph() ; and create the graph again EndIf _GraphGDIPlus_Set_PenColor($hGraph, 0xFF325D87) ; set the color of the line _GraphGDIPlus_Set_PenSize($hGraph, 2) ; set the size of the line _GraphGDIPlus_Plot_Start($hGraph, $Counter, 0) ; set the start on the graph plot _GraphGDIPlus_Plot_Line($hGraph, $Counter, $temp) ; set the line ending _GraphGDIPlus_Refresh($hGraph) ; draw it to the screen $Counter += 1 ; add one to our counter EndFunc ;==>_Draw_Graph Func findTemp() Local $aClasses, $nCounter = 0 $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $strComputer = "." $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") ;~ $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PerfRawData_Tcpip_NetworkInterface", "WQL", _ ;~ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) $Instances = $objWMIService.InstancesOf("Win32_PerfFormattedData_Tcpip_NetworkInterface") $aClasses = $objWMIService.subClassesOf() For $class in $aClasses If StringInStr($class.Path_.Path, "Win32_PerfFormattedData_Tcpip_NetworkInterface") <> 0 Then $nCounter += 1 EndIf Next For $Item In $Instances $temp = ($Item.BytesTotalPersec/8)/10000; set the temp MsgBox(0,"",$Item.BytesTotalPersec) Return ($temp) Next EndFunc ;==>findTemp Func Quit() _GraphGDIPlus_Delete($hGUI, $hGraph) ; delete the graph Exit ; get us out EndFunc ;==>Quit I've tried like this, but the result isn't good, since I don't understand the values coming out (in comparison with the Windows network load graph). I've never used by myself GDI (only adapation of existing scripts), soooooo ...
  13. I'm in pain in obtaining the percentage of the total network bandwith usage Any idea ? I guess I can have some use of this : '?do=embed' frameborder='0' data-embedContent>>, but I really don't know how to put all of this together
  14. Thank you for searching ! You're veeeery kind
  15. Yes sir ! My problem isn't the collection of datas, but the way to put them in a RT graph, like the one you have into the task manager. If you have some example, I will accept it
  16. Hello guys ! In order to centralize all the controlling tools I use on my server, I'm looking for a way to integrate a "Windows network monitor graph like" in my interface. But I haven't any clue on how to do it ... Help ? Thanks for your answers !
  17. That's great ! I was looking for this for Eon
  18. Hey guys, Here's a little something I've coded this morning for my job : #include <Date.au3> MsgBox(0,"",_YDay_To_Date("90", "2015")) ; #FUNCTION# ==================================================================================================================== ; Name ..........: YDay_To_Date ; Description ...: Give the date of the xxxth day of a given year ; Syntax ........: YDay_To_Date($yday, $year) ; Parameters ....: $yday : the day number you want to "convert" to date ; : $year : the concerned year ; Return values .: If there's no error, the date in standard format (YYYY/MM/DD) ; otherwise, nothing. ; Author ........: GhostLine ; Example .......: Yes ; =============================================================================================================================== Func _YDay_To_Date($yday, $year) If _DateIsLeapYear($year) And $yday > 364 Or $yday > 365 Then Exit $month = 1 For $day = 1 To $yday If $day = $yday Then ExitLoop If _DateIsValid($year & "/" & StringRight(0 & $month, 2) & "/" & StringRight(0 & $day, 2)) <> 1 Then $yday = $yday - ($day - 1) $day = 1 $month = $month + 1 EndIf Next Return($year & "/" & StringRight(0 & $month, 2) & "/" & StringRight(0 & $yday, 2)) EndFunc ;==>_YDay_To_Date I hope it's not too bad Edit : after posting this on the french forum, jchd has answered me, and opened my eyes about the fact I've totally missed the use of _DateAdd
  19. Great tool, I was looking for this without conviction since ... too long One little regret : if you click on a file on your desktop, then move cursor to *a random window*, then back to the desktop, you lose the "file selection". Could you do something about it ?
  20. No no, I'm only a french man who want to help (see all my messages : none is in french)
  21. [i hope it's understandable !!] I'd like to share with you a problem I've encountered when I was creating a script, who has to compare two files. Le first is located on a server, the second on a client PC. The point of this comparison is to delete the client PC file and replace it by the server one, if the files are different. My problem is that the concerned file is located in the server in a folder who's shared with a "$" [Translation note : so it's a "full drive" sharing ?] with only one administrator user (with password). In this context, how can I get the filegetsize() and filegetversion() information, with limited rights and knowing that runas only permit admin granting on program and not functions ? Here's my script : #include <FileConstants.au3> #include <Constants.au3> $srv = "serveurdossier$test.exe" $loc = "d:folder" $user = "user" $domaine = "serveur" $pass = "pass@@ssapl" $flg = 2 ; qu'est ce que je pourai mettre ici afin de executer le reste de scripte avec des droits d'administrateurs ;RunAs($user,$domaine,$pass, $flg, ...) >> je sais pas si ça va fonctionner ou non et comment? if not FileExists($srv) then MsgBox($MB_SYSTEMMODAL, "Erreur !", "File Serveur is not exist...") Else Local $iFileSize = FileGetSize($loc) Local $iFileSize1 = FileGetSize($srv) Local $sFileVersion = FileGetVersion($loc) Local $sFileVersion1 = FileGetVersion($srv) if $iFileSize <> $iFileSize1 Or $sFileVersion <> $sFileVersion1 then FileCopy($pcserveur ,$pcloc, 1) MsgBox($MB_SYSTEMMODAL, "msg !", "copie ") else MsgBox($MB_SYSTEMMODAL, "msg !", "non") endif EndIf Thanks in advance for your help.
  22. http://en.kioskea.net/forum/affich-775804-file-c-google-googleupdate-a3x-error I think it could answer your question
  23. Hi ! I've just printed one of my program, and I've been surprised to see that ISN Studio print directly to the printer, without any configuration possibility. So here's my request : could you print through the "classical" Windows printing manager, so I can have a "both side" printing ? Thanks !
  24. Hi guys ! I was asking myself : have we something simple who can permit to show only a part of a video on screen ? A program who can take in arguments the coordinates of the area we want to show on screen, like _playpart("video.avi",0,0,400,400) [hypothetical example] to show on screen only the area of the video "video.avi" from the top left to the point 400;400, not more ? Or if you know a player who can do that, I'll take it too Thanks in advance for your help !
×
×
  • Create New...