-

   rss_forum_sources_ru

 - e-mail

 

 -

 LiveInternet.ru:
: 29.07.2007
:
:
: 80

:


( ) .

, 04 2020 . 19:13 +
Bubaylo: .
. , . Edit , ... . ?
- Hook...
    public delegate int GetMsgProc(int nCode, int wParam, ref Message msg);
    private IntPtr HookHandle;
    private GetMsgProc ProcessMessagesCallback;
    IntPtr hInstance;
    IntPtr form;
    IntPtr ThreadID;
    private void SetHook()
    {
    int PiD = 0;
    form = FindWindow("ThunderRT6FormDC", " ");
    IntPtr hInstance = (IntPtr)Win32.User32.GetWindowLong(form, Win32.User32.GWL_HINSTANCE);
    ThreadID = (IntPtr)Win32.User32.GetWindowThreadProcessId(msvb_tool, ref PiD);
    WinInputHook hook = new WinInputHook(form , ThreadID, hInstance);
    }
    class WinInputHook : IDisposable
    {
    public delegate int GetMsgProc(int nCode, int wParam, ref Message msg);
    /// Handle for the created hook.
    private readonly IntPtr HookHandle;
    private readonly GetMsgProc ProcessMessagesCallback;
    public WinInputHook(IntPtr whnd, IntPtr theadID, IntPtr inst)
    {
    int it = theadID.ToInt32();
    // Create the delegate callback:
    this.ProcessMessagesCallback = new GetMsgProc(ProcessMessages);
    // Create the keyboard hook:
    this.HookHandle = SetWindowsHookEx(HookId.WH_CALLWNDPROC, this.ProcessMessagesCallback, inst, it); // . HookHandle = 0 .
    }
    private int ProcessMessages(int nCode, int wParam, ref Message msg)
    {
    MessageBox.Show("URA!!!"); //
    }
    }
    ? ? WM_INITDIALOG, =) , ... , . , hook .

https://forum.sources.ru/index.php?showtopic=420971&view=findpost&p=3842578

:  

: [1] []
 

:
: 

: ( )

:

  URL