Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
- [reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
- $GUI = New-Object System.Windows.Forms.Form
- $GUI.Text = "Compliance Checker"
- $GUI.Name = "ComplianceC"
- $GUI.DataBindings.DefaultDataSourceUpdateMode = 0
- $GUI.ClientSize = New-Object System.Drawing.Size(500,349)
- #$objIcon = [System.IconExtractor]::Extract("C:\Windows\System32\shell32.dll", $IconIndexNo, $true)
- #shell32 ddores imageres pifmgr accessibilitycpl mmcndmgr mmres netcenter netshell networkexplorer pnidui sensorscpl setupapi wmploc
- #ieframe dmdskres dsuiext mstscax wiashext comres autoplay comctl32 filemgmt xwizards compstui mstsc actioncentercpl aclui wpdshext
- #good ones : sensorscpl compstui ieframe wiashext comres actioncentercpl aclui filemgmt
- $objIcon = [System.Drawing.Icon]::ExtractAssociatedIcon("C:\Windows\System32\actioncentercpl.dll")
- $GUI.Icon = $objIcon
- $label = New-Object Windows.Forms.Label
- $label.Location = New-Object Drawing.Point 50,30
- $label.Size = New-Object Drawing.Point 200,15
- $label.text = "Enter your name and click the button"
- $textfield = New-Object Windows.Forms.TextBox
- $textfield.Location = New-Object Drawing.Point 50,60
- $textfield.Size = New-Object Drawing.Point 200,30
- $button = New-Object Windows.Forms.Button
- $button.text = "Greeting"
- $button.Location = New-Object Drawing.Point 100,90
- $button.add_click({
- $label.Text = "Hello " + $textfield.text
- })
- $GUI.controls.add($button)
- $GUI.controls.add($label)
- $GUI.controls.add($textfield)
- $GUI.ShowDialog()| Out-Null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement