Posted By: David7738 | Dec 27th, 2007 @ 12:31 AM
page 1 of 1
Comments: 9 | Views: 4555
,I could make startbutton disable with API Enablewindow in vista.
However my client ordered to hide startbutton....
I cannot find answer why Showwindow with SW_HIDE work just making start icon smaller.
this is my code,using listbox to enumerate all top-level windows.

 Private Declare Function ShowWindow Lib "user32.dll" (ByVal hWnd As Integer, ByVal nCmdShow As Integer) As Integer
    Const SW_HIDE As Integer = 0
    Const SW_SHOW As Integer = 5

'Get the process ID of the Explorer process that owns the task bar
   target_hwnd1 = FindWindow("Shell_traywnd", "")
   Call GetWindowThreadProcessId(target_hwnd1, target_process_id1)

           hwnd = FindWindow(vbNullString, sTitle)
        Call GetWindowThreadProcessId(hwnd, process_id)

        If process_id = target_process_id1 Then
            cch = GetWindowTextLength(hwnd)
            cch = cch * 2
            Temp = New String(Chr(0), cch)
            'get the windows caption
            Call GetWindowText(hwnd, Temp, Len(Temp))

            If InStr(Temp, "start") > 0 And InStr(Temp, "menu") <= 0 Then
                If Button1.Text = "Hide" Then
                    Wint = ShowWindow(hwnd, SW_HIDE)
                    Button1.Text = "Show"
                Else
                    Wint = ShowWindow(hwnd, SW_SHOW)
                    Button1.Text = "Hide"
                End If
            End If
        End If
TommyCarlier
TommyCarlier
I want my scalps!
Do you need the desktop or the taskbar? If you don't, you can just use your own application as the shell of Windows, instead of explorer.exe. This means you don't get the desktop or the taskbar, but that's ideal for kiosk applications where everything happens inside 1 window.
littleguru
littleguru
<3 Seattle
It looks like as when the start button is removed the taskbar takes over control and shows the start menu when you click in the area where the start button used to be.

Your code is removing the button - just try Spy++ while the button is removed and you will see that - but there seems to be a button image (in the taskbar) right at the position of the button.

The only way to make it work - that I have found so far - is to remove the start button and the toolbar!

I don't know why it has been implemented in this way - i can only speculate that they did it to not allow malicious programs fool people by removing the start button...
figuerres
figuerres
???
what about running the app "full screen" ??
not yet tested this in vista but in xp this works:


      private void SetupKIOSK()
      {
         // Capture the mouse
         this.Capture = true;
         ShowInTaskbar = false;
         TopMost = true;
          FormBorderStyle = FormBorderStyle.None;
         this.menuStrip1.Enabled = false;
         this.menuStrip1.Visible = false;
         Bounds = Screen.PrimaryScreen.Bounds;
         WindowState = FormWindowState.Maximized;
         ShowInTaskbar = false;
         DoubleBuffered = true;
         BackgroundImageLayout = ImageLayout.Stretch;
      }

this makes the app take over the full size of the desktop.
you can make a similar function to "undo" this when you need to restore normal windows operations.
littleguru
littleguru
<3 Seattle
now you press the windows button on your keyboard.
W3bbo
W3bbo
The Master of Baiters
David7738 wrote:
,I could make startbutton disable with API Enablewindow in vista.
However my client ordered to hide startbutton....
I cannot find answer why Showwindow with SW_HIDE work just making start icon smaller.
this is my code,using listbox to enumerate all top-level windows.


I removed the Start button in Windows XP completely (it also takes away the space it used, it's as if it was never there) by removing both "Start"/"start" texts from the Resources string tables in Explorer.exe

Dunno if it works on Vista though. Give it a shot.
littleguru
littleguru
<3 Seattle
W3bbo wrote:

David7738 wrote: ,I could make startbutton disable with API Enablewindow in vista.
However my client ordered to hide startbutton....
I cannot find answer why Showwindow with SW_HIDE work just making start icon smaller.
this is my code,using listbox to enumerate all top-level windows.


I removed the Start button in Windows XP completely (it also takes away the space it used, it's as if it was never there) by removing both "Start"/"start" texts from the Resources string tables in Explorer.exe

Dunno if it works on Vista though. Give it a shot.


What a hack...
How you did it W3bbo ? It works on vista or not ?
evildictaitor
evildictaitor
if( !succeed( try() ) ) { while(true) try(); }
littleguru wrote:
now you press the windows button on your keyboard.


I don't know if it works, but I heard there are ways to turn that off in the registry (Google/Live it).

You can also hook up to the Windows KeyDown event and suppress either the LEFT_WIN or RIGHT_WIN key strokes.
sorry but i dont know how to do that !! Could you tell me step by step or at least which registry key is or if i need any program to do it!! Thanks !!
page 1 of 1
Comments: 9 | Views: 4555
Microsoft Communities