Click here to Skip to main content
16,008,719 members
Home / Discussions / C#
   

C#

 
QuestionHelp getting Sacl information from AllDirectories and Files. Pin
Twdeveloper17-Feb-11 7:42
Twdeveloper17-Feb-11 7:42 
AnswerRe: Help getting Sacl information from AllDirectories and Files. Pin
Wendelius17-Feb-11 8:40
mentorWendelius17-Feb-11 8:40 
GeneralRe: Help getting Sacl information from AllDirectories and Files. Pin
#realJSOP17-Feb-11 9:41
professional#realJSOP17-Feb-11 9:41 
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 
Hi,

Thanks for the response.

I believe I am misunderstanding something, my code is below, can you tell me what I am doing wrong?




using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Net;
using Strings;
using System.IO;
using System.Text.RegularExpressions;
using System.Net.Mail;
using System.Threading;
using System.Diagnostics;
using System.Runtime.InteropServices;



namespace GenericTester
{
    public partial class Form1 : Form
    {
        private static uint SC_RESTORE = 0xF120;
        private static uint SC_MAXIMIZE = 0xF030;
        private static uint SC_MINIMIZE = 0xF020;
        private static uint WM_SYSCOMMAND = 0x0112;
        
        [DllImport("user32.dll")]
        public static extern bool PostMessage(IntPtr hWnd, [MarshalAs(UnmanagedType.U4)] uint Msg, IntPtr wParam, IntPtr lParam);

        [DllImport("User32.Dll", EntryPoint = "PostMessageA")]
        static extern bool PostMessage(IntPtr hWnd, uint msg, int wParam, int lParam);

        [DllImport("user32.dll", EntryPoint = "FindWindowA")]
        public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

        [DllImport("user32.dll")]
        static extern byte VkKeyScan(string ch); 

     
        public Form1()
        {
            InitializeComponent();
           
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

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

            const int WM_KEYUP = 0x101;

           
            Thread.Sleep(3000);
            Process[] processes = Process.GetProcessesByName("javaw");

            foreach (Process p in processes)
            {

                IntPtr pFoundWindow = p.MainWindowHandle;
                PostMessage(pFoundWindow, WM_KEYDOWN, VkKeyScan("{F2}"), 0);
                

            }
            MessageBox.Show("Done");
            
        }

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 
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 

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.