WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

WinPlaceSet of a Display Message and/or a Winbatch Dialog

Keywords:   winplaceset position window display

Question:

I have a display message box in my Winbatch script that I want to move out of the way from it's default position in the center of the window. How do I do this?

Answer:

You need two scripts. One that runs the Display dialog, and a second script, which you will launch just before the Display, that looks around for the window to appear, and then repositions it.

Here are two simple sample scripts.

Script #1 runs the second script and displays the message box.

Script #2 gets the x- and y-coordinates of a 1024x768 resolution monitor and positions the dialog accordingly:


Script #1:

run("script2.wbt","")

Display(5,"Good Luck!","Remember it's only a game")

Script #2:

x=1024.000/WinMetrics(0)
y=768.000/WinMetrics(1)
decimals(0)
x1=50*x
x2=400*x
y1=50*x
y2=375*x

while 1
if WinExist("Good Luck!")
  WinPlaceSet(@normal,"Good Luck!",strcat(x1," ",y1," ",x2," ",y2))
  ;WinPlaceSet(@normal, "Good Luck!", "180 200 820 350")
  exit
else
  TimeDelay(0.3)
endif
endwhile
Run Script #1, which launches the display and the second script.
Article ID:   W15156
File Created: 2002:09:05:13:50:08
Last Updated: 2002:09:05:13:50:08