i have seen a very cool script that allows you to open a ToolTip that opens after briefly holding down the middle mouse button and was hoping to apply the same functionality to my improvised interface that opens all kinds of things on my pc.
my interface is made out of GUI commands while the ToolTip is made as a menu which confuses me.
in simple words: i'd like to open my GUI as a ToolTip, from the last position of the mouse, just as the menu does, but keep all the buttons i have there and the pictures(with links) too.
my code:
Code: Select all
#SingleInstance, force
; Gui Layout
;----------------
;---------------------------
Gui, Show,
Gui, Font, cAqua
Gui, Font, s16
Gui, Add, Text, x160 y20 ,Hotkeys
;-------------------------------
Gui, Add, Picture, x100 y60 w200 h60 gYVC, C:\Users\yawik\Desktop\AHK\yawik\yvc.png
Gui, Add, Picture, x100 y+7 w200 h60 gYnet, C:\Users\yawik\Desktop\AHK\yawik\ynet.png
Gui, Add, Picture, x100 y+7 w200 h60 gLeagueOfLegends, C:\Riot Games\League of Legends\RADS\system\lol.ico
Gui, Add, Picture, x100 y+7 w200 h60 gMySite, C:\Users\yawik\Desktop\AHK\yawik\samsung.png
Gui, Add, Picture, x100 y+7 w200 h60 gYouTube, C:\Users\yawik\Desktop\AHK\yawik\youtube logo.png
Gui, Add, Picture, x100 y+7 w200 h60 gFacebook, C:\Users\yawik\Desktop\AHK\yawik\facebook logo.png
Gui, Add, Text, x420 y20 ,Scroll To Course
;-----------------------------------------
Gui, Add, Button, x400 y60 w200 h60 gInfi, Infi
Gui, Add, Button, x400 y+7 w200 h60 gAnglit, Anglit
Gui, Add, Button, x400 y+7 w200 h60 gHistabrut, Histabrut
Gui, Add, Button, x400 y+7 w200 h60 gMeida, Meida
Gui, Add, Button, x400 y+7 w200 h60 gCosmopolitiut, Cosmopolitiut
Gui, Add, Button, x400 y+7 w200 h60 gModelim, Modelim
Gui, Add, Button, x400 y+7 w200 h60 gTikshoret, Tikshoret
Gui, Add, Text, x740 y20 ,MiniGames
;----------------------------------
Gui, Add, Button, x910 y60 w70 h60 gHexxagonClose, Close
Gui, Add, Button, x910 y+7 w70 h60 gMemoryClose, Close
Gui, Add, Button, x910 y+7 w70 h60 gPearlsClose, Close
Gui, Add, Picture, x700 y60 w200 h60 gHexxagon, C:\Users\yawik\Desktop\AHK\test game\Hexxagon\Hexxagon.png
Gui, Add, Picture, x700 y+7 w200 h60 gMemory, C:\Users\yawik\Desktop\AHK\test game\Memory\Memory.jpg
Gui, Add, Picture, x700 y+7 w200 h60 gPearls, C:\Users\yawik\Desktop\AHK\test game\Pearls\Pearls.jpg
Gui, -AlwaysOnTop
Gui, color, Black
Gui, Show, x300 y150 w1000 h600, `t
Gui, Add, Picture, x0 y0 w1000 h600, C:\Users\yawik\Desktop\AHK\yawik\Interface.jpg
return
; Lables
;----------------
;---------------------------
GuiClose:
ExitApp
return
LeagueOfLegends:
Run, "C:\Riot Games\League of Legends\LeagueClient.exe"
Sleep, 14000
send, *****************
send, {enter}
ExitApp
return
YVC:
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory=Default --app-id=ilhainnnlldppdgnhjbnijkaodjcoidh
sleep, 3000
send, **************
send, {Tab}
send, *********
send, {Enter}
ExitApp
return
Ynet:
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory=Default --app-id=lhbfbhcmdfpilbfondnkehgcddhffpdd
ExitApp
return
MySite:
Run, "https://samsungelectronics.000webhostapp.com"
ExitApp
return
YouTube:
Run, "https://www.youtube.com/"
ExitApp
return
Facebook:
Run, "https://www.facebook.com/"
ExitApp
return
Infi:
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\אינפי"
ExitApp
return
Anglit:
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\אנגלית מתקדמים ב'"
ExitApp
return
Histabrut:
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\מבוא להסתברות"
ExitApp
return
Meida:
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\מבוא למערכות מידע ניהוליות"
ExitApp
return
Cosmopolitiut:
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\מבוא לקוסמופוליטיות"
ExitApp
return
Modelim:
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\מודלים עסקיים"
ExitApp
return
Tikshoret:
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\תקשורת מחשבים"
ExitApp
return
Hexxagon:
Run, "C:\Users\yawik\Desktop\AHK\test game\Hexxagon\Hexxagon.ahk"
ExitApp
return
HexxagonClose:
IfWinExist, Hexxagon
WinClose
return
Memory:
Run, "C:\Users\yawik\Desktop\AHK\test game\Memory\Memory.ahk"
ExitApp
return
MemoryClose:
IfWinExist, Memory
WinClose
return
Pearls:
Run, "C:\Users\yawik\Desktop\AHK\test game\Pearls\Pearls.ahk"
ExitApp
return
PearlsClose:
IfWinExist, Pearls
WinClose
return
; Functions
;----------------
;---------------------------
; Hotkeys
;----------------
;---------------------------
; anglit
-----------------
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\אנגלית מתקדמים ב'"
; cosmopolitiut
-----------------
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\מבוא לקוסמופוליטיות"
; histabrut
-----------------
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\מבוא להסתברות"
; infi
-----------------
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\אינפי"
; meida
-----------------
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\מבוא למערכות מידע ניהוליות"
; modelim
-----------------
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\מודלים עסקיים"
; tikshoret
-----------------
Run, "C:\Users\yawik\Google Drive\yawik\תשעז\סמסטר א\עמק יזרעאל\תקשורת מחשבים"
Esc::ExitApp
the ToolTip code(by Rajat):
Code: Select all
; You can set any title here for the menu:
MenuTitle = -=-=-=-=-=-=-=-
; This is how long the mouse button must be held to cause the menu to appear:
UMDelay = 20
SetFormat, float, 0.0
SetBatchLines, 10ms
SetTitleMatchMode, 2
#SingleInstance
;___________________________________________
;_____Menu Definitions______________________
; Create / Edit Menu Items here.
; You can't use spaces in keys/values/section names.
; Don't worry about the order, the menu will be sorted.
MenuItems = Notepad/Calculator/Section 3/Section 4/Section 5
;___________________________________________
;______Dynamic menuitems here_______________
; Syntax:
; Dyn# = MenuItem|Window title
Dyn1 = MS Word|- Microsoft Word
Dyn2 = Notepad II|- Notepad
;___________________________________________
Exit
;___________________________________________
;_____Menu Sections_________________________
; Create / Edit Menu Sections here.
Notepad:
Run, Notepad.exe
Return
Calculator:
Run, Calc
Return
Section3:
MsgBox, You selected 3
Return
Section4:
MsgBox, You selected 4
Return
Section5:
MsgBox, You selected 5
Return
MSWord:
msgbox, this is a dynamic entry (word)
Return
NotepadII:
msgbox, this is a dynamic entry (notepad)
Return
;___________________________________________
;_____Hotkey Section________________________
~MButton::
HowLong = 0
Loop
{
HowLong ++
Sleep, 10
GetKeyState, MButton, MButton, P
IfEqual, MButton, U, Break
}
IfLess, HowLong, %UMDelay%, Return
;prepares dynamic menu
DynMenu =
Loop
{
IfEqual, Dyn%a_index%,, Break
StringGetPos, ppos, dyn%a_index%, |
StringLeft, item, dyn%a_index%, %ppos%
ppos += 2
StringMid, win, dyn%a_index%, %ppos%, 1000
IfWinActive, %win%,
DynMenu = %DynMenu%/%item%
}
;Joins sorted main menu and dynamic menu
Sort, MenuItems, D/
TempMenu = %MenuItems%%DynMenu%
;clears earlier entries
Loop
{
IfEqual, MenuItem%a_index%,, Break
MenuItem%a_index% =
}
;creates new entries
Loop, Parse, TempMenu, /
{
MenuItem%a_index% = %a_loopfield%
}
;creates the menu
Menu = %MenuTitle%
Loop
{
IfEqual, MenuItem%a_index%,, Break
numItems ++
StringTrimLeft, MenuText, MenuItem%a_index%, 0
Menu = %Menu%`n%MenuText%
}
MouseGetPos, mX, mY
HotKey, ~LButton, MenuClick
HotKey, ~LButton, On
ToolTip, %Menu%, %mX%, %mY%
WinActivate, %MenuTitle%
Return
MenuClick:
HotKey, ~LButton, Off
IfWinNotActive, %MenuTitle%
{
ToolTip
Return
}
MouseGetPos, mX, mY
ToolTip
mY -= 3 ;space after which first line starts
mY /= 13 ;space taken by each line
IfLess, mY, 1, Return
IfGreater, mY, %numItems%, Return
StringTrimLeft, TargetSection, MenuItem%mY%, 0
StringReplace, TargetSection, TargetSection, %a_space%,, A
Gosub, %TargetSection%
Return
thanks in advance!
yawikflame