Results 1 to 5 of 5

Thread: Windows CE API

  1. #1
    Join Date
    Feb 2009
    Posts
    81

    Windows CE API

    I am trying to develop an application in C # designed to run on Windows CE 6.0

    The problem I encounter is that I wish through this application hides the Windows taskbar ... I suppose out that the only solution for me is to use the Windows CE API.

    On windows XP I know how to use user32.dll and functions FindWindow () and SetWindowPos ().... Windows CE but I find myself before a big problem because user32.dll does not exist, trying to find the equivalent of these two fonts but without success.

    Thank you in advance.

  2. #2
    Join Date
    Mar 2008
    Posts
    258

    Re: Windows CE API

    Hi, look here, since you are a Csharpiste

    In Windows CE almost all API's are located in the coredll.dll, so you need modify your P/Invoke declarations to use coredll instead.

    Code:
    public void findCalculator()
    {
       IntPtr handle = new IntPtr(FindWindow(null,"Calculator"));
    }
    
    [DllImport("coredll.dll",EntryPoint="FindWindow")]
    public static extern int FindWindow(string lpClassName,string lpWindowName);

  3. #3
    Join Date
    Feb 2009
    Posts
    81

    Re: Windows CE API

    Thank you for your sample code, I was at least identified the dll that could help me to know coredll.

    Unfortunately without success I test my test application to hide the taskbar in Windows XP, just replace "user32.dll" with "coredll.dll" ... AC does not work, I have no error message but nothing happens.

    Here is the code that works perfectly under windows xp:

    Code:
     IntPtr handleW1; 
              uint TOGGLE_HIDEWINDOW uint.Parse = ( "80", System.Globalization.NumberStyles.HexNumber); 
              uint TOGGLE_UNHIDEWINDOW uint.Parse = ( "40", System.Globalization.NumberStyles.HexNumber); 
    
    
              [DllImport ( "User32.dll")] 
              public static extern IntPtr FindWindow (string lpClassName, string lpWindowName); 
    
              [DllImport ( "User32.dll")] 
              static extern bool SetWindowPos (IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags); 
    
    
       private void cmdShow_Click (object sender, EventArgs e) 
              ( 
                  handleW1 = FindWindow ( "Shell_traywnd", ""); 
                  SetWindowPos (handleW1, (IntPtr) 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW); 
              ) 
    
              private void cmdHide_Click (object sender, EventArgs e) 
              ( 
                  handleW1 = FindWindow ( "Shell_traywnd", ""); 
                  SetWindowPos (handleW1, (IntPtr) 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW); 
              )
    replacing user32.dll by coredll.dll does not seem enough ...
    if someone has an idea I thank in advance ...

  4. #4
    Join Date
    Mar 2008
    Posts
    232

    Re: Windows CE API

    C # code:

    Code:
    uint uint = TOGGLE_HIDEWINDOW. Parse ( "80", System. Globalization. NumberStyles. HexNumber);
    You can not do this directly in C #?
    C # code:

    Code:
    TOGGLE_HIDEWINDOW uint = 0x80;
    And also: Is it normal that you do not pass the flags SWP_NOxx?

  5. #5
    Join Date
    Feb 2009
    Posts
    81

    Re: Windows CE API

    Concerning the initialization TOGGLE_HIDEWINDOW actually because you had your way is much simpler ... (Note that I started started in c #, at the base I was doing instead of VB6 and in addition I have rarely used the API ...).

    Regarding Marshal.GetLastWin32Error () Note that I developed for the framework 2, I have the impression that GetLastWin32Error () is that the framework 3.

    I do not deny you that I still have trouble with the API, so I'm going to see on the msdn SWP_NOxx flags. I do not deny you that I am not certain to have everything, these flags are they mandatory? . But this a priori running XP I do not see why it would not work under Win CE.

    As I took against my source on the net, adapting it to my needs and I do not understand or are the values for the flags (or in my case 0x40 and 0x80). These values are the same for windows XP and windows CE?

    Thank you

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,039,392.98919 seconds with 15 queries