Click here to Skip to main content
       

C#

 
GeneralRe: Fibonacci sequence PinprofessionalManfred R. Bihy22-Apr-13 22:08 
AnswerRe: Fibonacci sequence PinmemberPIEBALDconsult22-Apr-13 15:40 
AnswerRe: Fibonacci sequence PinmemberPIEBALDconsult22-Apr-13 16:02 
AnswerRe: Fibonacci sequence PinmvpAbhinav S22-Apr-13 18:01 
AnswerRe: Fibonacci sequence PinprotectorPete O'Hanlon22-Apr-13 19:48 
AnswerRe: Fibonacci sequence PinprofessionalKenneth Haugland22-Apr-13 22:00 
AnswerRe: Fibonacci sequence PinmemberClifford Nelson24-Apr-13 15:49 
QuestionThrow NullReferenceException in SendKeys.Send() Pinmembertikcireviva22-Apr-13 3:49 
Hi, I have encounted a NullReferenceException problem while using SendKeys.

'TestWinAPI.vshost.exe' (Managed): Loaded 'C:\TestWinAPI\bin\Debug\TestWinAPI.exe', Symbols loaded.
'TestWinAPI.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
A first chance exception of type 'System.NullReferenceException' occurred in System.Windows.Forms.dll

 
When I enable the exception capture, it shows the exception is being raised in SendKeys
        private void btnAllinOne_Click(object sender, EventArgs e)
        {
            int hwnd = 0;
            IntPtr hwndChild = IntPtr.Zero;
 
            if (tbxProc.Text.Length == 0)
            {
                MessageBox.Show("empty process string"); return;
            }
 
            hwnd = FindWindow(null, tbxProc.Text);
            if (hwnd == 0)
            {
                if (MessageBox.Show("Couldn't find the " + tbxProc.Text + " application. Do you want to start it?", "TestWinAPI", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
 
                }
            }
            else
            {
                SetForegroundWindow(hwnd);
 
                SendKeys.Send(tbxEditText.Text + "{ENTER}"); // <=== Exception happens here
            }
        }
 
Anyone knows why is that?
AnswerRe: Throw NullReferenceException in SendKeys.Send() PinmvpEddy Vluggen22-Apr-13 4:56 
AnswerRe: Throw NullReferenceException in SendKeys.Send() PinmemberAlan N22-Apr-13 5:49 
QuestionDatabind won't work for Combobox and Checkbox Pinmemberyuifox22-Apr-13 3:08 
AnswerRe: Databind won't work for Combobox and Checkbox PinmvpEddy Vluggen22-Apr-13 4:58 
GeneralRe: Databind won't work for Combobox and Checkbox Pinmemberyuifox22-Apr-13 11:46 
AnswerRe: Databind won't work for Combobox and Checkbox PinmvpEddy Vluggen23-Apr-13 10:35 
QuestionManipulating taskbar right click applicatin menu PinprofessionalAndreas X21-Apr-13 23:09 
AnswerRe: Manipulating taskbar right click applicatin menu PinmvpEddy Vluggen22-Apr-13 0:32 
GeneralRe: Manipulating taskbar right click applicatin menu PinprofessionalAndreas X22-Apr-13 1:31 
AnswerRe: Manipulating taskbar right click applicatin menu PinprofessionalRichard Deeming22-Apr-13 1:48 
GeneralRe: Manipulating taskbar right click applicatin menu [modified] PinprofessionalAndreas X22-Apr-13 7:15 
QuestionCode-Behind doesn't show Pinmemberlarsp77721-Apr-13 22:56 
AnswerRe: Code-Behind doesn't show PinmvpOriginalGriff21-Apr-13 23:06 
AnswerRe: Code-Behind doesn't show PinmvpEddy Vluggen22-Apr-13 0:30 
GeneralRe: Code-Behind doesn't show Pinmemberlarsp77722-Apr-13 0:35 
GeneralRe: Code-Behind doesn't show PinprotectorPete O'Hanlon22-Apr-13 0:43 
GeneralRe: Code-Behind doesn't show Pinmemberlarsp77722-Apr-13 1:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web01 | 2.8.140721.1 | Last Updated 23 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid