Click here to Skip to main content
12,897,124 members (56,419 online)

Silverlight / WPF

AnswerRe: silverlight Pin
Kenneth Haugland30-Sep-12 22:36
memberKenneth Haugland30-Sep-12 22:36 
AnswerRe: silverlight Pin
Abhinav S3-Oct-12 20:40
mvpAbhinav S3-Oct-12 20:40 
QuestionCheckk For WCF Service Running & Exit Pin
Kevin Marois29-Sep-12 9:51
memberKevin Marois29-Sep-12 9:51 
QuestionSendMessage in C# WPF Pin
dominioYP28-Sep-12 6:11
memberdominioYP28-Sep-12 6:11 
I say first that this code works with windowsFormApplication, but no work with wpf, help me please

namespace WpfApplication22
public partial class App : Application

[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
private const int APPCOMMAND_XXX = 0x80000;
private void MetodoMute(object sender, EventArgs e)
// Mute
            SendMessageW(this.Handle, WM_APPCOMMAND, this.Handle,

when I use:
private void button4_Click(object sender, RoutedEventArgs e)
    App x = new App();
    x.MetodoMute(new WindowInteropHelper(this).Handle);


not works, It's launch exception:
"Eccezione non gestita di tipo 'System.InvalidOperationException' in PresentationFramework.dll

Informazioni aggiuntive: Impossibile creare più di un'istanza System.Windows.Application nello stesso AppDomain."

how do I call a method written in App.xaml.cs from another window?
AnswerRe: SendMessage in C# WPF Pin
Pete O'Hanlon29-Sep-12 10:30
protectorPete O'Hanlon29-Sep-12 10:30 
GeneralRe: SendMessage in C# WPF Pin
dominioYP29-Sep-12 12:08
memberdominioYP29-Sep-12 12:08 
GeneralRe: SendMessage in C# WPF Pin
Pete O'Hanlon29-Sep-12 20:45
protectorPete O'Hanlon29-Sep-12 20:45 
QuestionNew to .net/ previous programming background Pin
ljv_az27-Sep-12 8:29
memberljv_az27-Sep-12 8:29 
AnswerRe: New to .net/ previous programming background Pin
Richard MacCutchan27-Sep-12 9:47
mvpRichard MacCutchan27-Sep-12 9:47 
GeneralRe: New to .net/ previous programming background Pin
ljv_az27-Sep-12 10:00
memberljv_az27-Sep-12 10:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 28 Apr 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid