R
Ron Weiner
I have been having lots of fun for the last couple days trying to eradicate
the SIP button from my Pocket PC 2003SE application. I have several forms
in the application that have to have Menu bars. Part of the baggage that
(apparently) that one gets when one needs a Menu bar is the SIP button comes
along for the ride. I am using code like this (found everywhere in Google
searches) to make the SIP button disappear.
Capture = True
Dim hWnd As IntPtr = GetCapture()
Capture = False
ShowHideScreenElements(hWnd, SHFS_HIDESIPBUTTON)
I discovered, after MUCH trial and error, that I needed to place this code
the Form Load, Form Activate, and OnPaint Override events of the forms with
Menu bars. I also discovered when switching back to my form with a Menu
bar, from any other form, would cause the SIP button to reappear. I
discovered when coming back from another form, and the SIP button was
visible again, that taping on and releasing any menu item would cause the
SIP Button to disappear. AhHAa... A clue! So I started looking for a way
to dirty (?) the Menu bar in the FromActivate event. This is what I came up
with:
' Create, Display and Destroy a fake menu that dirty's the Menu Bar
Dim FakeMenu As New MenuItem
FakeMenu.Text = " "
Me.Menu.MenuItems.Add(FakeMenu)
Application.DoEvents()
Me.Menu.MenuItems.Remove(FakeMenu)
' Hide the Start Button every time the form is activated
Capture = True
Dim hWnd As IntPtr = GetCapture()
Capture = False
ShowHideScreenElements(hWnd, SHFS_HIDESIPBUTTON)
Believe it or not all of this actually WORKS! However I can't believe that
this is the best way to do it. Often times there is a noticeable flicker of
the SIP Button as the form repaints itself, probably caused by the DoEvents
line. Remove the DoEvents and the SIP button does not disappear. Does
anyone have a better way to Dirty (?) the Menu bar, or am I missing
something?
the SIP button from my Pocket PC 2003SE application. I have several forms
in the application that have to have Menu bars. Part of the baggage that
(apparently) that one gets when one needs a Menu bar is the SIP button comes
along for the ride. I am using code like this (found everywhere in Google
searches) to make the SIP button disappear.
Capture = True
Dim hWnd As IntPtr = GetCapture()
Capture = False
ShowHideScreenElements(hWnd, SHFS_HIDESIPBUTTON)
I discovered, after MUCH trial and error, that I needed to place this code
the Form Load, Form Activate, and OnPaint Override events of the forms with
Menu bars. I also discovered when switching back to my form with a Menu
bar, from any other form, would cause the SIP button to reappear. I
discovered when coming back from another form, and the SIP button was
visible again, that taping on and releasing any menu item would cause the
SIP Button to disappear. AhHAa... A clue! So I started looking for a way
to dirty (?) the Menu bar in the FromActivate event. This is what I came up
with:
' Create, Display and Destroy a fake menu that dirty's the Menu Bar
Dim FakeMenu As New MenuItem
FakeMenu.Text = " "
Me.Menu.MenuItems.Add(FakeMenu)
Application.DoEvents()
Me.Menu.MenuItems.Remove(FakeMenu)
' Hide the Start Button every time the form is activated
Capture = True
Dim hWnd As IntPtr = GetCapture()
Capture = False
ShowHideScreenElements(hWnd, SHFS_HIDESIPBUTTON)
Believe it or not all of this actually WORKS! However I can't believe that
this is the best way to do it. Often times there is a noticeable flicker of
the SIP Button as the form repaints itself, probably caused by the DoEvents
line. Remove the DoEvents and the SIP button does not disappear. Does
anyone have a better way to Dirty (?) the Menu bar, or am I missing
something?