Jump to content

bentom

Active Members
  • Posts

    50
  • Joined

  • Last visited

Everything posted by bentom

  1. Hi all, I'm looking for a way how to solve this probloem: I have a regestry folder video (made a screenshot of it) that contains several sub folders. Unfortunatelly these subfolders have dfifferent names on each installation and system. So my idea was to set a value in each of the subfolders no matter how the name of the subfolder is. So the resuilt should be: subfolder1 value subfolder2 value subfolder3 value . . . Is it possible to do this with an AutoIt Script? Of course there's a way to set reg values but only if you know the path of it. Thanks in advance and Regards, B
  2. Hi, I comment it out and yes it's working fine now. Thank you very much. Regards, B
  3. Hi, I used this api in lot's of scripts before and it really worked great. Now I reinstalled W7 64bit and use the latest AutoIt release v3.3.8.0. When trying to run the services.au3 there's an error. Can someone help? Regards, B C:UsersDesktopServices.au3(59,37) : ERROR: $READ_CONTROL previously declared as a 'Const'. Global Const $READ_CONTROL = 0x20000 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:UsersDesktopServices.au3(60,34) : ERROR: $WRITE_DAC previously declared as a 'Const'. Global Const $WRITE_DAC = 0x40000 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:UsersDesktopServices.au3(61,36) : ERROR: $WRITE_OWNER previously declared as a 'Const'. Global Const $WRITE_OWNER = 0x80000 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:UsersDesktopServices.au3(66,25) : ERROR: $STANDARD_RIGHTS_REQUIRED previously declared as a 'Const'. $WRITE_OWNER ) ~~~~~~~~~~~~~~^ C:UsersDesktopServices.au3 - 4 error(s), 0 warning(s)
  4. Hi, I did not find something on Timeouts when using a dllcall, perhaps someone could help. I use the mediainfo.dll to get some information on Video. The code is: $hDLL_mediainfo = DllOpen("mediainfo.dll") If $hDLL_mediainfo = -1 Then $rate="" Else ;New MediaInfo handle $Handle=DllCall($hDLL_mediainfo, "ptr", "MediaInfo_New") ;Open $Open_Result=DllCall($hDLL_mediainfo, "int", "MediaInfo_Open", "ptr", $Handle[0], "wstr", $videopath) ;Get with Stream=Video (ID1) Substream=0 (ID0) and Parameter=Framerate $framerate=DllCall($hDLL_mediainfo, "wstr", "MediaInfo_Get", "ptr", $Handle[0], "int", 1, "int", 0, "wstr", "FrameRate", "int", 1, "int", 0) $rate = $framerate[0] ;Delete MediaInfo handle $Handle=DllCall($hDLL_mediainfo, "none", "MediaInfo_Delete", "ptr", $Handle[0]) ;Close the DLL DllClose($hDLL_mediainfo) The Problem I have is this line In some cases the mediafile doen not answer and the script pauses. I want to have a timeout here that sets an upper limit of 1min. Is there a timeout funktion for dll call or a general timeout for functions in scripts? Regards, Alex
  5. Hi Again, I had a look at the other bass functions but I did not found afunction. Does anybody here played with this? Thanks and Regards, A
  6. Hi, I'm looking for a small script that can show if there's an audio output (e.G. System Sound), I found the bass.dll and also some other topics on it but none worked on my W7 32bit machine. I do not want to know the level or spectrum I just want to know if there's a level on master volume or not. Does anybody here have an idea how to do that. In the bass.au3 i did not find a proper funktion for it. Thanks in advance and Reagrds, A
  7. Hi, i Have a problem here which I would like to solve with help of AutoIT. Perhaps there's a possibility and someone knows how to start. Attached is a screenshot (In German but should be the sama in English OS). The Problem is that after attaching a new keyboard or mouse the Setting is defined automatically that it can awake the computer. The result is that the system starts up though it is not wanted. When disabling it it works but changes back after attaching a new keyboard or mouse. Is it possible to modify this setting. I would then run this script after reboot. Regards, B
  8. Hi, @Manadar: Thank you: This works perfect. Regards, B
  9. Hi again, sorry for asking again. My Remote is hard Coded to the 0-9 keys. There's no possibility to change it to the numpad keys. So I have to use it instead od numkeys. What I did is to change the hotkeyset from numbad to number keys which looks like ; definitions of keys to push. They go from 0-9 based on displayed order. Local $sms[10] = [" 0", "1.,?!'", "abc2ä", "def3", "ghi4", "jkl5", "mno6", "pqrs7", "tuv8", "wxyz9"] Local $timer Local $lastSentKey ; Set all keys 0 to 9 as the hotkey to the same function For $i = 0 To 9 $key = String($i) HotKeySet($key, "HotKeyHandler") ; If you want to use this, then also check out comment in _SendKey Next While 1 Sleep(500) WEnd Func HotKeyHandler() ; Get real key that is pressed. For {NUMPAD7} the expected result is 7 $pressedKey = @HotKeyPressed If StringInStr($pressedKey, "NUMPAD") Then $pressedKey = StringMid($pressedKey, 8, 1) EndIf ConsoleWrite("Key pressed: " & $pressedKey & @CRLF) ; Time out on last key sent If TimerDiff($timer) > 800 Then ; Last sent key no longer counts $lastSentKey = "" ; Simple route, just send left most key _SendKey(StringLeft($sms[$pressedKey], 1), $sms[$pressedKey]) Else ; If the last key sent is in the part for the current key, then pick the next If StringInStr($sms[$pressedKey], $lastSentKey) Then Send("{BACKSPACE}") $n = StringInStr($sms[$pressedKey], $lastSentKey) + 1 _SendKey(StringMid($sms[$pressedKey], $n, 1), $sms[$pressedKey]) Else ; Otherwise normal route _SendKey(StringLeft($sms[$pressedKey], 1), $sms[$pressedKey]) EndIf EndIf EndFunc Func _SendKey($key, $keyGroup) $lastSentKey = $key Send($key) $timer = TimerInit() $n = StringInStr($keyGroup, $key)-1 $show = StringLeft($keyGroup, $n) & "[" & $key & "]" & StringTrimLeft($keyGroup, $n+1) ToolTip($show) EndFunc The Problem now is that it does not work lieke the version with numpad keys and I do not find out why. If entering the number then all letters are set as they should but then there's a backspace after the last letter. Moreover sfter starting the script the 0 does not work. Perhaps someone has an idea. Thank you again Regards, B Edit: I read the comment: ; If you want to use this, then also check out comment in _SendKey but this did not change it and I think this is only importnat if using numbad and numbers, is it?
  10. Hi, perhaps anyone of you is using XBMC which can be found on xbmc.org I found The JSON RPC site on XBMC Wiki and all the possibilities to communicate with XBMC. http://wiki.xbmc.org/index.php?title=JSON_RPC Can anybody here help me to initiate a connection to the Interface so that I can experience with the different methods. I think this should work equal to a COM Interface. Thanks a lot and regards, B
  11. Thank you so much for help and support. I tried and tested the code you wrote for this and it works almost perfectly :-) Great. I do not really understand all steps but try to get deeper the next days. One thing I found is that the characters are deleted after finishing one Groüp. Menas e.g. if you press 2 then a,b,c,2 appears and then backspace which deletes of course the last character. Is it possible not to do this but repeat again the characters? Regards, B
  12. Thank you very much. Very nice. I tried it about 2 hours now but didn't get it. Regrads, B
  13. Hi again, thank you so much for the input. Now I tried to do it for all numkeys. The code I have yet is this. I have the problem that i cannot give the proper key to the fuction. Can someone help. Thank you again :-) Regards, B Local $timer Local $lastSentKey dim $sms[10][10] $SMS[0][0] = 2 $SMS[0][1] = "{SPACE}" $SMS[0][2] = "0" $SMS[1][0] = 5 $SMS[1][1] = "." $SMS[1][2] = "," $SMS[1][3] = "?" $SMS[1][4] = "{!}" $SMS[1][5] = "'" $SMS[2][0] = 5 $SMS[2][1] = "a" $SMS[2][2] = "b" $SMS[2][3] = "c" $SMS[2][4] = "2" $SMS[2][5] = "ä" $SMS[3][0] = 4 $SMS[3][1] = "d" $SMS[3][2] = "e" $SMS[3][3] = "f" $SMS[3][4] = "3" $SMS[4][0] = 4 $SMS[4][1] = "g" $SMS[4][2] = "h" $SMS[4][3] = "i" $SMS[4][4] = "4" $SMS[5][0] = 4 $SMS[5][1] = "j" $SMS[5][2] = "k" $SMS[5][3] = "l" $SMS[5][4] = "5" $SMS[6][0] = 4 $SMS[6][1] = "m" $SMS[6][2] = "n" $SMS[6][3] = "o" $SMS[6][4] = "6" $SMS[7][0] = 5 $SMS[7][1] = "p" $SMS[7][2] = "q" $SMS[7][3] = "r" $SMS[7][4] = "s" $SMS[7][5] = "7" $SMS[8][0] = 4 $SMS[8][1] = "t" $SMS[8][2] = "u" $SMS[8][3] = "v" $SMS[8][4] = "8" $SMS[9][0] = 5 $SMS[9][1] = "w" $SMS[9][2] = "x" $SMS[9][3] = "y" $SMS[9][4] = "z" $SMS[9][5] = "9" HotKeySet($i, "SendKey) ;HotKeySet("{NUMPAD0}", "SendKey0") While 1 Sleep(500) WEnd Func SendKey() If TimerDiff($timer) > 800 Then $lastSentKey = "" EndIf Switch $lastSentKey Case $SMS[$i][1] Send("{BACKSPACE}") _send($SMS[$i][2]) Case $SMS[$i][2] Send("{BACKSPACE}") _send($SMS[$i][3]) Case $SMS[$i][3] Send("{BACKSPACE}") _send($SMS[$i][4]) Case $SMS[$i][4] Send("{BACKSPACE}") _send($SMS[$i][5]) Case Else _send($SMS[$i][1]) EndSwitch EndFunc Func _send($key) $timer = TimerInit() Send($key) $lastSentKey = $key EndFunc
  14. Thank you very much for your answers. I just started the code. Unfortunatelly I have some problems with it. Attached you find my code. It would be perfect if someone colud help me with the function and timer. I'n not a specialist :-) Hopefully it's not that worde. It would help ti have one example the others of course I can add myself Regards, B #include <array.au3> dim $sms[9][5] $SMS[0][0] = 2 $SMS[0][1] = "{SPACE}" $SMS[0][2] = "0" $SMS[1][0] = 5 $SMS[1][1] = "." $SMS[1][2] = "," $SMS[1][3] = "?" $SMS[1][4] = "{!}" $SMS[1][5] = "'" $SMS[2][0] = 5 $SMS[2][1] = "a" $SMS[2][2] = "b" $SMS[2][3] = "c" $SMS[2][4] = "2" $SMS[2][5] = "ä" $SMS[3][0] = 4 $SMS[3][1] = "d" $SMS[3][2] = "e" $SMS[3][3] = "f" $SMS[3][4] = "3" $SMS[4][0] = 4 $SMS[4][1] = "g" $SMS[4][2] = "h" $SMS[4][3] = "i" $SMS[4][4] = "4" $SMS[5][0] = 4 $SMS[5][1] = "j" $SMS[5][2] = "k" $SMS[5][3] = "l" $SMS[5][4] = "5" $SMS[6][0] = 4 $SMS[6][1] = "m" $SMS[6][2] = "n" $SMS[6][3] = "o" $SMS[6][4] = "6" $SMS[7][0] = 5 $SMS[7][1] = "p" $SMS[7][2] = "q" $SMS[7][3] = "r" $SMS[7][4] = "s" $SMS[7][5] = "7" $SMS[8][0] = 4 $SMS[8][1] = "t" $SMS[8][2] = "u" $SMS[8][3] = "v" $SMS[8][4] = "8" $SMS[9][0] = 5 $SMS[9][1] = "w" $SMS[9][2] = "x" $SMS[9][3] = "y" $SMS[9][4] = "z" $SMS[9][5] = "9" dim $begin, $dif, $i $i = 0 HotKeySet("2","two") while 1 WEnd Func two() ConsoleWrite($i & " " & $dif & @LF) $i = $i + 1 HotKeySet("2") if $i = 1 then $begin = TimerInit() Send($SMS[2][$i]) Else $dif = TimerDiff($begin) if $dif < 1000 Then Send($SMS[2][$i]) $begin = TimerInit() Else Send($SMS[2][$i-1]) $i = 0 EndIf EndIf HotKeySet("2","two") endfunc
  15. Hi all, perhaps someone has an idea or did something like this before and can help me. I want to write a little script that translates numbers [0-9] into keys. (Like on Mobile Phone). The idea behind is to have a possibility to use my remote control for internet browsing on my HTPC. To give an example: You send an "2" via remote and an A appears. By repeating the "2" within 1sec it changes to B and so on. I think the best way would be with hot keys. Did somebody here this before? Regards, B
  16. Hi, at first: Thank you so much for your help and support. Didn't expect that :-) And yes it works, I get an array out that includes all the possible values. So the first big step is done and I can continue with my script. Thank you so much for this. Regards, Alex
  17. Hi there, thank you all very much fopr answering. @Mat: Wow thats huge. But unfortunatelly I do not really know how handling this. @WMI: Intersting. But your code does not display anything. This probably has to do with differnet OS Versions (I use W7 Ultimate GErman), I guess. The point why I wanna using this tool is because it is done by developpers who know what they are doing. Unfortunatelly I'm not one of these :-) So this would be my choice. I tried it with dim $monitornumber, $Switchwidth, $Switchheight, $Switchrefresh $monitornumber = 1 $Switchwidth = 1920 $Switchheight = 1080 $Switchrefresh = 60 run('dc.exe -quiet -monitor="\\.\DISPLAY' & $monitornumber &'"' & " -width=" & $Switchwidth & " -height=" & $Switchheight & " -refresh=" & $Switchrefresh,) This perfectly works :-) for switching the resolution etc. Then I tried: $modes = run('dc.exe -quiet -listmodes msgbox(4096,"",$modes) which returns an number. Anybody an idea? Regards, Alex
  18. Hi all, there's a small tool called displaychanger from 12noon (http://www.12noon.com/displaychanger.htm) which can switch to a specific resolution or refresh rate. With the option dccmd.exe -listmodes it also returns all available modes which would help me a lot for a script. The problem for me is that I cannot access the return value that the displaychanger gives back. Does anybode here have an idea if it is possible. I did not find an answer via search but perhaps somebody here has made experience with this tool Thanks and Regards, B
  19. Hi again, just for your information. With the winsetstate it does not work either, so i tried to start the application with a batch file with start /min app. And this works :-) Regards A
  20. Hey, thank you very much for the help. The winsetstate would be a possible solution - thanks. I will try that. Regards, A
  21. Hey, a question regarding the run function. There's a flaq that can open a application minimized. That works for most of applications. In this special case it doesn't. It starts the same way like you do not add the flag. My question would be: Is there a second way to open an application minimized, cause windows itself can open it minimized (When using the a desktop link and set it to minimize) Thanks a lot and regards, Alex
  22. Hi, a question regarding the version of AutoitScript. I know the function FileGetVersion() which checks the AutoIT Version which the script was compiled with. Fine. But what I need is 1) To write my own file Version of script in the header and then 2) Reat this out. Is there any way to to this? Thanks and Regards, Ben
  23. Hi, thank you for your answer but exactly this thread I had been read before. That was the reason why I wrote:"I want to hide the task bar with it. I know there's a possibility by Controlhide but this is unfortunately not working for every case." Does anybody have another idea Thanks in adnvance and Regegrads, Alex
  24. Hi there, a question to all who have experience with the winapi. I want to hide the task bar with it. I know there's a possibility by Controlhide but this is unfortunately not working for every case. E.G. when starting a DiaShow with a photo viewer (in full screen) and the stopping it the task bar shows again. The author of the Pictureviewer told me to use the funtion: ShowWindow(FindWindow("Shell_TrayWnd",""),SW_HIDE); Is it possible to use it in Auto-IT Thanks in advance and Regards, Alex
  25. Hi, I used the commandline interface of Nvidia to get some graphic parameters and control resolution etc. With Vista and W7 it is no longer available. But there's a new API, Nvidia released in 2008. I found it here: http://developer.nvidia.com/object/nvapi.html As I'm not a professional developer It was not possible for me to find out how to handle simple calls like changing the resolution, frequency etc. I know there's lot of other tools (e.g. displaychanger) that can do it but in some cases it fails. The native driver would be the best possibility I think and so my question would be if anybodies's here who did some scripting with it before or couild help me with some simple calls. Thank you very much and Regards, Alex
×
×
  • Create New...