AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[CTRL+Double Click to Open with app] and [other help]

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
blehmeco



Joined: 17 Nov 2009
Posts: 24

PostPosted: Tue Nov 17, 2009 8:37 pm    Post subject: [CTRL+Double Click to Open with app] and [other help] Reply with quote

Hey guys!


Need your kind help with these ideas i had 4 AHK scripts...
What i want 2 do but have no idea whatsoever where 2 start (not that i haven't written a script b4, i just couldn't get any idea for this ones...):


Idea #1:
Pressing {Shift + double clicking} on any *.avi file opens the file with a specific app (in this case i want it to b Media Player Classic and not default player: Windows Media Player)

Idea #2:
Pressing {Control+T+B}: toggles the option 2 automatically hide/show Windows' taskbar (this option may be found under: RightClick taskbar>Properties, "Taskbar" tab, option "Automatically hide taskbar")


Idea #3:
I use RocketDock, so what i need a AHK script that would, after performing what's said on Idea #2, bring the RocketDock to the vertical position 0 px (this option is found in RocketDock under: "Dock Configuration", tab "Position", "Edge Offset" bar); and, if possible, by pressing it again it would undo these steps (i.e. toggle the taskbar to NOT automatically hide and bring back the dock to the edge offset/vertical position of 30px)


Appreciate your help with any of these!
Or if any1 knows of a way of sending messages 2 a Configurations window (like the propoerties dialog window of the taskbar) to change/toggle on and off its options , please share it!

BTW, i'm not lazy, i've googled and searched a lot 4 solutions but can't find out how 2 accomplish this... and i couldn't find how to grab and edit the values of the mentioned togglers (4 RocketDock or any other Configs windows) Control ID or wParam with Winspector either (i might not b doing it right though...)


Any help is appreciated here!

Thanks!

Cheers!

[]
Back to top
View user's profile Send private message
Carcophan



Joined: 24 Dec 2008
Posts: 768
Location: :noitacoL

PostPosted: Tue Nov 17, 2009 8:58 pm    Post subject: Reply with quote

Quote:
Idea #1:
Pressing {Shift + double clicking} on any *.avi file opens the file with a specific app (in this case i want it to b Media Player Classic and not default player: Windows Media Player)

You can make it so all .avi files open to the "Media Player Classic " and leave all other file formats to there native application (WMP)

Do you want only 'selected' avi files to open in M.P.C., or ALL avi files?


Quote:

Idea #2:
Pressing {Control+T+B}: toggles the option 2 automatically hide/show Windows' taskbar (this option may be found under: RightClick taskbar>Properties, "Taskbar" tab, option "Automatically hide taskbar")


You can simply tell AHK to right click on the taskbar, at location X/Y, and then send keyboard commands.

Code:

;example, not tested
MouseClick, Right, 1250, 100, 1
Send, R ;for the taskbar and start menu properties screen
Sleep 1000
Send, U  ;for 'autohide checkbox
send, {enter} ;to 'hit' the okay button
return




Quote:

Idea #3:
I use RocketDock
...
BTW, i'm not lazy

Twisted Evil

Search the forum 'search' (not the google) for 'rocketdock', i do not know if you can move the dock or not, but I remember seeing a few posts a while back about something similar to this.
_________________
"Unfortunately a "COM for Dummies" book would be a little like "Neurosurgery for Dummies," in the end you're just gonna have to learn" ~Tank
Back to top
View user's profile Send private message AIM Address
blehmeco



Joined: 17 Nov 2009
Posts: 24

PostPosted: Tue Nov 17, 2009 9:41 pm    Post subject: Reply with quote

Thanks 4 that reply man! Very Happy


Quote:
Do you want only 'selected' avi files to open in M.P.C., or ALL avi files?


Yup! Only 'selected' avi files! (actually, i wanted it to b 4 any video file, but i thought starting only with avi files and go from there...)
Sometimes i want them 2 open with native app (WMP) other times i might want to open them with MPC.


Quote:
You can simply tell AHK to right click on the taskbar, at location X/Y, and then send keyboard commands.


I've just realised that the window of Taskbar's Properties always opens in the same spot on the screen, making your idea possible...so thanks!
However i was actually looking 4 a send command 2 accomplish this action...does anyone know how 2 accomplish this?


