Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/06/2016 in all areas

  1. I've got no problem with you setting this up.
    3 points
  2. I have talked with freenode's staff and they require the creator of AutoIt (@Jon) to send them an email telling them that its OK for them to let me operate the official channel. I will send a PM to Jon with more details on who he needs email and some confidential stuff... Thanks you guys for helping me bring back the IRC AutoIt Community! Love you all!
    2 points
  3. Hello. Here you have. #include <WinAPIProc.au3> #include <WinAPI.au3> Opt("MustDeclareVars", 1) #RequireAdmin Global Const $OWNER_SECURITY_INFORMATION = 0x1 Global Const $GROUP_SECURITY_INFORMATION = 0x2 Global Const $DACL_SECURITY_INFORMATION = 0x4 Global Const $FILE_GENERIC_READ = 0x120089 ;STANDARD_RIGHTS_READ Or FILE_READ_DATA Or FILE_READ_ATTRIBUTES Or _FILE_READ_EA Or SYNCHRONIZE Global Const $FILE_GENERIC_WRITE = 0x120116 ;STANDARD_RIGHTS_WRITE Or FILE_WRITE_DATA Or FILE_WRITE_ATTRIBUTES Or _FILE_WRITE_EA Or FILE_APPEND_DATA Or SYNCHRONIZE Global Const $FILE_GENERIC_EXECUTE = 0x1200A0 ;STANDARD_RIGHTS_EXECUTE Or FILE_READ_ATTRIBUTES Or FILE_EXECUTE Or SYNCHRONIZE Global Const $FILE_ALL_ACCESS = 0x1F01FF ;STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H1FF Global Const $sTag_GENERIC_MAPPING = "dword GenericRead;dword GenericWrite;dword GenericExecute;dword GenericAll;" If _CanAccessFolder("C:\System Volume Information", $GENERIC_WRITE) Then MsgBox(0, ":)", "I can Write...") Else MsgBox(0, ":(", "I can't Write...") EndIf If _CanAccessFolder("C:\", $GENERIC_WRITE) Then MsgBox(0, ":)", "I can Write...") Else MsgBox(0, ":(", "I can't Write...") EndIf Func _CanAccessFolder($sDir, $genericAccessRights) Local $bRet = False Local $tSecurityDescriptor = _GetSecurityDescriptor($sDir) ConsoleWrite("$tSecurityDescriptor: " & DllStructGetData($tSecurityDescriptor, 1) & @CRLF) Local $hToken = _WinAPI_OpenProcessToken(BitOR($TOKEN_IMPERSONATE, $TOKEN_QUERY, $TOKEN_DUPLICATE, $STANDARD_RIGHTS_READ)) ConsoleWrite("$hToken: " & $hToken & @CRLF) Local $hImpersonatedToken = _WinAPI_DuplicateTokenEx($hToken, 0, $SECURITYIMPERSONATION, $TOKENIMPERSONATION) ConsoleWrite("$hImpersonatedToken: " & $hImpersonatedToken & @CRLF) Local $tmapping = DllStructCreate($sTag_GENERIC_MAPPING) $tmapping.GenericRead = $FILE_GENERIC_READ $tmapping.GenericWrite = $FILE_GENERIC_WRITE $tmapping.GenericExecute = $FILE_GENERIC_EXECUTE $tmapping.GenericAll = $FILE_ALL_ACCESS _MapGenericMask($tmapping, $genericAccessRights) ConsoleWrite("$genericAccessRights: " & $genericAccessRights & @CRLF) Local $tprivilege_set = DllStructCreate("dword;dword;dword;dword;dword") Local $aRet = DllCall("Advapi32.dll", "bool", "AccessCheck", "ptr", DllStructGetPtr($tSecurityDescriptor), "handle", $hImpersonatedToken, "dword", $genericAccessRights, _ "ptr", DllStructGetPtr($tmapping), "ptr", DllStructGetPtr($tprivilege_set), "dword*", DllStructGetSize($tprivilege_set), "dword*", 0, "bool*", 0) $bRet = $aRet[8] If $hImpersonatedToken Then _WinAPI_CloseHandle($hImpersonatedToken) If $hToken Then _WinAPI_CloseHandle($hToken) Return $bRet EndFunc ;==>_CanAccessFolder Func _GetSecurityDescriptor($sDir) Local $aRet = DllCall("Advapi32.dll", "bool", "GetFileSecurityW", _ "wstr", $sDir, _ "dword", BitOR($OWNER_SECURITY_INFORMATION, $GROUP_SECURITY_INFORMATION, $DACL_SECURITY_INFORMATION), _ "ptr", Null, _ "dword", Null, _ "dword*", 0) Local $iBufferSize = $aRet[5] ConsoleWrite("$iNeededSize: " & $iBufferSize & @CRLF) Local $tSecurityDescriptor = DllStructCreate("byte[" & $iBufferSize & "]") $aRet = DllCall("Advapi32.dll", "bool", "GetFileSecurityW", _ "wstr", $sDir, _ "dword", BitOR($OWNER_SECURITY_INFORMATION, $GROUP_SECURITY_INFORMATION, $DACL_SECURITY_INFORMATION), _ "ptr", DllStructGetPtr($tSecurityDescriptor), _ "dword", $iBufferSize, _ "dword*", 0) Return $tSecurityDescriptor EndFunc ;==>_GetSecurityDescriptor Func _MapGenericMask(ByRef $GenericMapping, ByRef $genericAccessRights) Local $aRet = DllCall("Advapi32.dll", "none", "MapGenericMask", "dword*", $genericAccessRights, "ptr", DllStructGetPtr($GenericMapping)) $genericAccessRights = $aRet[1] EndFunc ;==>_MapGenericMask Saludos
    2 points
  4. Jos

    Scite question issue

    I had added the logic in Tidy to restore Bookmarks and Folds, but not in AutoIt3Wrapper. I have now copied that logic from Tidy and added that to AutoIt3Wrapper. The current Beta will restore the Folds and Bookmarks in case the GUI or Version logic updates the original source. Let me know if I missed anything or when there are other functions that need this process as well. Jos
    1 point
  5. czardas, I've seen your last update 5 minutes ago, so I have not looked into it yet. A quick update: Added an example with right aligned text. Added an example where you can delete/insert columns (right click in header). I'll check the code more thoroughly during the week. Font name and size will be handled in the UDF. New zip in first post. Let me know if there are more of these kinds of problems.
    1 point
  6. Use StringInStr to get the position of the first "A" and then use this as starting position for your calculation.
    1 point
  7. Oh, yeah, true. I did not look at the script because is was VB.Net :-/
    1 point
  8. Ah ok Comes with the next update!
    1 point
  9. IIRC the only thing you can really do is a .WaitForExit() on the process.
    1 point
  10. Hello. #RequiereAdmin Is just for test that even if you run with admin you can't write in "C:\System Volume Information" But can in "C:\". (All this if UAC is enable) You can check removing #RequiereAdmin and will notice that you can't write in "C:\" (If UAC is enable). Saludos
    1 point
  11. It should be easy enough, I don't know VB.Net so I wrote a AutoIt Script: Global Const $32BIT_PROGRAMFILES = @CPUArch = 'X64' ? 'C:\Program Files (x86)' : 'C:\Program Files' Global Const $AUTOIT = $32BIT_PROGRAMFILES & '\AutoIt3\AutoIt3.exe' ; You can change this to the 64 bit interpreter's path if you want Global Const $SCRIPT = "" ; Location of the .au3 file you want to run Global $iExitCode = RunWait($AUTOIT & ' "' & $SCRIPT & '"') MsgBox(0, "AutoIt Script's Exit Code", "The AutoIt Script exited with exit code " & $iExitCode) You can translate it into VB.Net and try it. (Make sure you try it out first though)
    1 point
  12. caramen

    [Solved]Auto text

    You know you just solved somthing i was stuck since.... 1 month already. 1000 Thx.
    1 point
  13. Synapsee

    [Solved]Auto text

    While your sample do "_Running()", the while is on the "Case $Boucle". So "CallCustomContextMenu()" can be done only after _Running() End. While u do "For $i = 1 To 20 sleep(100)", "_IsPressed" is not fire. You should look maybe arround AdlibRegister : #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Misc.au3> ;#Include <Restart.au3> Opt("GUIOnEventMode", 0) $dll = DllOpen("user32.dll") Global $fInterrupt = False Global $Flag = "Yes" Global $Boucle Global $Reload Global $BoucleStop Global Const $SettingsFile = @SCRIPTDIR & '\Settings.ini' $Setting1 = IniRead ($SettingsFile, 'Stats', 'Utilisation', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation',$Setting1+1) IniWrite ($SettingsFile, 'Messages', 'MessageBoucle','Message test') $MessageBoucle = IniRead ($SettingsFile, 'Messages', 'MessageBoucle', "ERROR") BuildHiddenGUI() While 1 ;~ Global $windows = WinGetTitle("[active]") Sleep ( 10 ) If _IsPressed("04", $dll) Then CallCustomContextMenu() $msg = GUIGetMsg() Switch $msg Case $Boucle WinActivate (""&$windows) ;_Running() AdlibRegister("_Running", 100); fire _Running all 100ms Case $BoucleStop WinActivate (""&$windows) AdlibUnRegister("_Running") ConsoleWrite(">Func 1 Ended" & @CRLF) Case $Reload ;_ScriptRestart() EndSwitch WEnd DllClose($dll) ;~ =========================================GUI================================================ Func BuildHiddenGUI() Global $Contextmenu, $msg, $GUI, $aTSR Global $SubMenu1, $folderitem, $programitem, $fileitem, $ConfigITEM, $otheritem Global $folderitem1, $folderitem2, $programitem1, $programitem2 $aTSR = _GetTotalScreenResolution() $GUI = GuiCreate("GUI Context Menu",1,1, $aTSR[0], 1,BitOR($WS_POPUP,$WS_BORDER),BitOr($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) WinSetTrans( $GUI, '', 1) GUISetState() $Contextmenu = GUICtrlCreateContextMenu() $Boucle = GUICtrlCreateMenuItem("Boucle", $contextmenu) GUICtrlSetOnEvent($Boucle, "_Running") $BoucleStop = GUICtrlCreateMenuItem("Boucle Stop", $contextmenu) GUICtrlSetOnEvent($BoucleStop, "") $Reload = GUICtrlCreateMenuItem("Reload", $contextmenu) ;GUICtrlSetOnEvent($Reload, "_ScriptRestart") GUICtrlCreateMenuItem("", $contextmenu) $Aide = GUICtrlCreateMenuItem("Aide", $contextmenu) EndFunc Func CallCustomContextMenu() Global $windows = WinGetTitle("[active]") Local $contextmenu, $msg Global $newsubmenu, $folderitem, $programitem, $fileitem, $otheritem Global $folderitem1, $folderitem2, $programitem1, $programitem2 Local $pos Global $GUI, $aTSR WinActivate ($GUI) ControlClick ( $GUI, "", "", "right", 1, $aTSR[0], 1) EndFunc Func _GetTotalScreenResolution() Local $aRet[2], $VirtualDesktopWidth, $VirtualDesktopHeight Global Const $SM_VIRTUALWIDTH = 78 Global Const $SM_VIRTUALHEIGHT = 79 $VirtualDesktopWidth = DllCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALWIDTH) $aRet[0] = $VirtualDesktopWidth[0] $VirtualDesktopHeight = DllCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALHEIGHT) $aRet[1] = $VirtualDesktopHeight[0] Return $aRet EndFunc ;~ ========================================================================================= ;~ ========================================While attemp================================================= Func _Running() ;For $i = 1 To 20 ConsoleWrite("-Func 1 Running" & @CRLF) ;Sleep(100) ;Next ;ConsoleWrite(">Func 1 Ended" & @CRLF) EndFunc ;==>_Running
    1 point
  14. Additional note: you can define a more subtle default timestamp using date(), time(), datetime(), julianday() or strftime() with any modifier combination suits your needs. CREATE TABLE "A" ( "Id" INTEGER NOT NULL PRIMARY KEY, "Item1" CHAR DEFAULT (datetime('now', 'localtime', '+5 minutes', '+12.3456 seconds')));
    1 point
  15. jchd

    binary to octal

    Simple: it's never useful to manipulate a string of ASCII 0s and 1s. The most compact representation low-level in common use is hexadecimal. A binary variant (= datatype) in AutoIt and every language I know of essentially means "series of bytes with no possible interpretation as text or number".
    1 point
  16. Also problems occur with the keyboard version when the number of columns has changed. Edit: I've figured out that I need to update some array variables every time I modify the number of columns. I'm making some progress. I like small snippets like these because it's easier to figure out what's going on. Edit2: After a change has occurred, calling a function, such as the one below, seems to fix some of the problems. This still needs further investigation. I have been working so much on back end code recently and hardly had time to look at anything else. ; update $aColLeftEdgePosAcc after a change has occured Func _GetColStartPos() Local $aOrder = _GUICtrlListView_GetColumnOrderArray($hListView) Dim $aColLeftEdgePosAcc[$aOrder[0]] Local $iLeft = 0 $aColLeftEdgePosAcc[0] = $iLeft For $i = 1 To $aOrder[0] $aColLeftEdgePosAcc[$aOrder[$i]] = $iLeft + _GUICtrlListView_GetColumnWidth($hListView, $aOrder[$i-1]) $iLeft = $aColLeftEdgePosAcc[$aOrder[$i]] Next EndFunc I'm still trying to figure out what every part of your code does.
    1 point
  17. Deye, Request: I am not interested in adding a progress bar, sorry. These are notifications of a specific event rather than marking an on-going process - my Toast UDF will let you do that. Report: Overriding the max width should not be a problem, but I have no idea what you mean by: as a way of setting the width. Can you explain in more detail? And I have no intention of dealing with different DPI settings - that is a user problem as far as I am concerned. M23
    1 point
  18. You can freely use full timestamps: select date('now') returns '2016-06-05' select datetime('now') returns '2016-06-05 19:00:09' (this is UTC time) select '2016-06-19' between date('now') and '2017-12-31 23:59:59' as "workday" returns 1 (true) in workday select '2016-06-19 15:27:33' between date('now') and '2017-12-31' as "workday" returns 1 (true) in workday The magic with ISO dates is that they compare in all use cases, are human-friendly and are portable accross DBMSs, OSes, languages, countries.
    1 point
  19. LOL I just spent ages incorporating some of your old code. I have made several modifications to it, but development is suffering from time constraints. What I have is way to messy to post, so I'll give you some new suggestions. You can try them because I can't commit to posting examples at the moment. You have not accounted for right aligned text. I used padding for the highlighted item to keep everything aligned either right or left. You have to get the alignment from the listview column before taking any action and reset it afterwards. I also added margins to the edit control and set alignment for this control too. It's not so difficult to implement, if you wanted to do something like this. Otherwise I will eventually get around to posting an example. Font type and size are also something to consider.
    1 point
  20. guinness

    DirCopy Usb

    Here here! Don't teach bad habits, as you are not teaching at all.
    1 point
  21. I think that was explained earlier. The People at FreeNode do not like to just let people run amok with whatever they like. They like to keep things clean. If they do not see an official approval, they won't let TheDcoder treat it like an official channel. Just renaming the channel will not be allowed. There is already a #AutoIt channel registered. It cannot be taken over unless the one trying to take it over is officially recognized. That is the whole reason for this thread; to have a place that can be seen publicly by the FreeNode admins where a post from Jon (if he chooses to do so) grants TheDcoder permission to run an official channel. I personally do not understand what people have against the way TheDcoder is handling this. TheDcoder does not want to claim official use of the AutoIt name without actually having permission to do so. He is showing respect and courtesy to the AutoIt owner, developers, and community in general. To that end, he has made a request that Jon approve his ownership/administration of an official AutoIt channel. If Jon says no, there will be some disappointed people, but Jon's wishes will be followed. If Jon says yes, then TheDcoder will administer the forum in accordance with what ever policies Jon requires. No one is wanting to take anything from Jon, from the forum, or from the community. In my opinion, we should now allow Jon to handle this as he sees fit.
    1 point
×
×
  • Create New...