On 29 Mag, 16:03, Fabien <fab_00_2...@msn.com> wrote:
> Hi,
>
> You can use FindWindow to get the handle of your window, check out
> this post on my blog:http://fabdecret.blogspot.com/2007/0...ow-handle.html
>
> BR
>
> Fabien Decret
> Windows Embedded Consultant
>
> ADENEO (ADESET)http://www.adeneo.adetelgroup.com/|http://fabdecret.blogspot.com/
>
> On 29 mai, 15:41, dbgrick <dbgr...@discussions.microsoft.com> wrote:
>
>
>
> > Here is some example code to help you post the WM_CLOSE message:
>
> > [DllImport("Coredll.dll", EntryPoint="SendMessage")]
> > private static extern int SendMessage(IntPtr hWnd, UInt32 Msg, int wParam,
> > int lParam);
>
> > private const UInt32 WM_CLOSE = 16 ;
>
> > Process myProcess; // Create your new process
>
> > // Run the media player.
>
> > SendMessage(myProcess.MainWindowHandle, WM_CLOSE, 0, 0);
>
> > I Hope this helps.
>
> > Rick D.
> > Contractor
>
> > "<ctacke/>" wrote:
> > > Post a WM_CLOSE to its main window.
>
> > > --
>
> > > Chris Tacke, Embedded MVP
> > > OpenNETCF Consulting
> > > Managed Code in an Embedded World
> > >www.OpenNETCF.com
>
> > > "Lorenzo" <lorenzo.fornare...@framenet.it> wrote in message
> > >news:(E-Mail Removed)...
> > > > Hi,
> > > > I have a main form that launch wmplayer application and play an audio
> > > > file.
> > > > I used Process.Start method to launch it.
>
> > > > My problem is that when the file is totally played , i don't know
> > > > how to close media player window programmatically?
>
> > > > Does anyone know how to do it?
> > > > Thanks in advance.- Masquer le texte des messages précédents -
>
> > - Afficher le texte des messages précédents -- Nascondi testo tra virgolette -
>
> - Mostra testo tra virgolette -
thanks for your help !
I resolved with this snippet
------------------------------------------------------
Dim nWnd As IntPtr
nWnd = GetForegroundWindow()
SendMessage(nWnd, WM_CLOSE, 0, 0)
------------------------------------------------------
i tried also with
------------------------------------------------------
Dim _ip As Integer = myProcess.MainWindowHandle()
SendMessage(_ip, WM_CLOSE, 0, 0)
------------------------------------------------------
but it seems that doesn't work.
Is there an explanation?