Already searching the forum for rocketdock! Dunno how, but i just didnt thought of looking 4 rocketdock in the forum Confused ...thanks 4 the heads up! shame on me!!!

Anyway, still looking 4 a way 2 change the options of config windows without resorting to x,y clicks (4 programs whose windows might change positions...)... anyone can help?


Cheers!
Very Happy
Back to top
View user's profile Send private message
blehmeco



Joined: 17 Nov 2009
Posts: 24

PostPosted: Tue Nov 17, 2009 10:21 pm    Post subject: Reply with quote

I've just read all the posts about rocketDock here in this forum but they werent much of a help...

I shoud add i already tried using "WinMove" in the code and it is possible to move RocketDock's dock (the skin, which is what they call it), but the icons stay in the same place...what's more, when i hover the mouse over the icons the dock immediately snaps back 2 place... so that doesn't seem to help much either...

The best solution would really b to change the Edge Offset on RocketDock's configurations... but i can find out how 2 do that...


any1?Rolling Eyes
Back to top
View user's profile Send private message
blehmeco



Joined: 17 Nov 2009
Posts: 24

PostPosted: Tue Nov 17, 2009 11:32 pm    Post subject: Reply with quote

So here are more developments on my Idea #3:

Now I've managed 2 get the dock and the icons to move where i want them 2 be (not all at the same time but it's ok), however, they don't stay there if the mouse hovers on the dock, they snap back 2 their previous positions...any1 knows a solution?

Here's my code:

Code:
+<z::

   WinMove, ahk_class ROCKETDOCK, , , 720
   WinGet, RocketDockIcons, list, ahk_class RDIconWnd
   Loop, %RocketDockIcons%
   {
      this_RocketDockIcons := RocketDockIcons%A_Index%
      WinMove, ahk_id %this_RocketDockIcons%, , , 746
      If RocketDockIcons%A_Index% = %RocketDockIcons%
      Break
   }



I think RocketDock's definitions 4 the position of the dock ("edge offset" in the configs menu of RocketDock) is overriding the windows definitions, and hence the WinMove command won't work permanently...

Any ideas any1?


BTW, i thought Idea #1 above was actually the 1 that some1 would come up with a solution faster.. no1? really?...hmmmm...Sad

well, if some1 finds out anything about that or about accessing a configs window options and changing them... lemme know!

cheers!
Back to top
View user's profile Send private message
blehmeco



Joined: 17 Nov 2009
Posts: 24

PostPosted: Wed Nov 18, 2009 5:53 am    Post subject: Reply with quote

Ok..keep on posting developments here...feels a bit like talking 2 myself, but just in case anybody's listenin:

Idea #2 is done, missing a solution for #1 and the rest of #3...

Idea#3:
i've managed 2 make the taskbar disappear and leave the space free on the desktop (i.e. the taskbar&start button aren't just transparent, they really disappear) and make the skin and icons of RocketDock follow the lead of the taskbar all the way 2 the edge of the screen...

credits 2 the guys in this great forum 4 the hide/show taskbar and start button part (the hardest, really! i just modified it a bit, removed a sleep here and there...), the rest of the script adjusting the vertical position of RocketDock and its icons i made myself...


