How to Hide SIP button?

G

Guest

Hi!
I have two panels on a form. Panel1 displays the list view(no user-inpout required) and Panel2 displays a detailview(user can change the data). Panel1 has two menu items for editing or creating new records. Panel doesn't have any menuitems. Now I would like to hide/remove the SIP icon when Panel1 is visible and show the icon when Panel2 is visible.

I am using:

[DllImport("aygshell.dll")]
static extern uint SHFullScreen(IntPtr hwndRequester, uint dwState);

[DllImport("coredll.dll")]
static extern IntPtr FindWindow(string LPClassName, string LPWindowName);

and

SHFullScreen(hWnd, SHFS_HIDESIPBUTTON);
SHFullScreen(hWnd, SHFS_SHOWSIPBUTTON);

I am calling the function to hide the SIP in Form_Load but when the app runs, the icon flashes and then appears on the form. I have tried to call this function in other events with no success.

When I call these functions from a menu item click event, the icon is hidden/shown.
Can anyone tell me what I am missing or should be doing?
Thanks for your time!
Regards,
Kumar
 
G

Graham McKechnie

Raj,

Try

if ( inputpanel.Enabled)
inputpanel.Enabled = false; // etc..

You will need a dummy menu and an inputpanel on your form and find an event
of your liking to call it.

Graham


Raj Kumar said:
Hi!
I have two panels on a form. Panel1 displays the list view(no user-inpout
required) and Panel2 displays a detailview(user can change the data). Panel1
has two menu items for editing or creating new records. Panel doesn't have
any menuitems. Now I would like to hide/remove the SIP icon when Panel1 is
visible and show the icon when Panel2 is visible.
I am using:

[DllImport("aygshell.dll")]
static extern uint SHFullScreen(IntPtr hwndRequester, uint dwState);

[DllImport("coredll.dll")]
static extern IntPtr FindWindow(string LPClassName, string LPWindowName);

and

SHFullScreen(hWnd, SHFS_HIDESIPBUTTON);
SHFullScreen(hWnd, SHFS_SHOWSIPBUTTON);

I am calling the function to hide the SIP in Form_Load but when the app
runs, the icon flashes and then appears on the form. I have tried to call
this function in other events with no success.
 
P

Peter Foot [MVP]

You can do this by invoking the SHFullScreen API call. You'll need to pass
in a handle to your form window, you can do this by P/Invoking GetCapture
after calling Capture = true on the form e.g.

this.Capture = true;
IntPtr hwnd = GetCapture();
this.Capture = false;

[DllImport("coredll.dll")]
private static extern IntPtr GetCapture();

Then pass this handle and the SHFS_HIDESIPBUTTON constant to SHFullScreen

[DllImport("aygshell.dll")
private static extern bool SHFullScreen(IntPtr hwnd, int flags);

int SHFS_HIDESIPBUTTON = 0x8;

SHFullScreen(hwnd, SHFS_HIDESIPBUTTON);


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Raj Kumar said:
Graham,
This code snippet will only help in 'showing' or 'hiding' the Input
Panel(keyboard). What I want to do is hide the icon itself with the arrow
next to it in the bottom-right of the screen. I believe it has to be done
with some API calls, but I am unable to figure out, when and how I should
make those calls!
Thanks for responding though,
Kumar

Graham McKechnie said:
Raj,

Try

if ( inputpanel.Enabled)
inputpanel.Enabled = false; // etc..

You will need a dummy menu and an inputpanel on your form and find an
event
of your liking to call it.

Graham


Raj Kumar said:
Hi!
I have two panels on a form. Panel1 displays the list view(no
user-inpout
required) and Panel2 displays a detailview(user can change the data).
Panel1
has two menu items for editing or creating new records. Panel doesn't
have
any menuitems. Now I would like to hide/remove the SIP icon when Panel1
is
visible and show the icon when Panel2 is visible.
I am using:

[DllImport("aygshell.dll")]
static extern uint SHFullScreen(IntPtr hwndRequester, uint dwState);

[DllImport("coredll.dll")]
static extern IntPtr FindWindow(string LPClassName, string
LPWindowName);

and

SHFullScreen(hWnd, SHFS_HIDESIPBUTTON);
SHFullScreen(hWnd, SHFS_SHOWSIPBUTTON);

I am calling the function to hide the SIP in Form_Load but when the app
runs, the icon flashes and then appears on the form. I have tried to call
this function in other events with no success.
When I call these functions from a menu item click event, the icon is hidden/shown.
Can anyone tell me what I am missing or should be doing?
Thanks for your time!
Regards,
Kumar
 
G

Graham McKechnie

Raj,

Sorry Raj, I misunderstood your question. Looks like Peter has the answer
for you.

Graham

Raj Kumar said:
Graham,
This code snippet will only help in 'showing' or 'hiding' the Input
Panel(keyboard). What I want to do is hide the icon itself with the arrow
next to it in the bottom-right of the screen. I believe it has to be done
with some API calls, but I am unable to figure out, when and how I should
make those calls!
Thanks for responding though,
Kumar

Graham McKechnie said:
Raj,

Try

if ( inputpanel.Enabled)
inputpanel.Enabled = false; // etc..

You will need a dummy menu and an inputpanel on your form and find an event
of your liking to call it.

Graham


Raj Kumar said:
Hi!
I have two panels on a form. Panel1 displays the list view(no
user-inpout
required) and Panel2 displays a detailview(user can change the data). Panel1
has two menu items for editing or creating new records. Panel doesn't have
any menuitems. Now I would like to hide/remove the SIP icon when Panel1 is
visible and show the icon when Panel2 is visible.
I am using:

[DllImport("aygshell.dll")]
static extern uint SHFullScreen(IntPtr hwndRequester, uint dwState);

[DllImport("coredll.dll")]
static extern IntPtr FindWindow(string LPClassName, string LPWindowName);

and

SHFullScreen(hWnd, SHFS_HIDESIPBUTTON);
SHFullScreen(hWnd, SHFS_SHOWSIPBUTTON);

I am calling the function to hide the SIP in Form_Load but when the
app
runs, the icon flashes and then appears on the form. I have tried to call
this function in other events with no success.
When I call these functions from a menu item click event, the icon is hidden/shown.
Can anyone tell me what I am missing or should be doing?
Thanks for your time!
Regards,
Kumar
 

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