Form not visible when started from runas compiled script

Use this forum to ask questions before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
User avatar
amplexus
Posts: 2
Joined: Wed Jan 13, 2016 2:08 am

Form not visible when started from runas compiled script

Post by amplexus » Tue Mar 26, 2019 6:37 am

Hello,

I have a form that both needs runas credentials as elevation before running.
therefore I found and followed this article : https://www.sapien.com/blog/2017/01/19/ ... nistrator/
Now the issue is as follows: when I open PowerShell with runas and start the elevated exe all is normal and the form is displaying properly. (pic normal)
When I compile it in PowerShell studio the form starts but the form(layout) isn't visible. just a window with a 'print screen' of whatever is open at that moment. (pic elevated)... the 2 black stripes in the image are always present on the same place)
However it seems the controls are there (clicking the righthand top corner closes the exe).
I already with a pause in the beginning of the starter.exe and do a $form.refresh in the $form_Load without success.
All tips are welcome.
Bob
Attachments
Normal.PNG
Normal.PNG (6.73 KiB) Viewed 11514 times
Eleveted.PNG
Eleveted.PNG (51.61 KiB) Viewed 11514 times

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Form not visible when started from runas compiled script

Post by davidc » Tue Mar 26, 2019 7:10 am

I believe this is a .NET bug which involves Run As and Elevation. Refer to the following post:

viewtopic.php?f=12&t=12728
David
SAPIEN Technologies, Inc.

User avatar
Alexander Riedel
Posts: 7021
Joined: Tue May 29, 2007 4:43 pm

Re: Form not visible when started from runas compiled script

Post by Alexander Riedel » Tue Mar 26, 2019 7:47 am

This forum section is reserved for customer service requests. For product issues please post in the corresponding product forum or in the trial support forum as needed.
In either case make sure you provide the requested version and OS information.
[Topic moved by moderator]
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
amplexus
Posts: 2
Joined: Wed Jan 13, 2016 2:08 am

Re: Form not visible when started from runas compiled script

Post by amplexus » Wed Mar 27, 2019 6:34 am

Many Thanks for the feedback davidc !