' only ever 1 msgbox in our scenario
' else we have to check for title with GetWindowTextW
Dim hwnd As IntPtr
hwnd = Win32Api.FindWindow("Dialog", Nothing)
If IntPtr.op_Equality(hwnd, IntPtr.Zero) = False Then
Win32Api.PostMessage(hwnd, Win32Api.WM_CLOSE, 0, 0)
Win32Api.PostMessage(hwnd, Win32Api.WM_DESTROY, 0,
0)
End If
Cheers
Daniel
"Matteo Gabella" <gabu...@tin.it> wrote in message
news:bda2e795.04082...@posting.google.com...
--
Alex Feinman
---
Visit http://www.opennetcf.org
"Daniel Moth" <dmo...@hotmail.com> wrote in message
news:%23Lwz17s...@TK2MSFTNGP09.phx.gbl...
The question is will that work with YES|NO boxes etc? In my use case the
code wants to close any messagebox that happens to be up...
Cheers
Daniel
"Alex Feinman [MVP]" <publi...@alexfeinman.com> wrote in message
news:u7GTknti...@tk2msftngp13.phx.gbl...
--
Alex Feinman
---
Visit http://www.opennetcf.org
"Daniel Moth" <dmo...@hotmail.com> wrote in message
news:uIyR9Iv...@TK2MSFTNGP12.phx.gbl...
On a more serious note the code runs on our unit with no other apps [1], so
our approach is not the end of the world... Just added a comment to review
this if I ever move the code to a PocketPC...
Cheers
Daniel
[1]
http://www.zen13120.zen.co.uk/Blog/2004/08/my-cf-application-and-platform-it.html
"Alex Feinman [MVP]" <publi...@alexfeinman.com> wrote in message
news:uSiLtcwi...@TK2MSFTNGP09.phx.gbl...
here's my code... (I could not find Win32Api namespace... is it any of
your classes?)
Declare Function PostMessage Lib "user32" (ByVal hWnd As IntPtr, ByVal
Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As
Integer
Const WM_CLOSE = &H10
Const WM_DESTROY = &H2
Dim hwnd As IntPtr
Dim a As Integer
a = PostMessage(hwnd, WM_CLOSE, 0, 0)
a = PostMessage(hwnd, WM_DESTROY, 0, 0)
what's wrong?
thank you!
matteo
The Win32Api namespace is part of SDF which is found at http://opennetcf.org
-Paul
<DllImport(DllName4)> _
Public Shared Function PostMessage(ByVal hWnd As IntPtr, ByVal wMsg As
Int32, ByVal wParam As Int32, ByVal lParam As Int32) As IntPtr
End Function
Cheers
Daniel
"Matteo Gabella" <gabu...@tin.it> wrote in message
news:bda2e795.04082...@posting.google.com...
--
Alex Feinman
---
Visit http://www.opennetcf.org
"Paul Monson (BSQUARE)" <"paulmonson_7 no spam AT hotmail DOT com"> wrote in
message news:ugGR6AGj...@TK2MSFTNGP09.phx.gbl...
My Win32Api class conditionally compiles for the desktop/CE... it starts
something like this (where FULL_FRAME defined in your project properties):
#If FULL_FRAME = True Then
Private Const DllName As String = "advapi32.dll"
Private Const DllName2 As String = "kernel32.dll"
Private Const DllName3 As String = "Version.dll"
Private Const DllName4 As String = "user32.dll"
#Else
Private Const DllName As String = "coredll.dll"
Private Const DllName2 As String = "coredll.dll"
Private Const DllName3 As String = "coredll.dll"
Private Const DllName4 As String = "coredll.dll"
#End If
Cheers
Daniel
"Daniel Moth" <dmo...@hotmail.com> wrote in message
news:uHNXrVG...@tk2msftngp13.phx.gbl...