ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: middle click on desktop to get quick launch or 'start menu'

<< < (4/6) > >>

MilesAhead:
I don't have multiple monitors. But I took the simpler approach of just moving the mouse to the Start Orb and clicking. It should calculate the correct position to click no matter what edge the Taskbar is on.

As it is the middle mouse click will only fire if Desktop is the active window. You may have to left click the desktop first to make sure it's active. Or as noted in the comments, you may comment out that limitation. A middle click anywhere would trigger it.

edit: I've modified the calculations. I pasted in the new version. Instead of adjusting x and y from the work area outward I changed the calculation from screen res inward. That way it should still work even if the work area has been shrunk via an Adjust Work Area type utility.

The code makes the assumption that Taskbar AutoHide is disabled. Otherwise the Get Work Area API won't tell you which edge has the Taskbar. Some other fancier detection would be required. But this is a pretty good starting point for step-wise enhancement.



--- ---#SingleInstance ignore
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
x := 0
y := 0
_EmptyWorkingSet()

; DesktopGroup limits Middle Mouse Click to firing
; when the Desktop is the active window.

; comment out the next 3 lines to make hotkey global
GroupAdd,DesktopGroup, ahk_class Progman
GroupAdd,DesktopGroup, ahk_class WorkerW
#IfWinActive ahk_group DesktopGroup
MButton::
  if !_StartButtonXY(x, y)
    return
  MouseClick, left, %x%, %y%
return

;-------  helper functions  --------

_StartButtonXY(ByRef xpos, ByRef ypos)
{
  wl := 0
  wt := 0
  wr := 0
  wb := 0
  if !_GetWorkArea(wl, wt, wr, wb)
    return 0
  if (wl > 0) || (wt > 0)
  {
    xpos := 30
    ypos := 30
  }
  else if (wr < A_ScreenWidth)
  {
    xpos := A_ScreenWidth - 30
    ypos := 30
  }
  else
  {
    xpos := 30
    ypos := A_ScreenHeight - 30
  }
  return 1
}

_GetWorkArea(ByRef left, ByRef top, ByRef right, ByRef bottom)
{
  VarSetCapacity(work_area,16,0)
  success := DllCall( "SystemParametersInfo", "uint", 0x30, "uint", 0, "uint", &work_area, "uint", 0 )
  if success =
  {
    return 0
  }
  left := NumGet(work_area,0)
  top := NumGet(work_area,4)
  Right := NumGet(work_area,8)
  Bottom := NumGet(work_area,12)
  return 1
}

_EmptyWorkingSet()
{
  return DllCall("psapi.dll\EmptyWorkingSet", "UInt", -1)
}

c.gingerich:
I have an app that I had made called Start Anywhere. Press the Middle mouse button and it shows the windows Start Menu at the cursor location. Sorry it doesn't work on multi monitors, still working on that part. If anyone is interested in it, I'll smooth it out and post it.

bob99:
Is it possible to make some type of pop-up of all or part of the system tray with middle click?  With some programs minimizing there, (Screenshot Captor, Clipboard Help & Spell, Ethervane Echo,ClipTrap...etc) at times it would be easier to bring the tray up at the cursor.  For instance, if I'm on an external monitor to the left of my laptop and the tray's waaaaay over on the right  ;)
I've looked around from time to time, usually after I've been doing at lot of right clicks in the system tray on a project, but haven't found anything that says it will do the system tray.  Maybe it isn't even doable?

c.gingerich:
Might be able to do that. I'll look into it and get back to you.

c.gingerich:
Sorry, doesn't look like I am able to do that. I can hook the tray and move it once, then my system get's unstable.  :( Sorry about that. Maybe someone else will have better luck.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version