trademaid Posted April 29, 2008 Share Posted April 29, 2008 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 More sharing options...
Drew Posted April 29, 2008 Share Posted April 29, 2008 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 More sharing options...
trademaid Posted April 29, 2008 Author Share Posted April 29, 2008 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 More sharing options...
trademaid Posted May 6, 2008 Author Share Posted May 6, 2008 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 More sharing options...
trademaid Posted May 6, 2008 Author Share Posted May 6, 2008 problem solved window descriptions didnt match Link to comment Share on other sites More sharing options...
MikeP Posted May 6, 2008 Share Posted May 6, 2008 Here is your issue : $size=wingetPos( "YYYYMMDD TIME System name, Sym, Contracts , Price " & $client ) $size isn't filled because the title is wrong typed.. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now