tags:

views:

35

answers:

1

Hi I am trying to use the watchdog for an Icop voretex86 board. However, the code does nothing. Am I using the senmessage of coredll.dll in in the right way? my code:

    [System.Runtime.InteropServices.DllImport("coredll.dll")]
    public static extern int SendMessage(IntPtr hWnd, WM Msg, int wParam, int lParam);

    public enum VK : int
    {
         setTimeoutTo1b = 0x9c,
         time = 5,
         resetb = 0xc0
    }

    public enum WM
    {
        setTimeOut = 0x84a,
        setTimeoutTo1a = 0x84b,
        reseta = 0x841
    }

    private void button3_Click(object sender, EventArgs e)
    {
        SendMessage((IntPtr)this.Handle, WM.setTimeOut, (int)VK.time, 0);
        SendMessage((IntPtr)this.Handle, WM.setTimeoutTo1a, (int)VK.setTimeoutTo1b, 0);

    }
A: 

Usage looks OK, though I don't know about the values you are passing. Try looking at P/Invoke for the example.

Does it give you an error?

Shaihi