Programming/C#

C# Using PostMessage

역시인생한방 2015. 3. 29. 22:40
    [DllImport("user32.dll")]
    static extern bool PostMessage(IntPtr hWnd, uint msg, int wParam, int lParam);

    const uint WM_USER_CUSTOM = WM_USER + 8423;

    public void Post()
    {
        // Get Processes
        var processes = Process.GetProcessesByName("notepad.exe");
// Main part foreach (Process p in processes) if (p.ProcessName == "notepad.exe") { PostMessage(p.MainWindowHandle, WM_USER_CUSTOM, 0, 0);
} }


출처 : http://stackoverflow.com/questions/6927431/c-sharp-using-postmessage

참고 : http://xarfox.tistory.com/45