********************************************************************** *** Differences between normal Win32-API and WindowsCE ********************************************************************** Time-stamp: <26/05/01 21:50:22 keuchel@w2k> The differences are not well documented. This documentent tries to summarize some of them. I started this too late so a lot of my discoveries are missing. ********************************************************************** *** API Functions ********************************************************************** ANSI-Functions are generally not supported. You need wrappers for this. Can be ugly in message stuff and struct args. Key-translations are poorly supported. You have to setup your own tables for this. Pipes are not supported. There is no current directory. All paths must be abolute. Many GDI funcs like Arc(), Pie() etc are missing. There are also Bitmap functions missing. SetTextAlign() is missing. Window updates might be delayed. ---------------------------------------------------------------------- FillRect() The documentation says that (HBRUSH) (COLOR_WINDOW+1) is possible, but it does not work. ERROR_INVALID_HANDLE! ---------------------------------------------------------------------- CreateWindow() Many flags might not be supported. RichText is not supported in MFC. Edit controls are limited as usual. Some owner-drawn stuff is not supported. ---------------------------------------------------------------------- WaitForSingleObject() This might hang for no apparent reason. You might have to use an interval other than INFINITE in a loop to prevent this. ---------------------------------------------------------------------- GlobalALloc() etc These are missing in WCE211. You can use the corresponding LocalXX functions/defines/typedefs. ---------------------------------------------------------------------- SetViewPortOrg()/SetWindowOrg() These are not implemented or do nothing. You have to offset yourself when scrolling! Might be best to draw to a memory device context and blit it to the window. Then you can adjust destx and desty according to the scroll position. Otherwise you have to change the drawing code. ---------------------------------------------------------------------- CreateProcess() Lots of unsupported parameters. ---------------------------------------------------------------------- GetModuleHandle() The pointer (to an EXE-Header) is not in committed memory. The section is only reserved and I dont know how to map ROM dll headers into this section. With a normal file one might alloc and unprotect the section and read the header with normal file functions. ---------------------------------------------------------------------- VirtualQuery() Some sections that are marked as readable generate an access violation when actually read. This might be the strange protected server libraries (PSL). There are not functions to query or alloc or protect memory in another process. You can only read memory, but you have to know what you want. CodeSections seem to be writable with WriteProcessMemory() without unprotecting them first. ---------------------------------------------------------------------- ToUnicode() Not supported. ---------------------------------------------------------------------- ToAscii() Not supported. ---------------------------------------------------------------------- VkKeyScan() Not supported. ---------------------------------------------------------------------- MapVirtualKeyW() Only map type 2 is supported!!! Map-type 0 returns 0! ---------------------------------------------------------------------- SetCurrentDirectory()/GetCurrentDirectory() Not supported. ---------------------------------------------------------------------- SetWindowLong() Setting styles does not seem to work in WinCE2.11 (tcl/tk). Need test program. ---------------------------------------------------------------------- SetParent() Does not seem to work in WinCE2.11 (tcl/tk). Need test program. ---------------------------------------------------------------------- SetMenu() Not supported. Only a menubar is supported. It is not dynamically changable like a normal menu and is a child-window, which means calculation of the main window must be different! You probably need a frame window which contains the menu-bar and the old main window as a child window when you want to port a program. This might produce problems with the original message handling etc. In complex programs, this might be a major task! ---------------------------------------------------------------------- TerminateProcess() Not supported. See exit(). ---------------------------------------------------------------------- GetSystemTime() The milli member might be zero. This is strange as GetTickCount() returns millis (but since start of system). ---------------------------------------------------------------------- FindFirstFile()/FindNextFile() Does not return "." and ".." ---------------------------------------------------------------------- CreateFile() The PocketPC emulator creates directories when using OPEN_EXISTING and the path does not exist. You end up with lots of empty directories when a program tries to open non-existing files in several places. Really ugly bug. ROM files cannot be opened. Files on disk shadow ROM files. ROM files/dlls cannot be directly opened. ---------------------------------------------------------------------- ********************************************************************** *** Winsock ********************************************************************** There seems to be no support for hosts/services files. The resolvers seems to rely on DNS. Sockets are zero-based integers. ---------------------------------------------------------------------- getservbyname() Not supported. ---------------------------------------------------------------------- getsockopt() RCV_BUFSIZE returns 0 (on some systems?) ---------------------------------------------------------------------- ********************************************************************** *** Windows Messages ********************************************************************** Non-client messages are generally not supported. ---------------------------------------------------------------------- WM_KEYDOWN WinCE does not send the scancode. The Jornada 720 sends it, but it is not documented for WinCE 3.0 ---------------------------------------------------------------------- WM_ENTERSIZEMOVE/WM_EXITSIZEMOVE Not supported. ---------------------------------------------------------------------- WM_GETMINMAXINFO Not supported. ---------------------------------------------------------------------- WM_NCHITTEST Not supported. ---------------------------------------------------------------------- WM_MOUSEACTIVATE Not supported. ********************************************************************** *** C runtime ********************************************************************** There is a lot missing in the C runtime. File-descriptor io and most time stuff is missing. Some essential string funcs are missing. WCE211 has no strdup(). ---------------------------------------------------------------------- exit() Under WinCE2.11, it does not always terminate the program correctly. Might hang the machine. ---------------------------------------------------------------------- fileno() Returns the HANDLE of the file, not an fd. ---------------------------------------------------------------------- createthread() Not supported.