But, when you package a script, be sure to retain the STA mode settings.Ĭlick Deploy and in the Packager section, click Settings and then Engine Settings. Luckily, PowerShell Studio detects when your form includes an STA mode dependent control and runs it in STA mode. For example: :: SetText( "Paste this text to the clipboard" ) Packaging and STA mode: Form with TopMost property set to True.Īlso, static methods of the Clipboard class require STA mode.DataGridView with Ctrl + C to copy text in cells.The following control features require STA mode. If you’re interested in the details, see Processes, Threads, and Apartmen ts in the Microsoft Developer Center. I will not go into the detail, but you need not concern yourself with the inner workings of COM objects, other than to remember that STA is required for some of the GUI controls to function correctly. STA (Single Threaded Apartment) and MTA (Multi-Threaded Apartment) determine how a process manages legacy COM objects and their communication with multiple threads. Follow on our forums, a user asked why certain controls didn’t function correctly or threw an error when he unchecked the STA option in PowerShell Studio.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |