SIP button invisible

M

massimo capetola

I would like to make invisible the SIP button in my VB.net project, here is
what I do on load event of the form "frmToto"

Dim hWnd As IntPtr = FindWindow(Nothing, "frmToto")

RC = SHFullScreen(hWnd, SHFS_HIDESIPBUTTON)

The "SHFullScreen" return True, but my SIP button is still visible.

What is wrong in my code?

my API declaration:

Public Declare Function SHFullScreen Lib "aygshell" (ByVal hwndRequester As
IntPtr, ByVal dwState As Integer) As Boolean

Public Declare Function FindWindow Lib "Coredll" Alias "FindWindowW" (ByVal
lpClassName As String, ByVal lpWindowName As String) As IntPtr
 
F

Franky

Try this

private const int SHFS_HIDESIPBUTTON = 0x0008;
IntPtr hwnd = GetForegroundWindow();
SHFullScreen(hwnd, SHFS_HIDESTARTICON);


____________________
Franky
(e-mail address removed)
 
M

massimo capetola

I've tried but it'doesn't work

I' have a handle for my windows and the SHFullScreen return TRUE, but the
SIP button is still visible

I've tried to call it from onload, onactivated event and also when I click
on a button but non result

Another idea??
 
F

Franky

When you say the SIP button you talk about the button not about the gray
line? Right?
I pick the code a gave to you in my application and it work perfectly... so
i have nothing more fore you.

Sorry

____________________
Franky
(e-mail address removed)
 
G

Guest

I am trying to achieve this,
I want a the task bar (gray line) at the bottom, but don't want the SIP or the options tab,
any ideas
 
G

Guest

Hi, massim

I found this code posted to the newsgroups in August. It looks to be exactly what you need

-- Begin Code -
// SHFullScreenHelper.c
// Posted by Jim Wilson on microsoft.public.dotnet.framework.compactframewor
// on August 12, 2003

using System
using System.Runtime.InteropServices
using System.Windows.Forms
using System.Text

namespace TestAp

/// <summary
/// Provides an interface to hide and show the SIP, SIP button, and the Start button
/// </summary
public class SHFullScreenHelpe

private const Int32 SHFS_SHOWSIPBUTTON = 0x0004
private const Int32 SHFS_HIDESIPBUTTON = 0x0008
private const Int32 SHFS_SHOWSTARTICON = 0x0010
private const Int32 SHFS_HIDESTARTICON = 0x0020

private const string formWindowClassName = "#NETCF_AGL_BASE_"

[DllImport("aygshell.dll")
private static extern Int32 SHFullScreen(IntPtr hWnd, Int32 dwState)

[DllImport("coredll.dll")
private static extern IntPtr FindWindow(string className, string windowName)

[DllImport("coredll.dll")
private static extern Int32 GetClassName(IntPtr hWnd, StringBuilder className, int maxCount)

public static bool ShowStartIcon(Form f, bool bShow

Int32 dwFlag = bShow ? SHFS_SHOWSTARTICON : SHFS_HIDESTARTICON
return SHFullScreen(GetWindowHandle(f), dwFlag) != 0


public static bool ShowSIPButton(Form f, bool bShow

Int32 dwFlag = bShow ? SHFS_SHOWSIPBUTTON : SHFS_HIDESIPBUTTON
return SHFullScreen(GetWindowHandle(f), dwFlag) != 0


private static IntPtr GetWindowHandle(Form f

return FindWindow(formWindowClassName, f.Text)
}


-- End Code -

To use it, just create a class file and drop in the code. Then, call the function as follows

SHFullScreenHelper.ShowSIPButton(this, false); //This hides the SIP button (C#
SHFullScreenHelper.ShowSIPButton(this, true); //This displays the SIP button (C#

SHFullScreenHelper.ShowSIPButton(Me, False) 'This hides the SIP button (VB
SHFullScreenHelper.ShowSIPButton(Me, True) 'This shows the SIP button (VB

You can also show and hide the Start menu button as follows

SHFullScreenHelper.ShowStartButton(this, false); //This hides the Start butto
SHFullScreenHelper.ShowStartButton(this, true); //This shows the Start butto

SHFullScreenHelper.ShowStartButton(Me, False) 'This hides the Start button (VB
SHFullScreenHelper.ShowStartButton(Me, True) 'This shows the Start button (VB

Hope this helps =

Flyn

----- massimo capetola wrote: ----

I would like to make invisible the SIP button in my VB.net project, here i
what I do on load event of the form "frmToto

Dim hWnd As IntPtr = FindWindow(Nothing, "frmToto"

RC = SHFullScreen(hWnd, SHFS_HIDESIPBUTTON

The "SHFullScreen" return True, but my SIP button is still visible

What is wrong in my code

my API declaration

Public Declare Function SHFullScreen Lib "aygshell" (ByVal hwndRequester A
IntPtr, ByVal dwState As Integer) As Boolea

Public Declare Function FindWindow Lib "Coredll" Alias "FindWindowW" (ByVa
lpClassName As String, ByVal lpWindowName As String) As IntPt
 
W

Worldnet News

Is there a VB example of this?

Flynn Arrowstarr said:
Hi, massimo

I found this code posted to the newsgroups in August. It looks to be exactly what you need.

-- Begin Code --
// SHFullScreenHelper.cs
// Posted by Jim Wilson on microsoft.public.dotnet.framework.compactframework
// on August 12, 2003.

using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Text;

namespace TestApp
{
/// <summary>
/// Provides an interface to hide and show the SIP, SIP button, and the Start button.
/// </summary>
public class SHFullScreenHelper
{
private const Int32 SHFS_SHOWSIPBUTTON = 0x0004;
private const Int32 SHFS_HIDESIPBUTTON = 0x0008;
private const Int32 SHFS_SHOWSTARTICON = 0x0010;
private const Int32 SHFS_HIDESTARTICON = 0x0020;

private const string formWindowClassName = "#NETCF_AGL_BASE_" ;

[DllImport("aygshell.dll")]
private static extern Int32 SHFullScreen(IntPtr hWnd, Int32 dwState) ;

[DllImport("coredll.dll")]
private static extern IntPtr FindWindow(string className, string windowName) ;

[DllImport("coredll.dll")]
private static extern Int32 GetClassName(IntPtr hWnd, StringBuilder className, int maxCount) ;

public static bool ShowStartIcon(Form f, bool bShow)
{
Int32 dwFlag = bShow ? SHFS_SHOWSTARTICON : SHFS_HIDESTARTICON ;
return SHFullScreen(GetWindowHandle(f), dwFlag) != 0;
}

public static bool ShowSIPButton(Form f, bool bShow)
{
Int32 dwFlag = bShow ? SHFS_SHOWSIPBUTTON : SHFS_HIDESIPBUTTON ;
return SHFullScreen(GetWindowHandle(f), dwFlag) != 0;
}

private static IntPtr GetWindowHandle(Form f)
{
return FindWindow(formWindowClassName, f.Text);
}
}
}
-- End Code --

To use it, just create a class file and drop in the code. Then, call the function as follows:

SHFullScreenHelper.ShowSIPButton(this, false); //This hides the SIP button (C#)
SHFullScreenHelper.ShowSIPButton(this, true); //This displays the SIP button (C#)

SHFullScreenHelper.ShowSIPButton(Me, False) 'This hides the SIP button (VB)
SHFullScreenHelper.ShowSIPButton(Me, True) 'This shows the SIP button (VB)

You can also show and hide the Start menu button as follows:

SHFullScreenHelper.ShowStartButton(this, false); //This hides the Start button
SHFullScreenHelper.ShowStartButton(this, true); //This shows the Start button

SHFullScreenHelper.ShowStartButton(Me, False) 'This hides the Start button (VB)
SHFullScreenHelper.ShowStartButton(Me, True) 'This shows the Start button (VB)

Hope this helps =)

Flynn

----- massimo capetola wrote: -----

I would like to make invisible the SIP button in my VB.net project, here is
what I do on load event of the form "frmToto"

Dim hWnd As IntPtr = FindWindow(Nothing, "frmToto")

RC = SHFullScreen(hWnd, SHFS_HIDESIPBUTTON)

The "SHFullScreen" return True, but my SIP button is still visible.

What is wrong in my code?

my API declaration:

Public Declare Function SHFullScreen Lib "aygshell" (ByVal hwndRequester As
IntPtr, ByVal dwState As Integer) As Boolean

Public Declare Function FindWindow Lib "Coredll" Alias "FindWindowW" (ByVal
lpClassName As String, ByVal lpWindowName As String) As IntPtr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top