2010-08-04 41 views
1

我正在嘗試爲Icop voretex86板使用看門狗。但是,代碼什麼都不做。我是否正確使用coredll.dll的senmessage? 我的代碼:使用coedll.dll sendmessage進行板級看門狗

[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); 

    } 

回答

0

用法看起來不錯,雖然我不知道你傳遞的值做。例如,試着查看P/Invoke

它會給你一個錯誤?