Jump to content

Convert tiny VB Script to au3


Recommended Posts

I just want to be able to hide the start button from some of the users on my 2003 terminal server and I tracked this down.

It's a pretty small script, would anyone mind translating it for me, please? Posted Image

Anytime I try one of these myself (5 or 6 times) it's always a disaster.

I the functions are simple enough, but I'm completely lost with most of those declare commands

Thanks,

Kenny

Private Declare Function FindWindow Lib "user32" Alias _
   "FindWindowA" (ByVal lpClassName As String, _
   ByVal lpWindowName As String) As Long
   
Private Declare Function FindWindowEx Lib "user32" Alias _
   "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
   ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

Private Declare Function ShowWindow Lib "user32" _
    (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long


Public Function hideStartButton()
   'This Function Hides the Start Button'
   OurParent& = FindWindow("Shell_TrayWnd", "")
   OurHandle& = FindWindowEx(OurParent&, 0, "Button",  _
    vbNullString)
   ShowWindow OurHandle&, 0
End Function

Public Function showStartButton()
   'This Function Shows the Start Button'
   OurParent& = FindWindow("Shell_TrayWnd", "")
   OurHandle& = FindWindowEx(OurParent&, 0, "Button", _
        vbNullString)

   ShowWindow OurHandle&, 5
End Function
Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Here's my feble attempt that I thought might work using "Shell_TrayWnd" from the script as the window title.

Didn't work though.

hideStartButton()
Func hideStartButton()
   ;This Function Hides the Start Button
   $Start = WinGetHandle("Shell_TrayWnd", "")
   $Btn = ControlGetHandle($Start, "", "[CLASS:BUTTON]")
   ControlHide($Start,"",$Btn)
   Sleep(8000)
   ControlShow($Start,"",$Btn)
EndFunc
Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Thanks dan worked perfect! I appreciate the help

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

I know, I made the menu pretty worthless with GPO/Scripts anyway but just wanted to hide it for effect.

It's a really locked down profile for a terminal server.

I could disable the win key in the registry system wide but I don't think it's neccesary.

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...