Code:
+<::
   {
      If x=0
      {
         NumPut( ( ABS_ALWAYSONTOP := 0x2 ), APPBARDATA, 32, "UInt" )
         DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
         WinShow ahk_class Shell_TrayWnd
         x=1
         return
      }
   
      If x=1
      {
         DetectHiddenWindows, On
         VarSetCapacity( APPBARDATA, 36, 0 )
         NumPut( ( ABS_ALWAYSONTOP := 0x2 )|( ABS_AUTOHIDE := 0x1 ), APPBARDATA, 32, "UInt" )
         DllCall( "Shell32.dll\SHAppBarMessage", "UInt", (ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
         WinHide ahk_class Shell_TrayWnd
         WinHide ahk_class Shell_TrayWnd
         x=0
         WinGetPos, , YOfSkin, , HOfSkin, ahk_class ROCKETDOCK
         WinGetPos, , YOfIcon, , , ahk_class RDIconWnd
         EdgeOffset := (A_ScreenHeight - (YOfSkin + HOfSkin))        
         WinMove, ahk_class ROCKETDOCK, , , (YOfSkin + EdgeOffset)
         WinGet, RocketDockIcons, list, ahk_class RDIconWnd
         Loop, %RocketDockIcons%
         {
          this_RocketDockIcons := RocketDockIcons%A_Index%
          WinMove, ahk_id %this_RocketDockIcons%, , , (YOfIcon + EdgeOffset)
          If RocketDockIcons%A_Index% = %RocketDockIcons%
          Break
         }
         return
      }   
    
   }




However, as predicted, the weak link here is my part of the script as the icons and skin of RocketDock don't stay in the defined position! just hovering with the mouse on the dock makes them snap back 2 the previous position... damn!


any1 knows a way out?Rolling Eyes
Back to top
View user's profile Send private message
buddyd
Guest





PostPosted: Wed Nov 18, 2009 5:25 pm    Post subject: Reply with quote

If I recall correctly rocketdock uses a standard config file you could try making a copy of it with the dock set in one location and rename it as config.ini.bak and have your script close rocketdock rename the config file to config.ini then restart rocketdock.
Back to top
blehmeco



Joined: 17 Nov 2009
Posts: 24

PostPosted: Wed Nov 18, 2009 9:10 pm    Post subject: Reply with quote

sure is! gonna try that just now!!

thanks 4 that lightning idea buddyd!Very Happy
owe you 1!
(plus, it's good 2 know somebody is reading this stuff!Wink )

BTW, about Idea #1, didn't quite manage 2 make it {CTRL + Double Click} 2 open with MPC, it's done with {CTRL+<} after the user selects the file to play (and it pauses the video [shortly] after opening it, which is what i wanted...had 2 use a sleep function though..couldn't stop the movie b4 it was playing...)! but hey! that's close enough 4 me! here's my code:

Code:
^<::
   WinGetClass, ClassOfOpenWindow, A
   If ClassOfOpenWindow in ExploreWClass,CabinetWClass,Progman

   {
      Clipboard =
      SendInput, ^c
      ClipWait, 1
      RegExMatch(Clipboard, "\.[a-zA-Z]+$", ExtensionOfFile)
      StringLower, ExtensionOfFile, ExtensionOfFile
      ExtensionOfFile := SubStr(ExtensionOfFile, 2)
      If ExtensionOfFile in avi,mpg,flv,mov,qt,mkv
      {
         Run, C:\Program Files\MPC HomeCinema\mpc-hc.exe "%Clipboard%"
         Clipboard := ClipSaved
         #IfWinActive, ahk_class MediaPlayerClassicW
            Sleep, 3000
            SendInput, {Media_Stop}
         Clipboard := ClipSaved
      }Else
         Clipboard := ClipSaved
         SendInput, % SubStr(A_ThisHotkey, 2)
   }Else
      SendInput, % SubStr(A_ThisHotkey, 2)
Return



Again i must say that most of the credit goes 2 the guys here @ this great forum! i keep getting stuff and new ideas from their posts!


Cheers!Very Happy
Back to top
View user's profile Send private message
blehmeco



Joined: 17 Nov 2009
Posts: 24

PostPosted: Wed Nov 18, 2009 10:01 pm    Post subject: Reply with quote

Dude! you seriously rock!

I've made the code and it works! seamlessly! here it is:


Quote:
^<::
WinClose, ahk_class ROCKETDOCK
Sleep, 750
IniWrite, 1, C:\Program Files\RocketDock\Settings.ini, Software\RocketDock, ManageWindows
IniWrite, 0, C:\Program Files\RocketDock\Settings.ini, Software\RocketDock, vOffset
Run, C:\Program Files\RocketDock\RocketDock.exe
Return



Great man! That's another idea done!!
thanks a lot 4 your help!Laughing

as soon as i get the chance i'll gather all the bits i've been coming up with and posting here and post it all here in case it comes in handy 4 anyone else!

What it'll do is Idea #3:
Hide taskbar& start button AND
in RocketDock:
Lower the vertical position of the dock 2 the edge of the screen + toggling the "Minimize windows to dock" on!

A new hotkey press will undo these changes! (Show taskbar&Menu button, bring the dock 2 the previous position and turn off the "Minimize windows blah blah blah" off)

Again thanks!

Cheers!Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group