|
Within your .NET Compact Framework application you can handle the OnSize event for your form, when the device changes orientations it will cause the form to be resized and by comparing the the width to height ratio you can determine if the device is in portrait or landscape mode.
On a Windows Mobile 5.0 or higher device you may also like to investigate the SystemState.DisplayRotation property (http://msdn2.microsoft.com/en-us/library/microsoft.windowsmobile.status.systemstate.displayrotation.aspx[^])
Windows Mobile Development blog
http://www.christec.co.nz/blog/
|
|
|
|
|
Hi Christopher,
The only event I found that has anything to do with the size is Resize. However, this event is not raised when orientation changes. None of the other events look useful to me.
Any other ideas?
Thanks,
CodingYoshi
|
|
|
|
|
Hi CodingYoshi,
CodingYoshi wrote: The only event I found that has anything to do with the size is Resize. However, this event is not raised when orientation changes. None of the other events look useful to me.
Hmm what operating system/mobile device type are you targeting?
Hope this helps,
Christopher Fairbairn
Windows Mobile Development blog
http://www.christec.co.nz/blog/
|
|
|
|
|
Hi Guy
I Had doen this in my project. we want to create a custom event eith Platform Invoke.
i means like this
u create this P/Invoke mthoed
[DllImport("coredll.dll", SetLastError=true)]
private static extern int ChangeDisplaySettingsEx(
string lpszDeviceName,
byte[] lpDevMode,
IntPtr hwnd,
CDS dwflags,
IntPtr lParam);
after create a DEMODE class like this
internal class DEVMODE
{
public const short Size = 192;
private byte[] mData;
public DEVMODE()
{
mData = new byte[Size];
BitConverter.GetBytes((short)Size).CopyTo(mData, 68);
}
public byte[] ToByteArray()
{
return mData;
}
public DM Fields
{
get
{
return (DM)BitConverter.ToInt32(mData, 72);
}
set
{
BitConverter.GetBytes((int)value).CopyTo(mData, 72);
}
}
public int DisplayOrientation
{
get
{
return BitConverter.ToInt32(mData, 188);
}
set
{
BitConverter.GetBytes(value).CopyTo(mData, 188);
}
}
}
[Flags()]
internal enum DM
{
ORIENTATION = 0x00000001,
PAPERSIZE = 0x00000002,
PRINTQUALITY = 0x00000400,
COLOR = 0x00000800,
BITSPERPEL = 0x00040000,
PELSWIDTH = 0x00080000,
PELSHEIGHT = 0x00100000,
DISPLAYORIENTATION = 0x00800000,
DISPLAYQUERYORIENTATION = 0x01000000,
}
then let's crate a method , within that create object above class and call Above P/Invoke methods and pass arugs. If P/Invoke method return >0 when get success result from the OS, after get >0 u must inove ur event next line. and od ur work.
i hope this is help to you.
Thanks
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
I have Erorr message when I receving data on the net in tcpclient
in pocket pc .
I want to ask how Im receiving data on the net when i client pocket pc?
Sample Code maybe help
Thanks'
|
|
|
|
|
|
|
Hi friends ....
i have one doubt with check the mobile..suppose i can check the one mobile or phone's RSSI (Received Signal Strength Indication).Where i can get that it
Mobile Switching Center(MSC) or Signal towers or something else ....
plz tell me ur suggestion also!!!
Thanks n Advance.
raju.k
|
|
|
|
|
I created a mobile web page with an ObjectList control. The control works fine on my Treo (running windows mobile 5.0), however, the links do not work on my AT&T tilt (running windows mobile 6.0). Do I need to somehow enable javascript on my tilt or does it possibly require a configuration change for the webserver to recognize my browser? Any ideas? Thank you.
|
|
|
|
|
Hi,
If anyone can help me with the following question - I will be pleased.
I wrote an asp.net program in VS2005 - with c# code, Is there a way to surf it from the mobile?
Is it available without any additional code - or it oversevere?
many thanks,
Sarah
|
|
|
|
|
|
I am working on a project where I need to communicate with a virtual comport via bluetooth on a pocket pc 2003. I know Microsoft has a Bluetooth api, but it is only for c++. From the looks of the c++ code there are very few steps to getting a bluetooth serial port set up. Can anyone give me guidance on api/dll to use or vb code examples for the bluetooth api?? Any general help on starting a bluetooth app for a pocket pc with visual basic would also be appreciated. Thanks in advance for the help.
Erik
|
|
|
|
|
Maybe you should take a look at the 32feet[^] project.
Regards,
João Paulo Figueira
DAD MVP
|
|
|
|
|
hi am using vc++ mfc and pocket pc6.0.
i has 2 file in a same name.
1.windows\paul
2.temp\paul
i was used a code shellexecuteex to open files.
but it defaultly open windows\paul file.
to change the folder, what is the procedure?
can anybody help me?
paulraj
|
|
|
|
|
Hi paulraj,
Can you share the code you use to call ShellExecuteEx?
Windows CE (and hence Windows Mobile) have no concept of a current working directory. So for APIs such as ShellExecuteEx you need to specify the full path to the file you want to display. An exception to this rule is that some APIs will automatically look in the \windows folder if a path is not specified.
Are you by chance asking ShellExecuteEx to open "paul" instead of "\temp\paul"?
Hope this helps,
Christopher Fairbairn
Windows Mobile Development blog
http://www.christec.co.nz/blog/
|
|
|
|
|
Hi!! I just started programming a pocket pc with windows mobile 5 and using VB .NET CF. I have to do a program that conects to an e-mail account and download a .txt file. I looked for in the internet and found microsoft´s windowsmobile.pocketoutlook, but it doesn´t work with messages, only with contacts,tasks..... Also find inthehand.windowsmobile.pocketoutlook that seems to be valid for me but it costs 199$.
anyone knows if can can do this only working with MAPI or MAPIex??
Thanks a lot and excuse me for my poor english!!!
|
|
|
|
|
Have you come up with any good ideas?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
|
Hi friends, can anybody tell me anything regarding mobile programming.
Any book or e-book or any link will be of great help.
Thank you
|
|
|
|
|
tina- wrote: can anybody tell me anything regarding mobile programming.
I just found this awesome link[^].
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
hi
how to make sound & get the value of battery & memory in C# for PPC ?
thank's alot for any help
|
|
|
|
|
Have you come up with any good ideas?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Hi,
You can query the current battery details by using some Platform Invoke code to access a native system API called GetSystemPowerStatusEx2.
David Kline has a good example of how to do this via C# on his blog entry - "Is my device running on battery or AC?" available at http://blogs.msdn.com/davidklinems/archive/2005/02/10/370591.aspx[^]
With respect to the memory status. This would depend upon exactly which figure / memory statistic you want to obtain. Are you wanting to know the total RAM within your device, or the amount currently available to your application for example?
Hope this helps,
Christopher Fairbairn
Windows Mobile Development blog
http://www.christec.co.nz/blog/
|
|
|
|
|
Windows Mobile 6 Pro. Anybody know how to make skins for this?
Specifically I want to skin the phone dialer pad.
I can use C++ if neccesary but would prefer to do it in C#.
|
|
|
|
|
Have you come up with any good ideas?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|