Hiding SIP Icon Revisited


T

Terry

I have been using the FindWindow function to get the handle to the
ms_sipbutton and using SetWindowPos to hide it. This has worked well
in Windows Mobile 2003 SE, but with a new test PDA (Dell 51v) running
Windows Mobile v5.0, it no longer works. Has anyone had experience
with this yet and found a workaround. Thanks, Terry.
 
Ad

Advertisements

P

Peter Foot [MVP]

Across all versions of Pocket PC you should use SHFullScreen API with the
SHFS_HIDESIPBUTTON constant. The function isn't sticky though so you have to
call it whenever your form comes back into focus from another form or
MessageBox.

[DllImport("aygshell.dll", SetLastError=true)]
private static extern bool SHFullScreen(IntPtr hwnd, int state);

[Flags()]
public enum FullScreenFlags
{
ShowTaskbar = 0x1,
HideTaskbar = 0x2,
ShowSipButton = 0x4,
HideSipButton = 0x8,
ShowStartIcon = 0x10,
HideStartIcon = 0x20,
}

Peter
 
T

Terry

Thanks for the rapid reply. I had already tried this method in
WM2003SE and it didn't do anything. I tried it again in WM5 and it
still doesn't do anything. That's why I used the alternate method.
Thanks for your help. Terry.
 
P

Peter Foot [MVP]

Hi, I'm surprised it didn't work as I've used it in both PPC2003 and v5.0
code. I'd check that the hwnd you are passing in is valid, I used the
Capture / GetCapture method to get it for the form.

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net

Terry said:
Thanks for the rapid reply. I had already tried this method in
WM2003SE and it didn't do anything. I tried it again in WM5 and it
still doesn't do anything. That's why I used the alternate method.
Thanks for your help. Terry.

Across all versions of Pocket PC you should use SHFullScreen API with the
SHFS_HIDESIPBUTTON constant. The function isn't sticky though so you have
to
call it whenever your form comes back into focus from another form or
MessageBox.

[DllImport("aygshell.dll", SetLastError=true)]
private static extern bool SHFullScreen(IntPtr hwnd, int state);

[Flags()]
public enum FullScreenFlags
{
ShowTaskbar = 0x1,
HideTaskbar = 0x2,
ShowSipButton = 0x4,
HideSipButton = 0x8,
ShowStartIcon = 0x10,
HideStartIcon = 0x20,
}

Peter
 
T

Terry

I'm using the same code and it's definitely returning a valid handle.


Friend Function GetHwnd(ByVal Form As Form) As IntPtr
Form.Capture = True
Dim hWnd As IntPtr = GetCapture()
Form.Capture = False
Return hWnd
End Function

Friend Sub ShowSIP(ByVal pFormHwnd As IntPtr, ByVal pVisible As
Boolean)
SHFullScreen(pFormHwnd, IIf(pVisible,
FullScreenFlags.ShowSipButton, FullScreenFlags.HideSipButton))
End Sub

' From my form:

ShowSIP(GetHwnd(Me), False)

BTW, is there any way to disable the irritating security prompt
(unknown publisher) every time I launch my project?

Thanks, Terry.
 
Ad

Advertisements

Ad

Advertisements


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