Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/25/2014 in all areas

  1. jguinch

    How to hide folder

    FileSetAttrib works with both files and folders.
    1 point
  2. UEZ

    BitShift Optimization

    Indeed, I forgot to check out the carry. I can confirm that combined Half function is now faster. Might be a good idea to look at BigNum UDF... Btw, what do you want to achieve with so many calls? I mean you really need so many calls or is it just a optimization challenge? Br, UEZ
    1 point
  3. ? ;... TrayCreateItem("Something") TrayItemSetOnEvent(-1, "TrayEvent") ;.... Func TrayEvent() Switch TrayItemGetText(@TRAY_ID) Case "Something" MsgBox(0, "", "something") EndSwitch EndFunc
    1 point
  4. using mkdir instead of DirCreate() is understood. but a better way may exist: using direct call to CreateDirectoryW in kernel32.dll (which also fails if the directory already exists). a timing test shows mkdir takes ~25ms while CreateDirectoryW takes ~1ms testing locally on quite a decent machine: Windows 7 64-bit, CPU i5, 16GB RAM testing on SSD, SATA3, and USB3 drives - similar results. this testing script does not use the UDF, instead it has 2 versions of the _CFS_CreateLock() function - one the original (well, almost - i got rid of the architecture condition, as i mentioned in previous post), one calling the dll. #include <Array.au3> ; for _ArrayDisplay() Global $sCFS_Semaphore = @TempDir & '\CFS_Test_Sem' ; direclty define the semaphore directory name Global $aTime[4] ; an array to hold the timing results DirRemove($sCFS_Semaphore) ; initial cleanup. comment this line out (and create the semaphore before next run) to make sure the function failes when semaphore already exists $aTime[0] = @SEC & '.' & @MSEC $nResult_comspec = __CFS_CreateLock_comspec($sCFS_Semaphore) $aTime[1] = @SEC & '.' & @MSEC MsgBox(0, $nResult_comspec, '$nResult_comspec') ; see the return value DirRemove($sCFS_Semaphore) ; initial cleanup. comment this line out to make sure the function failes when semaphore already exists $aTime[2] = @SEC & '.' & @MSEC $nResult_dll = __CFS_CreateLock_dll($sCFS_Semaphore) $aTime[3] = @SEC & '.' & @MSEC MsgBox(0, $nResult_dll, '$nResult_dll') ; see the return value DirRemove($sCFS_Semaphore) ; final cleanup _ArrayDisplay($aTime) ; display results Func __CFS_CreateLock_comspec($sCFS_Semaphore) ; Since DirCreate() does not return an error if the directory already exists, we use mkdir Local $cmd = 'mkdir "' & $sCFS_Semaphore & '"' $cmd = @ComSpec & ' /c ' & $cmd Local $iResult = RunWait($cmd, @TempDir, @SW_HIDE) If @error Then Return 0 If $iResult = 0 Then Return 1 Else Return 0 EndIf EndFunc ;==>__CFS_CreateLock_comspec Func __CFS_CreateLock_dll($sCFS_Semaphore) ; Since DirCreate() does not return an error if the directory already exists, we use WinAPI Local $aRet = DllCall('kernel32.dll', 'bool', 'CreateDirectoryW', 'wstr', $sCFS_Semaphore, 'struct*', 0) If @error Then Return 0 If $aRet[0] = 0 Then Return 0 Else Return 1 EndIf EndFunc ;==>__CFS_CreateLock_dll i will test on a network share when i get the chance. unless i experience some hiccups in further tests, i think the conclusion is clear - it is better to use the dll version (last function in the testing script).
    1 point
  5. MikahS

    FF.au3 (V0.6.0.1b-10)

    I think the author is the only one that will be able to give us a clue on that function
    1 point
  6. If you've got the patience then it just needs a lot of lines in the right place with the right colour. (which I suppose is how the Mona Lisa was created.) #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 270, 197, 123) $Label1 = GUICtrlCreateLabel("", 90, 37, 398, 1, $WS_CLIPSIBLINGS) GUICtrlSetBkColor(-1, 0x808080) $Label2 = GUICtrlCreateLabel("", 91, 35, 401, 2) GUICtrlSetBkColor(-1, 0xD4D0C8) $Label3 = GUICtrlCreateLabel("", 91, 196, 400, 2) GUICtrlSetBkColor(-1, 0xA0A0A4) $Label4 = GUICtrlCreateLabel("", 94, 195, 395, 1, $WS_CLIPSIBLINGS) GUICtrlSetBkColor(-1, 0xFFFFE1) $Label5 = GUICtrlCreateLabel("", 90, 35, 2, 162) GUICtrlSetBkColor(-1, 0xD4D0C8) $Label6 = GUICtrlCreateLabel("", 92, 38, 1, 157) GUICtrlSetBkColor(-1, 0xA0A0A4) $Label7 = GUICtrlCreateLabel("", 487, 37, 3, 159) GUICtrlSetBkColor(-1, 0xDDDDDD) $Label8 = GUICtrlCreateLabel("", 490, 35, 1, 163) GUICtrlSetBkColor(-1, 0xA0A0A4) $Label9 = GUICtrlCreateLabel("", 104, 51, 369, 1, $WS_CLIPSIBLINGS) GUICtrlSetBkColor(-1, 0xC0C0C0) $Label10 = GUICtrlCreateLabel("", 102, 184, 371, 1, $WS_CLIPSIBLINGS) GUICtrlSetBkColor(-1, 0xC0C0C0) $Label11 = GUICtrlCreateLabel("", 104, 50, 1, 135, $WS_CLIPSIBLINGS) GUICtrlSetBkColor(-1, 0xC0C0C0) $Label12 = GUICtrlCreateLabel("", 472, 51, 1, 134, $WS_CLIPSIBLINGS) GUICtrlSetBkColor(-1, 0xC0C0C0) $Input1 = GUICtrlCreateInput("Input1", 132, 69, 121, 21) $Button1 = GUICtrlCreateButton("Button1", 352, 75, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
    1 point
×
×
  • Create New...