Click here to Skip to main content
15,894,460 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help getting Sacl information from AllDirectories and Files. Pin
Wendelius17-Feb-11 10:37
mentorWendelius17-Feb-11 10:37 
GeneralRe: Help getting Sacl information from AllDirectories and Files. Pin
Richard MacCutchan17-Feb-11 22:09
mveRichard MacCutchan17-Feb-11 22:09 
QuestionHelp with sendkey or postmessage Pin
turbosupramk317-Feb-11 5:00
turbosupramk317-Feb-11 5:00 
AnswerRe: Help with sendkey or postmessage Pin
musefan17-Feb-11 5:13
musefan17-Feb-11 5:13 
GeneralRe: Help with sendkey or postmessage Pin
turbosupramk317-Feb-11 5:37
turbosupramk317-Feb-11 5:37 
AnswerRe: Help with sendkey or postmessage [modified] Pin
musefan17-Feb-11 6:05
musefan17-Feb-11 6:05 
GeneralRe: Help with sendkey or postmessage Pin
musefan17-Feb-11 6:07
musefan17-Feb-11 6:07 
GeneralRe: Help with sendkey or postmessage Pin
turbosupramk317-Feb-11 7:25
turbosupramk317-Feb-11 7:25 
Hi,

Yes the process in task manager is called javaw ... the code below is the only way I can seem to get it to work? For some reason it requires the Thread.Sleep(2000) or it happens to quickly.

I would rather not use SendKeys, as I would like to send the "F2" keystroke to the window when it is minimized, any ideas?



private void button1_Click(object sender, EventArgs e)
{
    const int WM_KEYDOWN = 0x100;

    const int WM_KEYUP = 0x101;

    Process[] processes = null;
    if (Process.GetProcessesByName("javaw") != null)
    {
       processes = Process.GetProcessesByName("javaw");

    }


    foreach (Process p in processes)
    {
        IntPtr pFoundWindow = p.MainWindowHandle;

        //MessageBox.Show(p.MainWindowHandle + " " + p.MainWindowTitle);
        SetForegroundWindow(pFoundWindow.ToInt32());
        //MessageBox.Show("About to send F2 keystroke");
        Thread.Sleep(2000);
        SendKeys.Send("{F2}");
        //MessageBox.Show("Window int pointer for " + p + " is " + pFoundWindow.ToString());
        PostMessage(pFoundWindow, WM_KEYDOWN, 0x71, 0);//<-- change to 0x71, 0x74 is F5

    }

}

AnswerRe: Help with sendkey or postmessage Pin
Henry Minute17-Feb-11 6:26
Henry Minute17-Feb-11 6:26 
GeneralRe: Help with sendkey or postmessage Pin
turbosupramk317-Feb-11 7:19
turbosupramk317-Feb-11 7:19 
AnswerRe: Help with sendkey or postmessage Pin
Luc Pattyn17-Feb-11 7:39
sitebuilderLuc Pattyn17-Feb-11 7:39 
QuestionConstructing a class from a static function Pin
musefan17-Feb-11 1:37
musefan17-Feb-11 1:37 
AnswerRe: Constructing a class from a static function Pin
Xmen Real 17-Feb-11 1:45
professional Xmen Real 17-Feb-11 1:45 
GeneralRe: Constructing a class from a static function Pin
musefan17-Feb-11 2:08
musefan17-Feb-11 2:08 
GeneralRe: Constructing a class from a static function Pin
PIEBALDconsult17-Feb-11 4:27
mvePIEBALDconsult17-Feb-11 4:27 
AnswerRe: Constructing a class from a static function Pin
Not Active17-Feb-11 2:25
mentorNot Active17-Feb-11 2:25 
GeneralRe: Constructing a class from a static function Pin
musefan17-Feb-11 2:43
musefan17-Feb-11 2:43 
Questiontext file > Binary and Binary > Text file Pin
grmihel217-Feb-11 0:39
grmihel217-Feb-11 0:39 
AnswerRe: text file > Binary and Binary > Text file Pin
Ravi Sant17-Feb-11 1:15
Ravi Sant17-Feb-11 1:15 
GeneralRe: text file > Binary and Binary > Text file Pin
grmihel217-Feb-11 1:26
grmihel217-Feb-11 1:26 
AnswerRe: text file > Binary and Binary > Text file Pin
Richard MacCutchan17-Feb-11 1:15
mveRichard MacCutchan17-Feb-11 1:15 
GeneralRe: text file > Binary and Binary > Text file Pin
grmihel217-Feb-11 1:22
grmihel217-Feb-11 1:22 
GeneralRe: text file > Binary and Binary > Text file Pin
Richard MacCutchan17-Feb-11 1:46
mveRichard MacCutchan17-Feb-11 1:46 
GeneralRe: text file > Binary and Binary > Text file Pin
grmihel217-Feb-11 4:07
grmihel217-Feb-11 4:07 
GeneralRe: text file > Binary and Binary > Text file Pin
Richard MacCutchan17-Feb-11 4:24
mveRichard MacCutchan17-Feb-11 4:24 

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.