Jump to content

use key strokes to move ToolTip


Recommended Posts

Hi,

I'm a newbie both to this forum and to programming.

Necessity brought me here. I needed and was provided with a script someone wrote that shows the system time on a ToolTip on the desktop but with a +5-minute offset. It's just what I need, but I'm having a problem with it because the user for whom it's intended has a pair of wide-screen monitors she keeps at high resolution, so, as the script is written, the Time-Telling ToolTip's location is wrong. I am able to relocate it via a trial-and-error process of changing the script's screen coordinates, but the user has the annoying habit of constantly changing her screen resolution, so the ToolTip's location will change with it. What I'm asking for help with--presuming it's even possible--is suggestions for adding to the script the ability to move the ToolTIp's location via a key-stroke combination, for example Ctrl-Shft-U to move the ToolTIp up, Ctrl-Shift-D to move it down, Ctrl-Shft-R to move it right, and Ctrl-Shft-L to move it left (doesn't need to be Ctrl-Shif--any key-combination will do).

I will much appreciate anyone's taking time to help me with this.

GaryK

Link to comment
Share on other sites

  • Moderators

gkarasik,

An easier solution would be to check periodically for the screen resolution and adjust the tooltip position as required. Can you post the script you have so we can see how this might best be implemented.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Also you can have it change "automatically" by detecting WM_SETTINGCHANGE message. It helps too instead of hard coding pixel positions if you get the current desktop width and height and covert your position and size info into percentages.  Then if the user changes the screen res at least you are in the ball park and can just check for extending past the screen edge etc..

 

Edited by MilesAhead
spelling
Link to comment
Share on other sites

heres a newbie way to move it utilizing the arrow keys.  But as described above, there are better ways to detect screen area and present information.

#include <Misc.au3>

$msg = ("This is a test")

Tooltip($msg)

while 1

If _IsPressed("25") Then Tooltip($msg , 0 , @DesktopHeight - 30)
If _IsPressed("26") Then Tooltip($msg , 0 , 0)
If _IsPressed("27") Then Tooltip($msg , @DesktopWidth - 200 , 0)
If _IsPressed("28") Then Tooltip($msg , @DesktopWidth - 200 , @DesktopHeight - 30)

sleep(50)

wend

 

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...