开发者

use coedll.dll sendmessage for board watchdog

开发者 https://www.devze.com 2023-01-10 11:18 出处:网络
I am trying to use the watchdog for anIcop voretex86 board. However, the code does nothing. Am I using the senmessage of coredll.dll inin the right way?

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 wPar开发者_开发问答am, 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);

    }


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消