compact-framework

sending USSD in C#?

让人想犯罪 __ 提交于 2019-12-03 16:41:47
I want to write a simple c# application runs on windows mobile 6 which can send USSD messages Is there any library that could help me in doing this?? or is there any examples that explains how to use lineSendUSSD thanks You have to P/Invoke to access the phones TAPI functions. Have a look at this thread: Windows Mobile Developer Center 来源: https://stackoverflow.com/questions/1725860/sending-ussd-in-c

Windows Mobile - Compact Framework program as a service?

匆匆过客 提交于 2019-12-03 16:36:59
What is the best way to have my C# Compact Framework program running in the background on a Windows Mobile device ? I need to respond to different events, such as a text message arriving with a specific content. I would like not to start up any UI when the process is started, but just run in the background until UI is needed. How can this be done ? Just create the app as a Console app. If you need a message pump, you need to call Run without any parameters, and the CF doesn't have that. OpenNETCF's Application2 class in the SDF does. At that point you can raise a UI any time by creating and

Taking screenshot of a device screen using c#

天大地大妈咪最大 提交于 2019-12-03 16:07:31
Hii... Is there any way to take screenshot of the application running on WIN CE5.0 device screen. Thanxxx in advance.... using System; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Windows.Forms; using System.Drawing; using System.Drawing.Imaging; namespace ScreenShot { public class Program { enum RasterOperation : uint { SRC_COPY = 0x00CC0020 } [DllImport("coredll.dll")] static extern int BitBlt(IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, RasterOperation rasterOperation);

Convert string to double with 2 digit after decimal separator

别来无恙 提交于 2019-12-03 16:07:02
All began with these simple lines of code: string s = "16.9"; double d = Convert.ToDouble(s); d*=100; The result should be 1690.0, but it's not. d is equal to 1689.9999999999998. All I want to do is to round a double to value with 2 digit after decimal separator. Here is my function. private double RoundFloat(double Value) { float sign = (Value < 0) ? -0.01f : 0.01f; if (Math.Abs(Value) < 0.00001) Value = 0; string SVal = Value.ToString(); string DecimalSeparator = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator; int i = SVal.IndexOf(DecimalSeparator); if

How can I use OpenStreetMap in my Compact Framework App?

怎甘沉沦 提交于 2019-12-03 15:53:30
Does anyone know, how I can use OpenStreetMap inside my Compact Framework application? Is there a Framework or something like that? All I can find in their wiki is how to contribute to their project and to user their software to map data. But I want to use their maps to show the users location inside my own app. I could not find anything about using their web service or whatever I have to use to show their maps inside my application. There is a project on Google Code that wants to create a .NET library for the OpenStreetMap API. The website states that there currently is an alpha release, so

Asynchronous WebRequest with POST-parameters in .NET Compact Framework

倾然丶 夕夏残阳落幕 提交于 2019-12-03 13:03:27
问题 I'm trying to do an asynchronous HTTP(S) POST on .NET Compact Framework and I can't seem to get it working. Here's what I'm doing: private void sendRequest(string url, string method, string postdata) { WebRequest rqst = HttpWebRequest.Create(url); CredentialCache creds = new CredentialCache(); creds.Add(new Uri(url), "Basic", new NetworkCredential(this.Uname, this.Pwd)); rqst.Credentials = creds; rqst.Method = method; if (!String.IsNullOrEmpty(postdata)) { rqst.ContentType = "application/xml"

Memory profiler for .NET Compact Framework

左心房为你撑大大i 提交于 2019-12-03 12:40:29
Is there a tool I could use for profiling (memory) a .NET compact framework 3.5 application (Windows Mobile)? Thanks! Use the Remote Performance Monitor that comes with Studio. It gives snapshots of the GC heap, traceable roots and much more. Equatec supports .NET CF 3.5 Bob The CLR Profiler also comes with the CF-SDK, and allows to view the heap of a process. In contrast to Remote Performance Monitor it doesn't crash all the time ;-) 来源: https://stackoverflow.com/questions/1048939/memory-profiler-for-net-compact-framework

Two-line text button in Compact Framework

試著忘記壹切 提交于 2019-12-03 11:45:22
I want to create a two-line text button in Compact Framework. I have used every idea in this thread but without success. http://social.msdn.microsoft.com/forums/en-US/winforms/thread/626c21e0-369f-441e-b2f1-b51db633e38b If I use \n or \r\n or Environment.NewLine I get squares. I am using Compact Framework 3.5. Any idea on how to make a two-line text box? You need to set the button to allow multiple lines. This can be achieved with following P/Invoke code. private const int BS_MULTILINE = 0x00002000; private const int GWL_STYLE = -16; [System.Runtime.InteropServices.DllImport("coredll")]

How to create a full screen application in Win CE 6.0 using .NET Compact Framework 3.5?

主宰稳场 提交于 2019-12-03 08:42:51
We want our application to run in full screen mode with no title bar on a Win CE 6.0 powered device. The application is being developed using .NET Compact Framework 3.5 (C#). Any sample code or pointers to articles is appreciated. First, you have to hide the task bar via P/Invoke. Here's the C code, which should be really easy to convert : HWND hwndTaskbar = ::FindWindow(_T("HHTaskBar"), NULL); ::ShowWindow(hwndTaskbar, SW_HIDE); Once you do that, then use Screen.PrimaryScreen to determine how big your display is and resize your form to those dimensions. Use this code: public class

Can an app written with .net Compact Framework restart itself?

时光怂恿深爱的人放手 提交于 2019-12-03 08:35:55
Can an app written with .net Compact Framework restart itself? What are some of the common patterns to achieve this? I would like to have a self-updating application that restarts itself if update was done. Of course, I could have 2 .exe: one that updates and the actual app, but I would rather just have one. Absolutely. It's actually way easier to do than on the desktop. If you're using the SDF, use this: var thisName = Assembly.GetExecutingAssembly().GetName().CodeBase; var time = DateTime.Now.AddSeconds(11); Notify.RunAppAtTime(thisName, time); If you want to do it manually, you'd p/invoke