WinMove a little gui Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

WinMove a little gui

15 Feb 2019, 07:49

this function creates a new little textLine if not already exist.
but i also expect, that its moving every time i call it.
WinMove, % titleClass,% x - 50 , % (y - 50) ; <=============================== problem
but its not. it moves in this code sends me message box but not moving.

Code: Select all

loop,9
	toolTipGui(10, 10, "test")
	
toolTipGui(x, y, text, title := "", bgColor := "", fontSize := 0){
	if(!title)
		title := "title1902121943"
	if(!bgColor)
		bgColor := "Green"
	if(!fontSize)
		fontSize := 10
	DetectHiddenWindows,Off
	settitlematchmode,3
	; ahk_class AutoHotkeyGUI ahk_exe AutoHotkey.exe 
	; UniqueID := WinExist(WinTitle , WinText, ExcludeTitle, ExcludeText)
	titleClass := title " ahk_class AutoHotkeyGUI ahk_exe AutoHotkey.exe"
	If( HGUI := WinExist( titleClass )){ ; eturns the Unique ID (HWND) (
		;WinGetPos,x,y, Width, Height, A ; %title%
		WinGetPos,x,y, Width, Height, % titleClass ; %title%
		WinMove, % titleClass,% x - 50 , % (y - 50) ; <=============================== problem
		; WinMove, % titleClass,% x , % y - 15
		msgbox, % "was found: " titleClass " at x,y ? " x "," y
		
		;WinMove, A,, 10, 10,
		GuiControl,  , % Gui1.HTXT, text ; update text
		Gui1 := {HGUI: HGUI, HTXT: text} ; HTXT???????????????
		return {HGUI: HGUI, HTXT: text}
	}
	
	; Gui, New, +AlwaysOnTop +ToolWindow -SysMenu -Caption +HwndHGUI
	Gui, New, +ToolWindow -SysMenu -Caption +HwndHGUI
	Gui, Color, %bgColor%
	Gui, Font, cWhite s%fontSize% q1, Arial Narrow ;red ; changed s11 to s10
	Gui, Add, Text, y0 hwndHTXT, %text%
	; Return {HGUI: HGUI, HTXT: HTXT} ; Gui1 := toolTipGui()
	Gui1 := {HGUI: HGUI, HTXT: HTXT}
	Gui, % Gui1.HGUI . ":Show", NoActivate x%x% y%y% , %title%
	return Gui1 ; older:
}
;\____ toolTipGui __ 190214201453 __ 14.02.2019 20:14:53 __/
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: WinMove a little gui  Topic is solved

15 Feb 2019, 08:15

This might work. (Should work if the issue is expressions)

Code: Select all


MoveWindow( titleClass , x - 50 , y - 50)         ; Function call

MoveWindow(name,x,y){
	WinMove, %name% ,,  %x% , %y%
}




***Edit***
Upon testing, it looks like there is no issue with using expressions, so it looks like your problem is just that you are missing a comma for wintext.

WinMove, % titleClass ,, % x - 50 , % (y - 50)
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: WinMove a little gui

15 Feb 2019, 08:34

Hellbent wrote:
15 Feb 2019, 08:15
... ***Edit*** Upon testing, it looks like there is no issue with using expressions, so it looks like your problem is just that you are missing a comma for wintext.
WinMove, % titleClass ,, % x - 50 , % (y - 50)
yes your reight. many thanks.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 358 guests