Jump to content

Mikesch

Active Members
  • Posts

    30
  • Joined

  • Last visited

Profile Information

  • Location
    Germany

Mikesch's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks, but this is not about debugging the code I have, it works fine. I just want to know how I can get the name of the device which is selected after the script has done its job. Maybe reading a registry key or the like. The dialog is not very talkative ;-) Mike
  2. Sure. It doesn't even try to read the device name yet, it just does the switching. Anyway, it works with Win 7, (32 & 64) ;select Audio Device from device list; 0-based $ref = 0 ;selects 1st sound device, 1=second device... $SoundPID = Run("control mmsys.cpl") Global $hWnd $aWinList = WinList() For $i = 1 To $aWinList[0][0] If WinGetProcess($aWinList[$i][0]) = $SoundPID Then $hWnd = $aWinList[$i][1] ExitLoop EndIf Next WinWait($hWnd, "") Sleep(300) ControlListView($hWnd, "", "SysListView321", "Select", $ref) Sleep(300) ControlClick($hWnd, "", "Button2") ControlClick($hWnd, "", "Button4") Regards, Mike
  3. I'd like to know if there's a method of retrieving the current sound output device in Win 7. It's easy in Win XP, but the dialog boxes in Win 7 are not that accessible, at least not for me (or the Au3InfoTool). I made two scripts which simply select the first/second device in the list. That works fine, but I'd like to add a small tooltip which displays the new selection. Thanks in advance, Mike
  4. Oh, re-reading the script I think the problem occurs because I launch the function by hotkey, so the problem is not within the function itself, but in the way it is called. Thanks, you helped me very much. "Main Loop" was the correct keyword. Regards, Mike EDIT: Got me! ;-) Even before I did. Crystal ball functioning properly. Thanks again. Mike
  5. Hi billo, thanks for your reply. I know your code would work, and I even don't have issues when using F-Keys with _isPressed(), but in this case the function should really only run as long as the defined key ("z") is held down. (The 100 ms delay is crucial, too.) Send("x") and 'y' will be replaced later, probably with some ControlSend() commands I need for video cutting. While testing I came about that strange behaviour and still can't see what I'm missing. Mike
  6. Hi, the following will work fine for about 2 seconds, sending "x" and "y" alternating, then output will be sorted. So if I press the defined $hotkey for some seconds, I'll end up with something like xyxyxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyy. Guess it has to do with the keyboard buffer or message queuing, but I can't find out why this would happen or how to avoid it. Could you point me to the right direction, please? Func Sendkeys() While _IsPressed($hotkey, $dll) = 1 Send("x") sleep(100) Send("y") sleep(100) WEnd EndFunc ;==>Sendkeys Thanks, Mike
  7. Apologies, I was mistaken here. But there's still a problem, I suppose. Lets say we got a 100x100 rectangle, and the first match would be at x,y = 98,0 then the next searched rectangle would be 98,0 to 98,100 How about a possible match at e.g. 37,50? Maybe I still don't get it right, blame it on the time, I should get myself some sleep now... Regards, Mike
  8. Hi, I got a program which displays its output on the screen by writing a .html file into the temp folder and then launching the default browser. As I need a Screenshot of the output, I grab the html file in an embedded IE window in my own GUI to prevent zooming issues. Works nicely. Only flaw is the browser window being left open with the above html content. Do you see any way to either close the freshly created browser tab immediately or, preferrably, (temporarily) suppress loading the html-file into the browser at all? The latter would be first choice, as it would work on any system regardless of the default browser. As an alternative, can you think of a way of getting the screenshot without affecting the default browser. Hope you can point me to a solution. Thanks in advance! Mike (Closing the browser completely would of course be simple, but in case the user has alredy opened a browser with several tabs, it might be quite annoying, so i don't want to go this way.
  9. Dim $X = 0, $Y = 0 DO $coord = PixelSearch($X, $Y, 1280, 1024, 0xFF00FF, 50) If Not @error Then MsgBox(0, "Results", "X = " & $coord[0] & " Y = " & $coord[1]) $X = $coord[0] $Y = $coord[1] EndIf UNTIL $X >= 1280 OR $Y >= 1024 I can't see how that would increase the x and y value. Would it? If it would increas x AND y at the same time, it would only test a diagonal line, right? Or am I completely mistaken here? Mike
  10. If you could attach the script or at least post some lines of your code we'd sure do our best to help you sort it out. Error codes alone usually aren't very helpful because they can come up for a variety of reasons.
  11. For quite a while now, I've been working on a script which should allow to set the backlighting of Logitech's G19 keyboard. I started with getting the average colour from the desktop and setting that value to the keyboard, then expanded it to get the colour from VLC, if it's running and apply that. And it even works nicely. Next step was a script which would get the colour from the pixel under the mouse pointer and apply that colour. This was an easy step then. But: The only way (I could make out) to set the values is by launching the trackbar window for Colour adjustment in the keyboard driver itself. That was still quite easy, as the key profiler is constantly active in the tray bar and has the effect of giving a fine smooth colour change, but of course for the price of having the sliders on top. I recently tried to hide the process. Even that works well. Only thing I could not overcome so far is two of the controls flashing up for a moment. There's one of the controls of which I can't get any information but a handle, and I can't think of another method to control it. The other control is the trackbar window itself, which I set transparent after it exists and once I got its handle. Maybe there are way better ideas, but I haven't done many more complex scripts yet. Any suggestions in making this script work completely 'in stealth mode' would be most welcome. The essential code snippet is: WinActivate("Logitech G-series Key Profiler") ;will launch that strange control with will at least provide a handle now. ControlClick("Logitech G-series Key Profiler", "", "Button19") ;wait for control window to exist, glad I got the class now $hWnd2 = WinWait("[CLASS:#32768]") ;make it transparent immediately WinSetTrans($hWnd2, "", 0) ControlSend($hWnd2, "", "", "{UP}") Sleep(5) ControlSend($hWnd2, "", "", "{ENTER}") Sleep(30) ;(have to do it that way as options there don't seem to be accesible otherwise, without MouseClick() ;Launch slider control now: $tWindow = WinGetTitle("[ACTIVE]") $hWnd = WinGetHandle($tWindow, "") WinSetTrans($hWnd, "", 0) The complete script ist attached. If you're owning a G19 (or a G13, too) you may want to look at this thread at G15forums.com exp_Colour_set.au3
  12. And don't forget to #include <GuiConstants.au3> if you try hot202's example in a new window. If you want the main GUI to close when the second one is shown, use: #include <guiconstants.au3> $gui1 = GUICreate("Test", 500, 500) $Button_1 = GUICtrlCreateButton("Quicktime", 10, 30, 100) GUISetState(@SW_SHOW, $gui1) $gui2 = GUICreate("Test2", 300, 200) GUISetState(@SW_HIDE, $gui2) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 GUISetState(@SW_HIDE, $gui1) GUISetState(@SW_SHOW, $gui2) EndSelect WEnd
  13. $PID = ProcessExists("Program.exe") msgbox(0,"",$PID) $ver = FileGetVersion($PID) MsgBox (0,'',$ver)
  14. Ok, wish you success then. For the intended purpose, I suppose extensive testing will be reqired using _any_ method to make yourself feel good. Regards, Mike
  15. I see. Just a short personal "report". I've been using some scripts for quite a long time on my video PC, too, which is basically a PVR and a streaming server. Some applications on that machine are also Java-based. As long as you make sure the Java application is the active window before sending MouseClick(), I think you won't have to get too nervous about reliability, at least not on a PC which usually isn't touched by users changing active windows manually. But of course it's different if you have to fill out controls which would require text input or the like. regards, Mike
×
×
  • Create New...