
daanodinot
Active Members-
Posts
26 -
Joined
-
Last visited
Everything posted by daanodinot
-
Click on folder and play video within it
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
Exactly! Exactly! You heard me right the first time. :-) Double-clicking on the folder to play the file inside it would also be acceptable. If it is any more complicated than that, it's probably not worth it. -
Click on folder and play video within it
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
What if I directly linked this to the "VLC media player - Play" option in the context menu? That seems to be the most simple and elegant solution. Would I be able to assign a simple keyboard shortcut to an option in the context menu? -
I have a number of subfolders in a folder, each containing one video and some related files. I'd like to be able to click once on each subfolder and play the video within it immediately. Kind of like the behavior of right-clicking on the folder and selecting "VLC media player - Play" from the context menu, only with one click. I'd also like to preserve the possibility of actually entering the folder, which could be achieved i.e. by pressing a keyboard key while clicking or event better, double clicking. I'll probably create a keyboard shortcut to run the script in the background since I only want this behavior for the subfolders in a certain folder and don't want have script running all the time to check whether I've entered this folder. You don't have write the complete code for me (although you may) but some advice on where to look and some parameters of what is possible would be appreciated! Thanks in advance!
-
Do you mean something like this: Run($VLCPath & " --snapshot-path=" & $SnapPath & " " & $FilePath, "", @SW_MINIMIZE) Unfortunately, this still doesn't work...
-
I'd like to have VLC media player run minimized. I'm using this to run VLC: Run("cmd /c vlc --snapshot-path=" & $SnapPath & " " & $File, $WorkDir, @SW_HIDE) The @SW_HIDE at the end hides the command window itself but not the program that is started, VLC. I might be able to use something like this to minimize the window: WinWait("[CLASS:QWidget]") WinSetState("[CLASS:QWidget]", "", @SW_MINIMIZE) But this doesn't work, and it doesn't feel really satisfying either. Is there a good solution to start VLC minimized? Thanks in advance.
-
Question on array functions
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
Ok, thanks. Good to know, I like simple -
Hi, I was not sure how to title this topic, so if you have a better title, feel free to rename it. Say, that I have this function: Func Pos(ByRef $Item) Local $Pos[2] $Pos[0] = Floor(($Item)/10)*76+38 $Pos[1] = Mod($Item,10)*105+30 Return Pos EndFunc Would it be possible to use this function directly as an array, doing something like: Pos(1)[0] Thanks in advance!
-
Thanks. Yes, I know that can be done, but then I still prefer to do it via the interface directly using the Send function. Unless, of course I can let Windows read the registry key without restarting explorer but my guess is that, that is impossible.
-
Thank you. Yes, all the setings are present in [HKEY_CURRENT_USERSoftwareMicrosoftWindowsShellBags1Desktop] But the difficulty for me, is how I can have Windows read or write to this key. By default, this key is read when explorer.exe is loaded, and, strangely, it is only written to when the user logs off.
-
Thanks for your reply! Hmm.. The class of the desktop control is "SysListView32", but perhaps that's different than a 'listview'. Is there something else I could use to sort desktop icons? EDIT @guinness Right... so would it be possible to use a sorting function for the desktop?
-
I've Ctrl+F'd through the source, but there was no mention of "sort". But Surely, it shouldn't that be hard.. I've tried something like this: Global $fSortDescending = False _GUICtrlListView_SimpleSort($ListView, $fSortDescending, 0) But instead of sorting, a particular icon on the desktop gets selected, nothing is moved. If you put it in a loop, different icons get selected one by one, in no particular order.
-
Hi, I'm wondering how I would be able to sort desktop icons, say by name. This is the handle of the desktop control: $ListView = ControlGetHandle("Program Manager", "", "SysListView321") But then how do I sort the icons? I've looked into the RegisterSortCallBack, SortItems and SimpleSort, and I've tried to use them according to the examples, but without any luck (i.e. nothing happens). I hope somebody can help me out.. Thanks in advance!
-
I'm trying to create a script that executes the 2 actions "Group by" and "Collapse all groups", for when I'm in the "Recycle Bin". This way, I can immediately see from what different paths I'm removing any files. I've already made a script that utilizes keyboard keys, but now I'd like make one that directly edits the registry. All of the registry edits related to these actions, can be made in one key: HKEY_USERS[user Name]SoftwareClassesLocal SettingsSoftwareMicrosoftWindowsShellBags[# of recycle bin]Shell[iD of recycle bin] The parts between [] are different per person. "[iD of recycle bin] is in my case "{D6D9E004-CD87-442B-9D57-5E0AEB4F6F72}" but I'm afraid this is not always the case. "[# of recycle bin]" will be "1" if you delete the whole "Bags" key and you open the recycle bin first - so that's one way to find the right bag. There are 3 values inside the key that control the first action "Group by". By editing these values you can control, based on what the files are grouped and whether they're grouped at all. I've already done this action so I won't go further into this. The value "GroupCollapseState" controls the action "Collapse all groups" and contains binary data containing each group name/path and whether the group is collapsed or expanded. Two points about the 'behavior' of this registry value: - The value is only re-read when you re-open the recycle bin, not when you're still inside it. (This is also applies to the other 3 mentioned values.) - The value is only updated when you explicitedly perform an action that either collapses or expands 1 or more groups. If you just move a file to the recycle bin and let Windows figure out the default collapsed state nothing will change inside the value! If the recycle bin was previous empty and you move 10 files to it, the "GroupCollapseState" key won't even exist until you explicitedly define a collapsed state. Because of this last mentioned behavior, things get much more difficult: it means you can't simply search/replace inside the value. Instead you have to create the value from scratch. Let me give you one example of the binary data inside "GroupCollapseState", and show you the stuff I've decoded so far: 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00, 00,00,00,00,00,00,00,00,00,00,00,00,00,00,04,00,00,00,4d,00,00,00,01,00,00, 00,12,00,00,00,44,00,3a,00,5c,00,44,00,61,00,61,00,6e,00,5c,00,44,00,6f,00, 77,00,6e,00,6c,00,6f,00,61,00,64,00,73,00,00,00,00,00,00,00,0e,00,00,00,44, 00,3a,00,5c,00,44,00,61,00,61,00,6e,00,5c,00,47,00,61,00,6d,00,65,00,73,00, 00,00,01,00,00,00,15,00,00,00,44,00,3a,00,5c,00,44,00,61,00,61,00,6e,00,5c, 00,4d,00,69,00,6a,00,6e,00,20,00,76,00,69,00,64,00,65,00,6f,00,27,00,73,00, 00,00,01,00,00,00,18,00,00,00,44,00,3a,00,5c,00,44,00,61,00,61,00,6e,00,5c, 00,4d,00,69,00,6a,00,6e,00,20,00,64,00,6f,00,63,00,75,00,6d,00,65,00,6e,00, 74,00,65,00,6e,00,00,00 Counter: Counts how many groups there are. Group: The group name/path. State: The holy grail! 00 means that the upcoming group is expanded, 01 means collapsed. Unknown: I can't figure out what it means. The first red bit after the counter (4d), is directly related to the value of the counter, but then I still don't know what the value means. I hope someone can help me out! Thanks in advance!
-
New explorer window without new process?
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
Ugh Thanks very much! -
I was wondering if it would be possible, in AutoIt, to launch a new explorer window without creating a new process. Right now, I'm using this: ShellExecute("explorer.exe", $path) This works wonderfully except for the fact that it creates a new explorer process every time it's executed. If you for example look at the "WinKey + E" shortcut, you notice that no new processes are created however often you use the shortcut. I would like to have the same functionality. Would this be possible?
-
I have a 'desktop arrange' routine, and part of it is to move the recycle bin shortcut to the downright corner on the desktop (with raster enabled). The starting arrangement is always the same as the one you can see on the picture, except for the fact that more or less shortcuts might exist before the recycle bin. However, the recycle bin is always the last shortcut of the bunch. Most actions can be done quite easily with keyboard keys, but drag and drop doesn't seem to be one of them. The closest I've come is to use the Num Lock keys to simulate the mouse actions, but then I still need a way to find the coordinates of the recycle bin shortcut. Or perhaps there's a different way alltogether... Hoping for some suggestions!
-
Completely hide control panel?
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
Ok, thanks, I see. But then how do you get to run the script/function again when the windows/process is closed? -
Completely hide control panel?
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
(Sorry, to extend this topic, but I didn't think it was worth it creating a new topic.) Lately, I've been trying to use a similar script to this one in combination with opening/exiting an application. When I open the application, I want the sound device disabled; when I exit it, I want the sound device enabled again. This is what I have now: AutoItSetOption("SendKeyDownDelay", 0) AutoItSetOption("SendKeyDelay", 0) local $Sound $SystemHook = DllCall('user32.dll', 'int', 'RegisterWindowMessageW', 'wstr', 'SHELLHOOK') GUIRegisterMsg($SystemHook[0], "GUIHook") DllCall('user32.dll', 'int', 'RegisterShellHookWindow', 'hwnd', GUICreate('Autoit Hook GUI')) Run("control mmsys.cpl") Sleep(300) Run("C:\Program Files (x86)\Finale 2012\Finale.exe") While ProcessExists ( "Finale.exe" ) Sleep(1) WEnd Sleep(1000) If Not UBound(ProcessList( "AutoIt3_x64.exe" )) > 1 Then Run("ToggleSound.exe") EndIf Func GUIHook($hWnd,$Msg,$wParam,$lParam) Switch StringRight($wParam, 1) Case 1 If WinGetTitle($lParam) = WinGetTitle("") and $Sound = 0 Then $Sound = 1 WinMove(WinGetTitle(""),"",-500,-500) Send("{DOWN 3}{APPSKEY}{DOWN 10}{ENTER 2}") EndIf EndSwitch EndFunc It works, until the "If Not UBound line". Then, I need to apply some form of recursion, to run the script again. But for some reason I can't get the Guihook method to run for the second time... -
Completely hide control panel?
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
OK, thanks for the explanation IanN1990, I re-added your code. Though not your crazy long while loop.. sleep(250) does the trick for me -
Completely hide control panel?
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
OK, I did some thorough testing with the code and came back with this: $SystemHook = DllCall('user32.dll', 'int', 'RegisterWindowMessageW', 'wstr', 'SHELLHOOK') GUIRegisterMsg($SystemHook[0], "GUIHook") DllCall('user32.dll', 'int', 'RegisterShellHookWindow', 'hwnd', GUICreate('Autoit Hook GUI')) Run("control mmsys.cpl") sleep(250) Func GUIHook() WinMove("[CLASS:#32770]","",-500,-500) ControlListView("[CLASS:#32770]", "", 1000, "Select", 0) ControlClick("[CLASS:#32770]", "", 1001) WinMove("[CLASS:NativeHWNDHost]","",-500,-500) ControlCommand("[CLASS:NativeHWNDHost]", "", 1303, "SetCurrentSelection", 1) ControlClick("[CLASS:NativeHWNDHost]", "", "Button1") ControlClick("[CLASS:NativeHWNDHost]", "", "Button1") ControlClick("[CLASS:NativeHWNDHost]", "", "Button2") ControlClick("[CLASS:#32770]", "", 1) EndFunc As you can see, I removed some code that didn't seem really necessary (at least for me). I can confirm that the windows are definitely hidden/moved. The moving method indeed seems a little bit faster. I also did a lot of other trial/error which I won't go into, but in any case this is the best I could get. It's not 100% perfect but close to it: it either shows 0 or 1 frame of the windows. BTW, disabling the shadows didn't make a difference. This makes sense because I only see a flash of the window itself. There's one other problem though: occasionally I get a "Common DLL not working" error, related to the shell. Do you know what causes this? Perhaps it's because I removed some of your code... -
Completely hide control panel?
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
Oh sorry, my bad, I made a stupid mistake... I won't go into the details because it's too embarrassing. Anyway, it's working now, but as you already mentioned, it still doesn't seem to hide. The visibility of the windows depends on how quick the windows transition, which can differ quite a lot each time. Most of the time, it either gets stuck somewhere (the windows transitions are too slow) or I see a clear flash of the windows. Ocassionally, it will be hidden completely. I think this is the summary info you need: >>>> Window <<<< Title: Sound Class: #32770 Position: 156, 156 Size: 414, 462 Style: 0x94C800CC ExStyle: 0x00050101 Handle: 0x00000000000201C0 >>>> Window <<<< Title: Speaker Setup Class: NativeHWNDHost Position: 91, 178 Size: 544, 430 Style: 0x96C80080 ExStyle: 0x00040100 Handle: 0x00000000000B0240 -
Completely hide control panel?
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
@IanN1990 Thanks for your reply! Perhaps I'm doing something wrong, but the code in option A doesn't work at all; the function GUIHook isn't even called. The only thing that happens is that it runs the sound program and is then stuck in the infinite 'while 1' loop. Let me know what you think. @JohnOne Interesting suggestion but I haven't been able to find this registry key for the "Sound" window. I have been able to find the registry key that holds the positions, sizes etc. for all resizable control panel windows: HKEY_CURRENT_USERSoftwareClassesLocal SettingsSoftwareMicrosoftWindowsShellBagsAllFoldersShellMicrosoft.Windows.ControlPanel -
Completely hide control panel?
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
Thanks for your reply! I added my code to it: $SystemGUI=GUICreate('',1920,360,0,-256,-2147483648,168) $SystemHook = DllCall('user32.dll', 'int', 'RegisterWindowMessageW', 'wstr', 'SHELLHOOK') ;$SystemHook GUIRegisterMsg($SystemHook[0], "SystemDetectHook") DllCall('user32.dll', 'int', 'RegisterShellHookWindow', 'hwnd', $SystemGUI) Run("control mmsys.cpl") Sleep(1000) Func SystemDetectHook($hWnd,$Msg,$wParam,$lParam) Switch StringRight($wParam, 1) Case 1 ;Window Created WinSetTrans(WinGetTitle($lParam), "", 1) ControlListView("[CLASS:#32770]", "", 1000, "Select", 0) ControlClick("[CLASS:#32770]", "", 1001) ControlCommand("[CLASS:NativeHWNDHost]", "", 1303, "SetCurrentSelection", 1) ControlClick("[CLASS:NativeHWNDHost]", "", "Button1") ControlClick("[CLASS:NativeHWNDHost]", "", "Button1") ControlClick("[CLASS:NativeHWNDHost]", "", "Button2") ControlClick("[CLASS:#32770]", "", 1) EndSwitch EndFunc It kinda works, but I need a better understanding of your script to be able to make improvements. Could you maybe add some comments/describe what the functions do and how they interact? Especially, why you've added the "while" loop. I also noticed that the "while" loop causes the script to stay paused when the operation is finished. I removed the loop but then when I set the sleep value too low or too high, the script will go in a (infinite) loop. And even when the value is 'right' it will occasionally go into a loop. It's really weird : P -
Completely hide control panel?
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
OK, I've done testing and found out that the Winamp process seems to be the cause of the considerable delay between windows opening. When I quit Winamp, I can set the WinWaitDelay to 0. Although that doesn't always work perfect either (I occasionally see a really short windows flash or it will get stuck because the WinWaitDelay is too low), it's much faster than with Winamp running. All this applies to WinSetTrans as well as WinMove. Is there any way this is can be improved, or will I have to "live with it"? -
Completely hide control panel?
daanodinot replied to daanodinot's topic in AutoIt General Help and Support
Hi, thanks for your reply! If I understand you correctly, every hiding solution will have to wait for the window to appear first. This means the WinWaitDelay should be as low as possible. Strangely, I cannot even set it close to 0-1. I must set it to at least 100ms to reliably complete the routine every time . Am I doing something wrong?