locked
Popup window stay upfront until done RRS feed

  • Question

  • Hi,

    I have 2 popup boxes and i want for popup boxes to stay upfront for user so it doesnt hide for them behind screen or something.

    $button1 = $Shell.Popup(@“
    Please Check information below:
    Application: $app
    User: $user
    Server Name: $server
    Session State: $state
    Press OK to continue
    ”@, 0, “$app Info”, 1)
    if($button1 -eq "2")
    { 
    echo "Cancelled"
    }
    else{
    $button2 = $Shell.Popup(@“
    Application: $app
    Press OK to Reset session
    Press Cancel to Quit
    ”@, 0, “Continue?”, 1)
    }

    Anyone has any ideas of how to achieving this? Do i need to go with windows forms for this.

    thanks

    Wednesday, February 6, 2013 2:13 PM

Answers

  • (New-Object -ComObject "WScript.Shell").Popup("Message", 0, "Title", 4097)
    • Marked as answer by ImMax Wednesday, February 6, 2013 4:34 PM
    Wednesday, February 6, 2013 4:23 PM

All replies

  • (New-Object -ComObject "WScript.Shell").Popup("Message", 0, "Title", 4096)
    Wednesday, February 6, 2013 3:52 PM
  • thanks, ok so i think this is keeping it on top, but now it only has 1 OK button without cancel.

    Ideally i wanted this popup to be locked on top of users screen so they cant click back into powershell but i think this might do if i can get the cancel button.

    Wednesday, February 6, 2013 4:19 PM
  • (New-Object -ComObject "WScript.Shell").Popup("Message", 0, "Title", 4097)
    • Marked as answer by ImMax Wednesday, February 6, 2013 4:34 PM
    Wednesday, February 6, 2013 4:23 PM
  • box not popping up no errors or anythin

    I think i did something to make it break, lemme take a look here


    Edit: ok it works great, thanks
    • Edited by ImMax Wednesday, February 6, 2013 4:33 PM
    Wednesday, February 6, 2013 4:25 PM