Jump to content

SandelPerieanu

Active Members
  • Posts

    170
  • Joined

  • Last visited

  • Days Won

    1

SandelPerieanu last won the day on July 24 2012

SandelPerieanu had the most liked content!

About SandelPerieanu

  • Birthday 08/24/1980

Profile Information

  • Location
    Romania
  • Interests
    All

SandelPerieanu's Achievements

Prodigy

Prodigy (4/7)

4

Reputation

  1. this function does not exist: _MinimizeToTray and declare $conn Global $conn ....................
  2. try this: $step = 1 $i=1 Do Tooltip($i) Sleep(50) $step += 1 $i += $step Until $i>=1000
  3. try this $objswbemlocator = ObjCreate("WbemScripting.SWbemLocator") $objswbemservices = $objswbemlocator.ConnectServer($ip, "rootcimv2", $struser, $strpassword, "MS_409", "ntlmdomain:" & $strdomain) $colitems = $objswbemservices.ExecQuery('SELECT * FROM Win32_GroupUser', 'WQL', 0x30) ...... ...... ...... without firewall on target...
  4. also woking if after first step string len = 3 MsgBox(262144, '', Total('2+4+0+1+1+9+7+9')) MsgBox(262144, '', Total('02061984')) ; Func Total($tstr) Local $tmp1, $tmp2 = 0 $tstr = StringRegExpReplace($tstr, "[" & StringRegExpReplace($tstr, "[0123456789]", "") & "]", "") If StringLen($tstr) <= 1 Then Return $tstr $tmp1 = StringSplit($tstr, "", 1) For $idx = 1 To $tmp1[0] $tmp2 += $tmp1[$idx] Next $tstr = Total($tmp2) If StringLen($tstr) <= 1 Then Return $tstr EndFunc ;==>Total
  5. Try this Run("Explorer.exe ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")
  6. i tested with the same file With FileInstall - 3.87 Mb With CreateFilesEmbedded.au3 - 6.70 Mb (- LZNT level 2) for me it's not ok. thanks.
  7. with this example the script will not stop #include <Date.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt('GuiOnEventMode', 1) Global $refresh, $msgbox, $label_1, $button_1, $button_2, $button_3 Global $Hour, $Mins, $Secs, $start $refresh = False $msgbox = GUICreate('MsgBox - Exemple', 140, 55, -1, -1) GUISetOnEvent($gui_event_close, '_Close') GUISetState() $label_1 = GUICtrlCreateLabel('00:00:00', 5, 5, 130, 20, 0x0201, $WS_EX_CLIENTEDGE) $button_1 = GUICtrlCreateButton('Start', 5, 30, 60, 20) GUICtrlSetOnEvent($button_1, '_Start') $button_2 = GUICtrlCreateButton('Stop', 75, 30, 60, 20) GUICtrlSetOnEvent($button_2, '_Stop') ; While 1 Sleep(1) If $refresh Then _TicksToTime(Int(TimerDiff($start)), $Hour, $Mins, $Secs) GUICtrlSetData($label_1, StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)) EndIf WEnd ; Func _Close() GUIDelete($msgbox) Exit 0 EndFunc ;==>_Close ; Func _Start() $refresh = True $start = TimerInit() EndFunc ;==>_Start ; Func _Stop() $refresh = False EndFunc ;==>_Stop
  8. try with guicreate instead of msgbox and Opt('GUIOnEventMode',1) and it works, will not stop
  9. try this: and may be help you
  10. An example with web server - post + get Share you computer over http with user and password My_Computer_Web-Share.rar
  11. this example works with any sizes... I have no explanation for If $ ichunksize> 1001783296 Then $ ichunksize = 1001783296 this number arose after several attempts, it is upper limit Func _MD5ForFirstFileChunk($sfile) Local $ichunksize = FileGetSize($sfile) If $ichunksize > 1001783296 Then $ichunksize = 1001783296 Local $a_hcall = DllCall("kernel32.dll", "hwnd", "CreateFileW", _ "wstr", $sfile, _ "dword", 0x80000000, _ ; GENERIC_READ "dword", 1, _ ; FILE_SHARE_READ "ptr", 0, _ "dword", 3, _ ; OPEN_EXISTING "dword", 0, _ ; SECURITY_ANONYMOUS "ptr", 0) If @error Or $a_hcall[0] = -1 Then Return SetError(1, 0, "") EndIf Local $hfile = $a_hcall[0] $a_hcall = DllCall("kernel32.dll", "ptr", "CreateFileMappingW", _ "hwnd", $hfile, _ "dword", 0, _ ; default security descriptor "dword", 2, _ ; PAGE_READONLY "dword", 0, _ "dword", 0, _ "ptr", 0) If @error Or Not $a_hcall[0] Then DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hfile) Return SetError(2, 0, "") EndIf DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hfile) Local $hfilemappingobject = $a_hcall[0] $a_hcall = DllCall("kernel32.dll", "ptr", "MapViewOfFile", _ "hwnd", $hfilemappingobject, _ "dword", 4, _ ; FILE_MAP_READ "dword", 0, _ "dword", 0, _ "dword", $ichunksize) If @error Or Not $a_hcall[0] Then DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hfilemappingobject) Return SetError(3, 0, "") EndIf Local $pfile = $a_hcall[0] Local $ibuffersize = $ichunksize Local $tmd5_ctx = DllStructCreate("dword i[2];" & _ "dword buf[4];" & _ "ubyte in[64];" & _ "ubyte digest[16]") DllCall("advapi32.dll", "none", "MD5Init", "ptr", DllStructGetPtr($tmd5_ctx)) If @error Then DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pfile) DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hfilemappingobject) Return SetError(4, 0, "") EndIf DllCall("advapi32.dll", "none", "MD5Update", _ "ptr", DllStructGetPtr($tmd5_ctx), _ "ptr", $pfile, _ "dword", $ibuffersize) If @error Then DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pfile) DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hfilemappingobject) Return SetError(5, 0, "") EndIf DllCall("advapi32.dll", "none", "MD5Final", "ptr", DllStructGetPtr($tmd5_ctx)) If @error Then DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pfile) DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hfilemappingobject) Return SetError(6, 0, "") EndIf DllCall("kernel32.dll", "int", "UnmapViewOfFile", "ptr", $pfile) DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hfilemappingobject) Local $smd5 = Hex(DllStructGetData($tmd5_ctx, "digest")) Return SetError(0, 0, $smd5) EndFunc ;==>_MD5ForFirstFileChunk
  12. you can add and this... MsgBox(4096, LockDevice("F:", 1), "Try yo CD") ;MsgBox(4096, LockDevice("F:", 0), "All Better") Func LockDevice($szdrivewithcolon, $block) Local Const $invalid_handle_value = -1 Local Const $open_existing = 3 Local Const $file_attribute_normal = 128 Local Const $file_share_write = 2 Local Const $file_share_read = 1 Local Const $generic_read = 2147483648 Local Const $ioctl_storage_media_removal = 2967556 $block = Not (Not $block) $szdrivewithcolon = StringReplace($szdrivewithcolon, "\", "") If StringLen($szdrivewithcolon) <> 2 Then Return -1 $szdrivewithcolon = "\\.\" & $szdrivewithcolon $hdrive = DllCall("kernel32.dll", "int", "CreateFile", "str", $szdrivewithcolon, _ "int", $generic_read, "int", BitOR($file_share_read, $file_share_write), "ptr", 0, "int", $open_existing, _ "int", $file_attribute_normal, "ptr", 0) If $hdrive[0] = $invalid_handle_value Then Return -2 $bool = DllStructCreate("byte") DllStructSetData($bool, 1, $block) $lockmediarslt = DllCall("kernel32.dll", "int", "DeviceIoControl", "int", $hdrive[0], _ "int", $ioctl_storage_media_removal, "ptr", DllStructGetPtr($bool), "int", 1, _ "int", 0, "int", 0, "int_ptr", 0, "ptr", 0) DllCall("kernel32.dll", "int", "CloseHandle", "int", $hdrive[0]) $bool = 0 Return $lockmediarslt[0] EndFunc ;==>LockDevice
  13. OR DllCall("User32.dll", "int", "EndTask", "hwnd", WinGetHandle("EXCEL"), "int", 0, "int", 1)
  14. like this? #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global $gui, $input_box $gui = GUICreate('Main Gui', 250, 30 , -1, -1) $input_box = GUICtrlCreateInput('', 5, 5, 240, 20) GUIRegisterMsg($wm_command, "Input_Change") GUISetState() While 1 $msg = GUIGetMsg() If $msg = $gui_event_close Then Exit WEnd ; Func Input_Change($hwnd, $msg, $wparam, $lparam) #forceref $hwnd, $msg, $lparam Local $nnotifycode = _WinAPI_HiWord($wparam) Local $nid = _WinAPI_LoWord($wparam) If $nid = $input_box And $nnotifycode = $en_change Then ToolTip(GUICtrlRead($input_box)) EndIf EndFunc ;==>Input_Change
×
×
  • Create New...