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
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)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
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?
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
Posted by:
timmsie
13 years ago
Posted by:
reds4eva
13 years ago
Posted by:
Nomi1985
13 years ago
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.
so that the conversation will remain readable.