/build/static/layout/Breadcrumb_cap_w.png

Wise script screen location

Here's one for all you wise script guru's!

We've got a wise script that's used as a launcher for an application. Basically users select which app to run out of a choice of 3, they then get prompted to select which site database to connect to, enter their login details and the script runs the app as required.

This app is published through Citrix. The "problem" is that when the exe is launched it always appears in the centre of the screen. Not a problem when you have one screen, But a bit annoying when you have dual screens and it appears right in the middle.

So is there a way to get a wisescript created exe to launch somewhere other than the centre of the screen?

Cheers
Rich

0 Comments   [ + ] Show comments

Answers (10)

Posted by: anonymous_9363 13 years ago
Red Belt
1
I think the word "kludge" has been used already this morning but I think that's the only way you're going to achieve this.

Am I right in thinking that WS allows more or less direct access to DLL function calls? If so, you could use the Window-moving APIs (in USER32.DLL, is it?), perhaps?

EDIT:
Found this VBS which I'm sure a man of your calibre can adapt...

Maybe WMI abstracts the call, to make it simpler?
Posted by: timmsie 13 years ago
Fourth Degree Brown Belt
0
nice work, I'll have a look at that this afternoon [:D]
Posted by: anonymous_9363 13 years ago
Red Belt
0
Just send money...
Posted by: timmsie 13 years ago
Fourth Degree Brown Belt
0
Don't have any! I'm only a poor permie, not a rich contractor like you [;)]
Posted by: anonymous_9363 13 years ago
Red Belt
0
That's an urban myth. Contractor's accountants are rich...
Posted by: timmsie 13 years ago
Fourth Degree Brown Belt
0
Worked a treat but now I need a vb wrapper to call the wise launcher!

Could just convert the Launcher to hta, but that will involve far too much brain power! at least hta's don't insist on appearing in the center of the screen though.


Cheers Rich
Posted by: reds4eva 13 years ago
Second Degree Blue Belt
0
Dim objWShell
Set objWShell = CreateObject("WScript.Shell")

objWShell.run "cmd /c """ & Session.SourcePath("TARGETDIR") & "\Install.exe""",2,True
Posted by: timmsie 13 years ago
Fourth Degree Brown Belt
0
thanks, I wasn't asking how to do it! just moaning about it[;)]
Posted by: AngelD 13 years ago
Red Belt
0
I guess you have to take away one point from Mr Dean then ;)
Posted by: Nomi1985 13 years ago
Senior Yellow Belt
0
Here is how to set dialog positions all within your WiseScript. Copy/Paste the code into WiseScript Editor.


item: Remark
Text=Sample script demonstrating how to reposition a dialog at runtime.
end
item: Remark
Text=
end
item: Remark
Text=The desired X and Y position, in screen coordinates
end
item: Set Variable
Variable=XPOS
Value=100
end
item: Set Variable
Variable=YPOS
Value=100
end
item: Remark
Text=The code in the dialog script of the following dialog demonstrates
end
item: Remark
Text=how to reposition a dialog that is outside a Wizard Loop.
end
item: Custom Dialog Set
Name=Dialog outside a Wizard Loop
item: Dialog
Title=Dialog outside a Wizard Loop
Width=150
Height=150
Font Name=Helv
Font Size=8
item: Push Button
Rectangle=56 111 91 126
Enabled Color=00000000000000001111111111111111
Create Flags=01010000000000010000000000000001
Text=OK
end
item: If/While Statement
Variable=DLG_EVENT_TYPE
Value=INIT
end
item: Call DLL Function
Pathname=%SYS32%\USER32.DLL
Function Name=SetWindowPos
Argument List=33
Argument List=32
Argument List=20XPOS
Argument List=20YPOS
Argument List=22
Argument List=22
Argument List=310x205
Return Variable=3
Flags=00100000
end
item: End Block
end
end
end
item: Remark
Text=Change desired X and Y position.
end
item: Set Variable
Variable=XPOS
Value=600
end
item: Set Variable
Variable=YPOS
Value=400
end
item: Wizard Block
Direction Variable=DIRECTION
Display Variable=DISPLAY
X Position=0
Y Position=0
Filler Color=0
end
item: Remark
Text=The code in the dialog script of the following dialog demonstrates
end
item: Remark
Text=how to reposition a dialog that is inside a Wizard Loop.
end
item: Custom Dialog Set
Name=Dialog inside a Wizard Loop
Display Variable=DISPLAY
item: Dialog
Title=Dialog inside a Wizard Loop
Width=150
Height=150
Font Name=Helv
Font Size=8
item: Push Button
Rectangle=56 111 91 126
Variable=DIRECTION
Value=N
Enabled Color=00000000000000001111111111111111
Create Flags=01010000000000010000000000000001
Text=OK
end
item: If/While Statement
Variable=DLG_EVENT_TYPE
Value=INIT
end
item: Call DLL Function
Pathname=%SYS32%\USER32.DLL
Function Name=GetParent
Argument List=33
Return Variable=3HWND_DIALOG
Flags=00100000
end
item: Call DLL Function
Pathname=%SYS32%\USER32.DLL
Function Name=SetWindowPos
Argument List=30HWND_DIALOG
Argument List=32
Argument List=20XPOS
Argument List=20YPOS
Argument List=22
Argument List=22
Argument List=310x205
Return Variable=3
Flags=00100000
end
item: End Block
end
end
end
item: End Block
end

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