Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/19/2013 in all areas

  1. Burnek662, You can detect a doubleclick on a list item like this: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <Constants.au3> Global $GUI = GUICreate("Kulinarne przepisy", 293, 294, 302, 218) Global $Przepisy = GUICtrlCreateList("xd", 0, 0, 153, 292) GUICtrlSetData($Przepisy, "Skasuj Mnie|") $Skasuj = GUICtrlCreateButton("Skasuj", 160, 146, 129, 49) $Dodaj = GUICtrlCreateButton("Dodaj", 160, 90, 129, 49) $cDblClk = GUICtrlCreateDummy() ; Create dummy control <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUISetState(@SW_SHOW) GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") ; Register handler to detect double click <<<<<<<<<<<<<<<<< While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Dodaj Dodaj() Case $Skasuj If Not GUICtrlRead($Przepisy) = "" Then $DoSkasownia = _GUICtrlListBox_FindInText($Przepisy, GUICtrlRead($Przepisy)) _GUICtrlListBox_DeleteString($Przepisy, $DoSkasownia) EndIf Case $cDblClk ; Dummy control fired <<<<<<<<<<<<<<<<<<<<<< $sText = GUICtrlRead($cDblClk) ; Get text <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< MsgBox($MB_OK, "DoubleClicked", $sText) ; Display it <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EndSwitch WEnd Func Dodaj() Local $GuiDodaj = GUICreate("Dodawanie przepisu", 267, 357, 192, 124) GUICtrlCreateLabel("Podaj nazwe przepisu:", 64, 8, 139, 22) GUICtrlSetFont(-1, 10, 400, 0, "Comic Sans MS") $Nazwa = GUICtrlCreateInput("", 0, 32, 265, 21) GUICtrlCreateLabel("Tutaj daj przepis:", 72, 64, 113, 22) GUICtrlSetFont(-1, 10, 400, 0, "Comic Sans MS") $Przepis = GUICtrlCreateEdit("", 0, 88, 265, 225) GUICtrlSetData(-1, "Przepis") $Koniec = GUICtrlCreateButton("Dodaj!", 49, 320, 169, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($GuiDodaj) Return Case $Koniec GUICtrlSetData($Przepisy, GUICtrlRead($Nazwa) & "|") GUIDelete($GuiDodaj) Return EndSwitch WEnd EndFunc ;==>Dodaj Func _WM_COMMAND($hWnd, $msg, $wParam, $lParam) Local $nCode = BitShift($wParam, 16) ; HiWord Local $nIDFrom = BitAND($wParam, 0xFFFF) ; LoWord Switch $nIDFrom Case $Przepisy Switch $nCode Case $LBN_DBLCLK $sListItem = GUICtrlRead($Przepisy) ; Read selected item <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSendToDummy($cDblClk, $sListItem) ; Send the text to the dummy control and fire it <<<<<<<<<<<<<<<<<<< EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_WM_COMMAND All clear? M23
    2 points
  2. Jon

    AutoIt v3.3.9.8 Beta

    File Name: AutoIt v3.3.9.8 Beta File Submitter: Jon File Submitted: 18 Jul 2013 File Category: Beta Special thanks to guinness and co for the crazy amount of work done on the helpfile and UDFs. 3.3.9.8 (18 July, 2013) (Beta) AutoIt: - Added: Documentation for IsFunc(). - Changed: Rewritten some Variant/UserFunction internals. - Changed: FileCreateShortcut() will automatically convert paths so relative paths will continue to work on Windows 8. - Fixed: WinXP RTM support should be fixed...again. - Fixed: Some memory leaks when converting between unusual variant types like Keywords. UDFs: - Added #2357: $WM_SIZING back to WindowsConstants.au3, which was removed during the WinAPIEx integration. - Added #2338: Regular expression pattern matching. Please see the documentation of _ArraySearch for more details. - Added #2340: Optional parameter to _GUICtrlListView_SimpleSort of whether or not to reverse $vSortSense (previously $vDescending.) - Added: _FileListToArrayRec to the UDFs. A recursive file search by Melba23. Please see the documentation for more details. - Changed: Re-wrote _StringReverse by removing the use of msvcrt.dll. - Changed: Re-wrote _ProcessGetName for speed enhancements. - Changed: Re-wrote _PathSplit by using a regular expression. Contibuted by DXRW4E. - Fixed: _ScreenCapture_Capture was broken. - Removed: Documentation and example for _StringEncrypt. Scripts should be updated to use the Crypt functions instead. Look at _Crypt_EncryptData() for an alternative example. - Removed: Function headers in the UDFs, as information about the function can be found in the help file, This removal resulted in a 37% size reduction to the includes folder (7.01MB ->> 4.40MB). Click here to download this file
    1 point
  3. oapjr, Great, I'm glad you found a solution! Anonymous
    1 point
  4. Jos

    Get Process Closed Event

    OnAutoItExitRegister ?
    1 point
  5. water

    PowerPoint Wrapper

    Which version of AutoIt do you run? Which version of PowerPoint do you run?
    1 point
  6. oapjr, I would try and move each file before sending the play next song command, if you fail to move the file then that file is being played, otherwise move the file back and try the next. Dim $aMusic = _GetMusicFilesFromArray($aFiles) Dim $sSongPath = _GetSongBeingPlayed($aMusic) Func _GetSongBeingPlayed($aMusic) For $i = 1 To $aMusic[0] Step 1 If FileMove($aMusic[$i], @TempDir & "\TemporayFileName.any") Then FileMove(@TempDir & "\TemporayFileName.any", $aMusic[$i]) Else Return $aMusic[$i] EndIf Next EndFunc Func _GetMusicFilesFromArray(ByRef $aFiles, $iStart = 1) Local $aPath, $szDrive, $szDir, $szFName, $szExt, $iUbound = UBound($aFiles, 1), $aMusic[$iUbound] For $i = $iStart To $iUbound - 1 Step 1 $aPath = _PathSplit($aFiles[$i], $szDrive, $szDir, $szFName, $szExt) If StringRegExp($aPath[4], "(mp3|wav|ogg|wma)") Then $aMusic[0] += 1 $aMusic[$aMusic[0]] = $aFiles[$i] EndIf Next ReDim $aMusic[$aMusic[0]+1] Return $aMusic EndFunc Also I would try using the updated code from here --> '?do=embed' frameborder='0' data-embedContent>> Edit - The code doesn't work! I tested this and FileMove always returns success. Anonymous
    1 point
  7. guinness

    AutoIt v3.3.9.8 Beta

    No. As that was an Alpha preview and any features were subject to change.
    1 point
  8. @Melba23 It crashes with the stable version 3.3.8.1 but not with the beta one. He is using your code.
    1 point
  9. If you had searched in the forum with the keywords "list double click" you would have found a few topics with the solution as Melba23's just gave you. Here is your cleaned code : #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #region GUI Local $hGUI = GUICreate("Kulinarne przepisy", 293, 294, 302, 218) Global $iListPrzepisy = GUICtrlCreateList("xd", 0, 0, 153, 292) GUICtrlSetData($iListPrzepisy, "Skasuj Mnie|") Local $iBtnSkasuj = GUICtrlCreateButton("Skasuj", 160, 146, 129, 49) Local $iBtnDodaj = GUICtrlCreateButton("Dodaj", 160, 90, 129, 49) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState(@SW_SHOW, $hGUI) #endregion Local $iDoSkasownia = 0 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $iBtnDodaj Dodaj() Case $iBtnSkasuj If GUICtrlRead($iListPrzepisy) <> "" Then $iDoSkasownia = _GUICtrlListBox_FindInText($iListPrzepisy, GUICtrlRead($iListPrzepisy)) _GUICtrlListBox_DeleteString($iListPrzepisy, $iDoSkasownia) EndIf EndSwitch WEnd GUIDelete($hGUI) Func Dodaj() Local $iInputNazwa = 0, $iEditPrzepis = 0, $iBtnDodaj2 = 0 Local $hGUIDodaj = GUICreate("Dodawanie przepisu", 267, 357, 192, 124) GUICtrlCreateLabel("Podaj nazwe przepisu:", 64, 8, 139, 22) GUICtrlSetFont(-1, 10, 400, 0, "Comic Sans MS") $iInputNazwa = GUICtrlCreateInput("", 0, 32, 265, 21) GUICtrlCreateLabel("Tutaj daj przepis:", 72, 64, 113, 22) GUICtrlSetFont(-1, 10, 400, 0, "Comic Sans MS") $iEditPrzepis = GUICtrlCreateEdit("", 0, 88, 265, 225) GUICtrlSetData($iEditPrzepis, "Przepis") $iBtnDodaj2 = GUICtrlCreateButton("Dodaj!", 49, 320, 169, 33) GUISetState(@SW_SHOW, $hGUIDodaj) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($hGUIDodaj) Return Case $iBtnDodaj2 GUICtrlSetData($iListPrzepisy, GUICtrlRead($iInputNazwa) & "|") GUIDelete($hGUIDodaj) Return EndSwitch WEnd EndFunc ;==>Dodaj Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) Local $iIDFrom = 0, $iCode = 0 $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word Switch $iIDFrom Case $iListPrzepisy Switch $iCode Case $LBN_DBLCLK ConsoleWrite("Item double clicked: " & GUICtrlRead($iListPrzepisy) & @CrLf) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFYBr, FireFox.
    1 point
  10. vis, Think again - no-one who has posted in this thread can work out what it is you want to do! As I stated above, there is no reason why the various code structures with which you have have provided do not parse or do not work as you wish. If you are unwilling to provide the rest of the script in which this code sits - and which must be the cause of the problem - then there is very little point in continuing. We need to see a runnable script - rather than snippets of functions and random error messages which purport to tell us that AutoIt cannot parse perfectly good code lines - or we might as well stop wasting Jon's bandwidth. So either you post a full runnable script showing exactly how you use this _ConfirmBeforeSubmit function or I will close the thread. If you will not help us to help you, then you deserve no help - clear? M23
    1 point
  11. JohnOne

    Adding 10 minutes

    Or Just _DateDiff()
    1 point
  12. TxTechie, You may have to FileInstall a seperately compiled script but you should be able to create a process on the default windows station which is user interactive. I don't know about the security/detection thats being mentioned but procesess inherit privileges from their parent process and the Window StationDesktop their created on unless you use WinAPI_CreateProcess to specify the desktop to be used during process creation. What I'm getting at is that you should be able to spawn a child process on the default desktop("Winsta0default") even if your service is running on a non-interactive window station like most services do. I'll post example usage later on just incase you'd like to put the theory to the test. Anonymous
    1 point
  13. I should also make this clear that this works with PROPERTIES (and probably fields). AIO properties have this form: _AutoItObject_AddProperty($o,"_Left",$ELSCOPE_PRIVATE,False); A private property backer (ie field), use as required _AutoItObject_AddMethod($o,"Left","Left__ButtonStyle",True); True means public ; A property is really a function, needs $me and a second param with a default, ; the code makes it so the default VALUE (ie False) is never used by checking @NumParams ; Func Left__ButtonStyle($me,$value=False); ButtonStyle is the name of the class, I like to put it last, not first If @NumParams=2 Then ; we are assigning, hence default VALUE has been given, ; so we never see False unless it is given via $o.Left=False $me._Left=$value; Comment out this line for a readonly property, or put in some execute-on-assignment code Else ; we are being read Return $me._Left; return the backer, else put in some computational code that returns a value EndIf EndFunc ;;; Usage $o.Left=10 ;assign $val=$o.Left ; read
    1 point
  14. Artisan

    Problem with complie

    I've had this problem too, and my solution is to to close SciTE and right-click the .au3 and select a compile option from there.
    1 point
  15. water

    IIS Automation via COM

    You could use Powershell Cmdlets and automate them by using the >AutoIt-PowerShell-COM interface.
    1 point
  16. Mat

    Report Help File Issues Here

    It's an operator, as it does have a precedence value. For example, look at this code: Local $Foo = 1 == 2 ? 1 : 0 Local $Foo2 = (1 == 2) ? 1 : 0 The two statements differ because the precedence of ? is higher than ==, so $Foo will be True, but $Foo2 will be 0.
    1 point
×
×
  • Create New...