topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • February 18, 2020, 12:58 AM
  • Proudly celebrating 14 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - koomi [ switch to compact view ]

Pages: [1]
1
Living Room / Re: Micropayments now officially supported by PayPal
« on: February 14, 2011, 04:12 PM »
What about a community site, where micro-payments are made to (potentially) many different users? Is "PayPal Digital Goods" a suitable choice for such a scenario?

2
Living Room / Re: 5 New Favorite Sites
« on: December 04, 2010, 08:56 PM »
For this month, my favorite site is http://phpadvent.org/2010

3
Well, I already have Folder Menu for access to favorites, and I use it a lot (except for the list of system recent folders, since it loads so slowly.) The reason I like "QuickSwitch" behaviour is that I often find myself with an explorer window open at the precise location I need to save or open something. I use the keyboard Alt-Tab a lot, so this kind of script is a natural extension to the way I work.

4
Hi, first post ;D

I used to use Direct Folders, but had to switch to Folder Menu after I got tired of dealing with various bugs. One thing I sorely missed was the QuickSwitch feature, so I hacked up a LinkExplorerPathToFileDialog Autohotkey script. It's been briefly tested in Window XP only. If anyone would like to take a stab at any of the "NEEDS HELP WITH" or offer suggestions it would be greatly appreciated! I'm an AHK newbie...

Code: AutoIt [Select]
  1. ; LinkExplorerPathToFileDialog.ahk v0.01 WIP by koomi
  2. ; *** WARNING: Alpha code! Use at your own risk! ***
  3. ; Makes a file dialog instantly jump to the folder of any Explorer Window you click
  4. ; Idea stolen from Direct Folders' "QuickSwitch" feature.
  5. ;
  6. ; How to use:
  7. ;   1) Open a file dialog (Open/Save, also works with 7-Zip Extract and so forth)
  8. ;   2) Switch to an open Windows Explorer window
  9. ;   3) The Open/Save dialog will change to same path as the Explorer window
  10. ;   *) Autohotkey_L is recommended if your system has non-Western foldernames
  11. ;
  12. ; NEEDS HELP WITH:
  13. ;   User testing
  14. ;   Windows Vista/7 compatibility
  15. ;   Better sanity checking to make sure we're really dealing with a file dialog
  16. ;       Maybe by matching the window title against a list of known good ones?
  17. ;   Work with folder tree dialogs as well (like Direct Folders)
  18. ;   .INI file to allow specifying custom class+control+title combinations
  19. ;   Microsoft Office compatibility
  20. ;   Allow modification of the filename after the dialog first opens
  21. ;   Pretty icon and menu stuff like "Disable/Enable"
  22. ;   Flash taskbar/caption of dialog parent when path is changed or something
  23.  
  24. #SingleInstance Force
  25. #Persistent
  26. SetBatchLines,-1
  27.  
  28. Gui +LastFound
  29. shWnd := WinExist()
  30. DllCall( "RegisterShellHookWindow", UInt,shWnd )
  31. MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
  32. OnMessage( MsgNum, "ShellMessage" )
  33.  
  34. HookProcAdr := RegisterCallback( "HookProc", "F" )
  35. hWinEventHook := SetWinEventHook( 0x3, 0x3, 0, HookProcAdr, 0, 0, 0 )
  36.  
  37. ; Globals that need to be shared between ShellMessage() and HookProc()
  38. ControlText =
  39. ControlHwnd =
  40. LastCharacter =
  41.  
  42. OnExit, HandleExit
  43.  
  44. ; See http://www.autohotkey.com/forum/post-123323.html
  45. ShellMessage( wParam,lParam )
  46. {
  47.     global ControlText
  48.     global ControlHwnd
  49.     global LastCharacter
  50.  
  51.     ; See http://msdn.microsoft.com/en-us/library/ms644989.aspx
  52.     If ( wParam = 1 || wParam = 4 ) ;  HSHELL_WINDOWCREATED := 1 OR HSHELL_WINDOWACTIVATED := 4
  53.     {
  54.         WinGetClass, Class, ahk_id %lParam%
  55.         ; Is this an Explorer window?
  56.         If (Class = "CabinetWClass" OR Class = "ExploreWClass") ; Might need adjustment for Vista/Win7
  57.         {
  58.             ; Do we have a Open/Save control handle available?
  59.             If (ControlHwnd)
  60.             {
  61.                 WinGetTitle, ExplorerTitle, ahk_id %lParam%
  62.                 If (LastCharacter <> "\")
  63.                 {
  64.                     ; Change the path to the Explorer path
  65.                     ControlSetText,, %ExplorerTitle%, ahk_id %ControlHwnd%
  66.                     ControlSend,, {Enter}, ahk_id %ControlHwnd%
  67.                     ; Put the original filename back in the dialog edit control
  68.                     ControlSetText,, %ControlText%, ahk_id %ControlHwnd%
  69.                 }
  70.                 ; For cases like 7-Zip "Extract" dialog which contain pathnames, not filenames
  71.                 else
  72.                 {
  73.                     ControlSetText,, %ExplorerTitle%\, ahk_id %ControlHwnd%
  74.                 }
  75.                 ; If Dialog is gone, reset globals to avoid extra work next time around
  76.                 If ErrorLevel
  77.                 {
  78.                     ControlText =
  79.                     ControlHwnd =
  80.                     LastCharacter =
  81.                     Exit
  82.                 }
  83.             }
  84.         }
  85.     }
  86. }
  87.  
  88. ; See http://www.autohotkey.com/forum/topic35659.html
  89. HookProc( hWinEventHook, Event, hWnd, idObject, idChild, dwEventThread, dwmsEventTime )
  90. {
  91.     global ControlText
  92.     global ControlHwnd
  93.     global LastCharacter
  94.  
  95.     If Event ; EVENT_SYSTEM_FOREGROUND = 0x3
  96.     {
  97.         ; Windows and dialog boxes need time to "settle". See AHK manual
  98.         Sleep, 120
  99.         WinGetClass, DialogClass, ahk_id %hWnd%
  100.         ; Is this a typical Open/Save dialog box?
  101.         If (DialogClass = "#32770")
  102.         {
  103.             ; Populate globals for use in ShellMessage
  104.             ControlGet, ControlHwnd, Hwnd,, Edit1, ahk_id %hWnd%
  105.             ControlGetText, ControlText, Edit1, ahk_id %hWnd%
  106.             StringRight, LastCharacter, ControlText, 1
  107.         }
  108.     }
  109. }
  110.  
  111. SetWinEventHook(eventMin, eventMax, hmodWinEventProc, lpfnWinEventProc, idProcess, idThread, dwFlags)
  112. {
  113.     DllCall("CoInitialize", Uint, 0)
  114.     return DllCall("SetWinEventHook"
  115.     , Uint,eventMin
  116.     , Uint,eventMax
  117.     , Uint,hmodWinEventProc
  118.     , Uint,lpfnWinEventProc
  119.     , Uint,idProcess
  120.     , Uint,idThread
  121.     , Uint,dwFlags)
  122. }
  123.  
  124. UnhookWinEvent()
  125. {
  126.     Global
  127.     DllCall( "UnhookWinEvent", Uint,hWinEventHook )
  128.     DllCall( "GlobalFree", UInt,&HookProcAdr ) ; free up allocated memory for RegisterCallback
  129. }
  130.  
  131. HandleExit:
  132. UnhookWinEvent()
  133. ExitApp

Pages: [1]