ken82m Posted June 13, 2010 Share Posted June 13, 2010 (edited) 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? 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 commandsThanks,KennyPrivate 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 June 13, 2010 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 More sharing options...
ken82m Posted June 13, 2010 Author Share Posted June 13, 2010 (edited) 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 June 13, 2010 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 More sharing options...
DW1 Posted June 13, 2010 Share Posted June 13, 2010 This works in 2003: HideSB() Sleep(5000) ShowSB() Func ShowSB() ControlShow("[CLASS:Shell_TrayWnd]", '', "[CLASS:Button; INSTANCE:1]") EndFunc ;==>Show Func HideSB() ControlHide("[CLASS:Shell_TrayWnd]", '', "[CLASS:Button; INSTANCE:1]") EndFunc ;==>Hide AutoIt3 Online Help Link to comment Share on other sites More sharing options...
ken82m Posted June 13, 2010 Author Share Posted June 13, 2010 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 More sharing options...
Juvigy Posted June 14, 2010 Share Posted June 14, 2010 You know that just hiding it doesnt remove it? Pressing the "windows" key on the keyboard simulates a click on the hidden start button. Link to comment Share on other sites More sharing options...
ken82m Posted June 14, 2010 Author Share Posted June 14, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now