3

I am trying to use sendmessage of user32.dll in an embedded windows ce5.0 computer the same simple program that I made only for testing the user32 in embedded is working on my windows xp computer. the app and the dll are in the same folder.

the message I get when it is in win ce5.0 is : Can't find Pinvocke DLL 'user32.dll'

the code : (I find it in the web and used it to try the sendmessage)

    private int SC_MONITORPOWER = 0xF170;
    private int WM_SYSCOMMAND = 0x0112;

    [DllImport("user32.dll")]

    private static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);
    private void button3_Click(object sender, EventArgs e)
    {
        SendMessage(this.Handle.ToInt32(), WM_SYSCOMMAND, SC_MONITORPOWER, 2);
    }

can anyone help me with this?

stl
  • 41
  • 1
  • 2

2 Answers2

3

SendMessage is defined in coredll.dll in Windows CE. See this link:

http://www.pinvoke.net/default.aspx/coredll.SendMessage

TheFogger
  • 2,399
  • 1
  • 20
  • 22
0

Please see user32.dll used instead of coredll.dll in WINCE

Behzad Ebrahimi
  • 992
  • 1
  • 16
  • 28