
Yogui
Members-
Posts
11 -
Joined
-
Last visited
About Yogui
- Birthday 07/03/1978
Profile Information
-
Location
france
Yogui's Achievements

Seeker (1/7)
0
Reputation
-
This script has to find faces in one embellish with images and to spot them but it does not work: (I have to try to modify it but without any success...
-
sorry this is the DLL fdlib.dll
-
I found this code on the German site, Can use me to put on (it) Thank you in advance #include <GDIPlus.au3> #include <WinAPI.au3> #include <Array.au3> $hOpen = DllOpen("fdlib.dll") _GDIPlus_Startup() $hbBMP = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\geeks.jpg") $iWidth = _GDIPlus_ImageGetWidth($hbBMP) $iHeight = _GDIPlus_ImageGetHeight($hbBMP) $hBMP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hbBMP) $iThreshold = Number(InputBox("Threshold", "Threshold")) If $iThreshold < 1 Then $iThreshold = 1 $vBMP = _GDIPlus_BitmapToStructByte($hBMP, $iWidth, $iHeight) DllCall($hOpen, "int:cdecl", "fdlib_detectfaces", "ptr", DllStructGetPtr($vBMP), "int", $iWidth, "int", $iHeight, "int", $iThreshold) $nFace = DllCall($hOpen, "int:cdecl", "fdlib_getndetections") If Not @error Then MsgBox(0, "", $nFace[0]) $nFace = $nFace[0] Else MsgBox(0, "", @error) Exit EndIf $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) $hGraph = _GDIPlus_ImageGetGraphicsContext($hImage) $hPen = _GDIPlus_PenCreate(0xFFFF0000) Dim $aFaces,$iX,$iY,$iSize If $nFace > 0 Then Dim $aFaces[$nFace][4] For $i = 0 To $nFace - 1 $nextFace = DllCall($hOpen, "int:cdecl", "fdlib_getdetection", "int", $i, "int*", $iX + $i, "int*", $iY + $i, "int*", $iSize + $i) If Not @error Then $iX = $nextFace[2] $iY = $nextFace[3] $iSize = $nextFace[4] _GDIPlus_GraphicsDrawRect($hGraph,$iX,$iY,$iSize,$iSize,$hPen) $aFaces[$i][0] = $i $aFaces[$i][1] = $iX $aFaces[$i][2] = $iY $aFaces[$i][3] = $iSize EndIf Next EndIf _GDIPlus_ImageSaveToFile($hImage,@ScriptDir&"\geeks2.jpg") _ArrayDisplay($aFaces) DllClose($hOpen) Func _GDIPlus_BitmapToStructByte($hBMP, $iW, $iH) Local $x, $y, $z, $sErrorHandlerString, $hDC, $hDC_tmp, $hBitmap, $vStruct_Byte, $vStruct_BMPInfo Local $hBitmap = DllCall("User32.dll", "hwnd", "CopyImage", "hwnd", $hBMP, "int", 0, "int", 0, "int", 0, "int", 1);LR_MONOCHROME If @error Then Return SetError(1, 0, _WinAPI_GetLastErrorMessage()) $hBitmap = $hBitmap[0] $vStruct_Byte = DllStructCreate("byte graydata[" & $iW * $iH & "]") Local $vStruct_BMPInfo = DllStructCreate("dword;long;long;ushort;ushort;dword;dword;long;long;dword;dword;dword RGBQuad[256];") $hDC_tmp = _WinAPI_GetDC(_WinAPI_GetDesktopWindow()) $hDC = _WinAPI_CreateCompatibleDC($hDC_tmp) _WinAPI_ReleaseDC(0, $hDC_tmp) Local $hBitmapOld = _WinAPI_SelectObject($hDC, $hBitmap) DllStructSetData($vStruct_BMPInfo, 1, DllStructGetSize(DllStructCreate("dword;long;long;ushort;ushort;dword;dword;long;long;dword;dword;", 1))) DllStructSetData($vStruct_BMPInfo, 2, $iW) DllStructSetData($vStruct_BMPInfo, 3, $iH * - 1) DllStructSetData($vStruct_BMPInfo, 4, 1) DllStructSetData($vStruct_BMPInfo, 5, 1) _WinAPI_GetDIBits($hDC, $hBitmap, 0, $iH, DllStructGetPtr($vStruct_Byte), DllStructGetPtr($vStruct_BMPInfo), 0) _WinAPI_DeleteObject(_WinAPI_SelectObject($hDC, $hBitmapOld)) _WinAPI_DeleteDC($hDC) Return $vStruct_Byte EndFunc ;==>_GDIPlus_BitmapToStructByte
-
Thanks for this and sorry ... for my inattention in my code
-
Hi Can you give an exemple for _GetRecords with a Where I tested that $arrSelectFields[3]=["Firstname","Lastname","AnotherField"] $arrWhereFields[1]=["Fistname = 'Dave'"] _GetRecords("TestTable",$arrSelectFields,$arrWhereFields=0) but don't work
-
I run this script since a PC Ce Pc is member of my domain I run this script as administrator domain. I test tomorrow this guiding script since the waiter Active Directory Server. On the other hand this script works but I manage to make what I want : #include <GUIConstants.au3> #include <Misc.au3> #include <INet.au3> #include <array.au3> Const $ADS_NAME_INITTYPE_GC = 3 Const $ADS_NAME_TYPE_NT4 = 3 Const $ADS_NAME_TYPE_1779 = 1 Const $UF_DISABLED = 0x0002; Dim $unlock Dim $mgrvalue Dim $mgrsplit Dim $manager Dim $mgr Dim $title Dim $pwdexpires Global $Date, $time $oMyError = ObjEvent("AutoIt.Error", "ComError") $objRootDSE = ObjGet("LDAP://RootDSE") $username = "lthobois" Global $strHostServer = $objRootDSE.Get("dnsHostName") ; Retrieve the name of the connected DC If @error Then MsgBox(0, $username, "l'utilisateur n'existe pas ou le domaine n'est pas joignable" & @LogonDomain) Else ; DNS domain name. $objTrans = ObjCreate("NameTranslate") $objTrans.Init($ADS_NAME_INITTYPE_GC, "") $objTrans.Set($ADS_NAME_TYPE_1779, @LogonDomain) $objTrans.Set($ADS_NAME_TYPE_NT4, @LogonDomain & "\" & $username) $strUserDN = $objTrans.Get($ADS_NAME_TYPE_1779) $UserObj = ObjGet("LDAP://" & $strUserDN) If @error Then MsgBox(0, 'username2', 'Username does not exist or not able to communicate with ' & @LogonDomain) Else Call("Displayinfo") EndIf EndIf Func ComError() If IsObj($oMyError) Then $HexNumber = Hex($oMyError.number, 8) SetError($HexNumber) Else SetError(1) EndIf Return 0 EndFunc ;==>ComError Func Displayinfo() MsgBox(0, "Login ", $UserObj.SAMAccountName) MsgBox(0, "Nom ", $UserObj.sn) MsgBox(0, "Prénom ", $UserObj.givenName) MsgBox(0, "Email ", $UserObj.mail) MsgBox(0, "Tél ", $UserObj.TelephoneNumber) MsgBox(0, "Description ", $UserObj.description) $UserObj.PUT("description", "pour test") $UserObj.SetInfo MsgBox(0, "Description ", $UserObj.description) endfunc
-
I made out a will with both versions the error is always the same. A specification of my domain is that it has of no extenssion (not compulsory for the time or I have to install the first one to controleur) the problem comes can be of it... exemple : #include <adfunctions.au3> #include <array.au3> Global $asUsergroups _ADGetUserGroups($asUsergroups) For $i = 1 To $asUsergroups[0] $Zf = Stringsplit($asUsergroups[$i],"=") $Zf = Stringsplit($Zf[2],",") $asUsergroups[$i] = $Zf[1] Next _Arraydisplay($asUsergroups) >Running:(3.3.0.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\yogui\Bureau\testad.au3" C:\Program Files\AutoIt3\Include\adfunctions.au3 (81) : ==> Variable must be of type "Object".: $objConnection.ConnectionString = "Provider=ADsDSOObject" $objConnection^ ERROR ->09:59:09 AutoIT3.exe ended.rc:1 +>09:59:11 AutoIt3Wrapper Finished >Exit code: 1 Time: 1.870
-
Hello, I shall like using this UDF but I do not manage to put on her(it)... I work under active directory Microsoft under Windows 2003 and I have this error message: C:\Program Files\AutoIt3\Include\adfunctions.au3 (81) : ==> Variable must be of type "Object".: $objConnection.ConnectionString = "Provider=ADsDSOObject" $objConnection^ ERROR I does not include the error can use me? Yogui Saddened for my English me use a translator
-
To help you can always add me to your neighbors Fabien Yogui Sorry it's not autoit
-
Detecting collision between 2 windows
Yogui replied to nf67's topic in AutoIt General Help and Support
just for fun ... #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ;=================================================================== ;GUI's should be created before monitoring begins ;=================================================================== ;The Wall $Wall = GUICreate("Wall", 150, 500, 300, 300) GUISetBkColor(0x808080) $WallLabel = GUICtrlCreateLabel("Wall", 8, 8, 25, 17) ;The ball. $Ball = GUICreate("Ball", 150, 150, 200, 200) GUISetBkColor(0x800000) $CreateWall = GUICtrlCreateButton("Wall", 0, 32, 49, 17, $WS_GROUP) $BallLabel = GUICtrlCreateLabel("Ball", 8, 8, 21, 17) GUISetState(@SW_SHOW) ;=================================================================== AdlibEnable("MonitorWindows", 10); Monitor for collissions While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $CreateWall ;The wall. GUICtrlSetData($WallLabel, "Wall"); update label text if you needed to GUISetState(@SW_SHOW, $Wall) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndSwitch WEnd ;================================================================================== ; FUNCTIONS FOR CHECK COLLISSION ;================================================================================== Func MonitorWindows() If BitAND(WinGetState($Ball), 2) And BitAND(WinGetState($Wall), 2) And CheckCollission($Ball, $Wall) Then ToolTip("collision") $size = WinGetPos("Ball") For $i = 1 To 10 WinMove("Ball", "", $size[0] + 5, $size[1] + 5, $size[2], $size[3]) ;~ sleep(500) WinMove("Ball", "", $size[0] - 5, $size[1] - 5, $size[2], $size[3]) Next Else ToolTip("") EndIf EndFunc ;==>MonitorWindows Func CheckCollission($Win1, $Win2) $Win1Pos = WinGetPos($Win1) If @error Then MsgBox(0, "", "Error Reading Win1") Return 0 EndIf $Win2Pos = WinGetPos($Win2) If @error Then MsgBox(0, "", "Error Reading Win2") Return 0 EndIf If _CheckOverlap($Win1Pos, $Win2Pos) Then Return True If _CheckOverlap($Win2Pos, $Win1Pos) Then Return True EndFunc ;==>CheckCollission Func _WinGetByPID($iPID) Local $aWList = WinList() For $iCC = 1 To $aWList[0][0] If WinGetProcess($aWList[$iCC][1]) = $iPID And _ BitAND(WinGetState($aWList[$iCC][1]), 2) Then Return $aWList[$iCC][0] EndIf Next Return SetError(1, 0, 0) EndFunc ;==>_WinGetByPID Func _CheckOverlap($ar1, $a2) If _WinAPI_PtInRectEx($ar1[0], $ar1[1], $a2[0], $a2[1], $a2[2], $a2[3]) Then Return True If _WinAPI_PtInRectEx($ar1[0] + $ar1[2], $ar1[1], $a2[0], $a2[1], $a2[2], $a2[3]) Then Return True If _WinAPI_PtInRectEx($ar1[0] + $ar1[2], $ar1[1] + $ar1[3], $a2[0], $a2[1], $a2[2], $a2[3]) Then Return True If _WinAPI_PtInRectEx($ar1[0], $ar1[1] + $ar1[3], $a2[0], $a2[1], $a2[2], $a2[3]) Then Return True EndFunc ;==>_CheckOverlap ; Note this_WinAPI_PtInRectEx() Not the same as 1st post. ; Here Width & height used, NOT Bottom right corner position. ; Also, declared $tagREC. $tagRECT required WinAPI.au3 to be included. ; Author - Malkey Func _WinAPI_PtInRectEx($iX, $iY, $iLeft, $iTop, $iWidth, $iHeight) Local $aResult, $tagREC = "int Left;int Top;int Right;int Bottom" Local $tRect = DllStructCreate($tagREC) DllStructSetData($tRect, "Left", $iLeft) DllStructSetData($tRect, "Top", $iTop) DllStructSetData($tRect, "Right", $iLeft + $iWidth) DllStructSetData($tRect, "Bottom", $iTop + $iHeight) $aResult = DllCall("User32.dll", "int", "PtInRect", "ptr", DllStructGetPtr($tRect), "int", $iX, "int", $iY) Return $aResult[0] <> 0 EndFunc ;==>_WinAPI_PtInRectEx -
Hello can you help me to use this API : WTSEnumerateSessions http://msdn.microsoft.com/en-us/library/aa383833(VS.85).aspx I would like to get back the name of the TSE Merci