Jump to content

splashon window resets after moved with mouse


Recommended Posts

if splashtexton is used with 16 = Window can be moved

next time I loop and run spashtexton it resets to the default position.

Can I read the x,y co-ordinates of the old window, and next time use that x pos and y pos?

thanks in advance for someones help

Link to comment
Share on other sites

This is a direct copy/pastes from the help file: Hope they help , if not disregard:

WinGetPos ( "title" [, "text"] )

Parameters

title The title of the window to read. See Title special definition.

text [optional] The text of the window to read.

Return Value

Success: Returns a 4-element array containing the following information:

$array[0] = X position

$array[1] = Y position

$array[2] = Width

$array[3] = Height

Failure: Returns 0 and sets @error to 1 if windows is not found.

Remarks

WinGetPos returns negative numbers such as -32000 for minimized windows, but works fine with (non-minimized) hidden windows.

If the window title "Program Manager" is used, the function will return the size of the desktop. If multiple windows match the criteria, the most recently active window is used.

IF this IS what your looking for , but are unsure how to use; let me know and I'll post some examples.

Link to comment
Share on other sites

You almost solved the problem, but the hight and width increases each loop

my code is as follows (in a loop)

$size[0]=0;x

$size[1]=120;y

$size[2]=800;w

$size[3]=245;h

SplashTextOn("YYYYMMDD TIME System name, Sym, Contracts , Price , Quatnity#" & $client, $message, $size[2], $size[3],$size[0], $size[1], 16+4+2, "courier",11,100)

sleep(2000)

$size=wingetPos( "YYYYMMDD TIME System name, Sym, Contracts , Price , Quatnity#" & $client )

Link to comment
Share on other sites

I had this working now it fails and I dont know why.

this will only run once before it gives an error

D:\5\autoit\wingetpos.au3 (24) : ==> Subscript used with non-Array variable.:

$width=$size[2]

$width=$size^ ERROR

#include <String.au3>

#include <file.au3>

#include <array.au3>

$client=" Titan " & @CRLF

$height=845

$width=801

$xposition=0

$yposition=120

$minus=""

$sysloop=0

$oldlines=0

$filenme=("d:\4\pr5.txt")

$message = "hello"

$lines=3

Dim $aRecords

Dim $Size[4]

do

SplashTextOn("YYYYMMDD " & $client, $message, $width,20+($lines*15),$xposition,$yposition, 16+4+2, "courier",11,100)

sleep(1000)

$size=wingetPos( "YYYYMMDD TIME System name, Sym, Contracts , Price " & $client )

$width=$size[2]

$height=$size[3]

$xposition=$size[0]

$ypostion=$size[1]

;$size=wingetPos( "" )

;MsgBox(0,"$size",$size[0] & " " & $size[1])

;MsgBox(0,"$size","X:" & $size[0] & " y:" & $size[1] & " w:" & $size[2] & " H:" & $size[3])

sleep(1500)

$L=$L+1

UNTIL $L=2

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...