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

Comments

Please log in to comment

Community Chosen Answer

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?
Answered 04/06/2011 by: VBScab
Red Belt

Please log in to comment
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
nice work, I'll have a look at that this afternoon [:D]
Answered 04/06/2011 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
Just send money...
Answered 04/06/2011 by: VBScab
Red Belt

Please log in to comment
0
Don't have any! I'm only a poor permie, not a rich contractor like you [;)]
Answered 04/06/2011 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
That's an urban myth. Contractor's accountants are rich...
Answered 04/06/2011 by: VBScab
Red Belt

Please log in to comment
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
Answered 04/07/2011 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
Dim objWShell
Set objWShell = CreateObject("WScript.Shell")

objWShell.run "cmd /c """ & Session.SourcePath("TARGETDIR") & "\Install.exe""",2,True
Answered 04/07/2011 by: reds4eva
Second Degree Blue Belt

Please log in to comment
0
thanks, I wasn't asking how to do it! just moaning about it[;)]
Answered 04/08/2011 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
I guess you have to take away one point from Mr Dean then ;)
Answered 04/08/2011 by: AngelD
Red Belt

Please log in to comment
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

Answered 04/22/2011 by: Nomi1985
Senior Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity