Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

"ToolTip" with Picture


  • Please log in to reply
7 replies to this topic
-¤GoO¤-
  • Members
  • 60 posts
  • Last active: Apr 28 2007 10:17 PM
  • Joined: 22 Feb 2005
Don't know if anyone have done this before, but i've made a script that shows a picture under the mouse, and moves along with it:


CoordMode, Mouse, Screen
Image = Picture.jpg    ;replace that with yor own image
loop
{
MouseGetPos, X, Y
ImageX := X + 20 ;Change "20" to your own needs etc.
ImageY := Y + 20 ; Same here
SplashImage, %Image%, B X%ImageX% Y%ImageY%
sleep 100 ; Change this value as you wish. Lower numbers = much flashing, higher numbers = slow update
}

Comments are welcome and so improvements.
PS. I'm still looking for a way to do the same with text. :wink:
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
This is an excellent idea and I'm working more on it right now. I know how to get the text, I just have to get a working example. I think I might also know how to eliminate the flashing.

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
Alright, this kills the flashing. Text coming soon.

coordmode,mouse,screen
image=Picture.jpg
mousegetpos,x,y
imagex:=x+20
imagey:=y+20
splashimage,%image%,b x%imagex% y%imagey%,,,MouseImageID
sleep,100
loop
{
	mousegetpos,x,y
	imagex:=x+20
	imagey:=y+20
	winmove,MouseImageID,,%imagex%,%imagey%
	sleep,80
}


jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
Ok, this version displays text, but it's very crude. I'm going to try it with a gui next to see if I can get it left justified.

coordmode,mouse,screen
text=Hello world!
mousegetpos,x,y
textx:=x+20
texty:=y+20
splashimage,,b cwFFFFFF ct000000 x%textx% y%texty%,,%text%,MouseTextID
winset,transcolor,FFFFFF 255,MouseTextID
sleep,100
loop
{
	mousegetpos,x,y
	textx:=x+20
	texty:=y+20
	winmove,MouseTextID,,%textx%,%texty%
	sleep,80
}


-¤GoO¤-
  • Members
  • 60 posts
  • Last active: Apr 28 2007 10:17 PM
  • Joined: 22 Feb 2005
Alright! :D

Thanks for the improvements!
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
Here's a left-justified and more customizable version (using gui), but I still can't get it to lose the text control's white background:

coordmode,mouse,screen
detecthiddenwindows,on
text=Hello world!
mousegetpos,x,y
textx:=x+20
texty:=y+20
gui,color,FFFFFF,FFFFFF
gui,add,text,backgroundtrans x0 y0,%text%
winset,transcolor,FFFFFF 255,MouseTextID
gui,-caption +alwaysontop
gui,show,x%textx% y%texty%,MouseTextID
sleep,100
loop
{
	mousegetpos,x,y
	textx:=x+20
	texty:=y+20
	winmove,MouseTextID,,%textx%,%texty%
	sleep,80
}


JHa
  • Guests
  • Last active:
  • Joined: --
Your code works well now:

CoordMode, Mouse, Screen
DetectHiddenWindows, on
text=Hello world!

MouseGetPos, x, y
textx := x+20
texty := y+20
Gui, Color, FFFFFF, FFFFFF
Gui, Add, Text, x0 y0, %text%

Gui, -Caption [color=red]+ToolWindow[/color]
Gui, Show, x%textx% y%texty%, MouseTextID
winset, Transcolor, FFFFFF 255, MouseTextID

Sleep, 100
loop
{
   MouseGetPos, x, y
   textx := x+20
   texty := y+20
   WinMove, MouseTextID,, %textx%, %texty%
   Sleep, 80
}


GoDXilE
  • Members
  • 7 posts
  • Last active: Jun 06 2014 07:19 PM
  • Joined: 28 Jan 2013
Very cool, The code is a mixture from the base documentation and other post around here.
Hover over any image then hold your middle mouse button down for 175 MS "Line 31" to activate it and release to deactivate.
Press Capslock 300ms to run the image in your default editor.

#InstallKeyBDHook
#SingleInstance Force
;#NoTrayIcon
ScrollLock::
Suspend
Return

Capslock::
{
KeyWait, CapsLock, T.3
If errorlevel
{
SetCapsLockState Off
SplashImage, Off
run, %Image%
Sleep, 100
Clipboard =
Hotkey, MButton, Off
Sleep, 1500
Hotkey, MButton, On
Return
}
Else
{
SetCapsLockState, Off
}
KeyWait, CapsLock
}

Clipboard =
SplashImage, Off

MButton::
MouseGetPos,,,win
WinActivate, ahk_id %win%
Sleep, 50
Send {LButton Down}
Sleep, 50
Send {LButton Up}
Sleep, 50
Send {Mbutton Up}
{
KeyWait, MButton, T.175
If ErrorLevel
{
Send ^c
Clipwait 10
Image = %Clipboard%
Sleep, 100
SplashImage, %Image%, B
While GetKeyState("MButton","P")
{
}
SplashImage, Off
Clipboard =
}
Else
{
SplashImage, Off
Hotkey, MButton, Off
Send {MButton Down}
sleep, 10
send {MButton Up}
hotkey, MButton, On
}
KeyWait, MButton
}

KeyWait, Capslock, T120
If ErrorLevel
Return