Results 1 to 26 of 26

Thread: simple problem with mobile pc applicaiton

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    simple problem with mobile pc applicaiton

    i have developed a form based application for mobile pc. i have kept the form small, so that i dont occupy all the screen. however still it is occuping all the space and i cant use the typewriter to enter values. help me about this

  2. #2
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    make sure you have set the window state to normal, and dont expicitly in your set the size of the window to be bigger than you want it.


    maybe try putting in the form_load
    me.height = 200
    me.width = 200

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: simple problem with mobile pc applicaiton

    Frankly, you have very little space on a PDA, and that is how it will have to be.

    If you feel that you have sufficient space for your controls and the keyboard, then that is good. If you don't have enough space, you will have to split the controls onto different "forms".

    I put the forms bit in quotes because I still don't believe that using more than one form is a good idea. Instead, use one form with different panels on it. Any controls on the panel will move with the panel, so if you move a single panel into the screen area, all the controls will move with it. The organizational plan then is to swap panels in and out as needed. Set the left property to 0 on all panels, and the top porperty to 300, or so. Then when you want to show a panel, you simply need to change the top property to 0.

    The advantage to this is that it is really fast. There is almost not time cost in swapping panels, whereas there is a potentially significant cost to loading forms (I think Strider posted another alternative that could work, as well).

    In either case, have the panel or the form fill the screen, but put the controls above the area where the keyboard will go. If you don't have enough room for that, then you will need multiple screens.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    Re: simple problem with mobile pc applicaiton

    Thanks shaggy

    i have a task... my applicaiton will be running all the time (like system clock) .... when employee shift time start ( ie: now = emp_shift_start_time) then the application should show emp authentication screen (where employee will enter username & password )... then the applicaiton will load all the current day task for the employee into a dataset...... and when the first task start time begin (ie: now = task_start_time) then that task will be shown .. and when the task expected completion time start (ie: now= task_expected_completion_time) then a DONE button will appear so that employee can press it to confirm task completion.... and when the task end time being (ie: now = task_end_time) .. that task and DONE button should disappear.. and application should move to next task..

    i have few questions

    1. how should i make my application run all the time (like system closk). so only administrator can stop it and users can't stop it
    2. I try to use timer's tick event..but its not working why?
    3. how to iterates through the records in the dataset tables? ( in VB6 we have recordset.movenext facility)
    4. any more ideas that you people want to share?


    Thanks in Advance

    --------------------------------------------------------------------
    If you have a 1$ and I have a 1$, by exchanging them we still have 1$
    But.....
    If you have an idea and I have an idea, by exchanging them we have 2 ideas

  5. #5
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    1. In the form_closing of the main form capture the event 'e' and set this to e.Cancel = True.
    This will prevent the user from closing the application, so all you need to do is put in a check to see if the user logged in is an administrator if so let they can stop it

    2. Can you explan more what you are trying to do with the timer.
    Are you settings the timer enabled to true (timer1.enabled = True)

    3. To iterate throught dataset you need to specify the tables you want to look at then iterate through each row. if you are not writing back to the table it is better to use a datareader
    Dim l_ctr As Integer = 0
    While l_ctr < myds.Tables("TableName").Rows.Count - 1
    myds.Tables("TableName").rows(l_ctr).column("ColumnName")
    Loop

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    Re: simple problem with mobile pc applicaiton

    Thank strider

    can u give info about this

    1. example of using datareader to get records one-by-one from a single table
    2. i want my application to be visible always on the top of any other application. otherwise when user press X button on main screen, my application will be hidden,,,this is not allowed..
    3. any info about notification ASP for .NET

  7. #7
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    1. Dim selectString As String = "SELECT * FROM tbl_Name"
    Dim cmd As OleDbCommand = New OleDbCommand(selectString, DatabaseConnection.getInstance.connection())
    Dim reader As OleDbDataReader = cmd.ExecuteReader()

    'Loop through the resultant data selection and add the data value
    'for each respective column in the table.
    While (reader.Read())
    listview1.items.add(reader.Item("ColumnName")) 'or reader.Item(0)
    End While
    reader.Close()

    2. look into SHFullScreen. I have attached a sample class below, its just a matter of calling these methods. Note though most work PocketPC 2003 but only some work if you are targeting a Windows CE Device other than the PPC2003

    VB Code:
    1. Imports System.Runtime.InteropServices
    2.  
    3. Public Class BarControl
    4.  
    5.     <DllImport("coredll.dll", EntryPoint:="GetForegroundWindow", SetLastError:=True)> Private Shared Function GetForegroundWindow() As IntPtr
    6.     End Function
    7.  
    8.     <DllImport("aygshell.dll", EntryPoint:="SHFullScreen", SetLastError:=True)> Private Shared Function SHFullScreen(ByVal hwndRequester As IntPtr, ByVal dwState As Integer) As Boolean
    9.     End Function
    10.  
    11.     <DllImport("coredll.dll", EntryPoint:="EnableWindow")> Private Shared Function EnableWindow(ByVal hwnd As IntPtr, ByVal bEnable As Boolean) As Boolean
    12.     End Function
    13.  
    14.     <DllImport("coredll.dll", EntryPoint:="FindWindow")> Private Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
    15.     End Function
    16.  
    17.     Private Const SHFS_SHOWSTARTICON As Integer = &H10
    18.     Private Const SHFS_HIDESTARTICON As Integer = &H20
    19.     Private Const SHFS_HIDESIPBUTTON As Integer = &H8
    20.     Private Const SHFS_SHOWSIPBUTTON As Integer = &H4
    21.     Private Const SHFS_SHOWTASKBAR As Integer = &H1
    22.     Private Const SHFS_HIDETASKBAR As Integer = &H2
    23.  
    24.     Private Shared Function SetTaskBarEnabled(ByVal bEnabled As Boolean) As Boolean
    25.         Dim hwnd As IntPtr = FindWindow("HHTaskBar", Nothing)
    26.  
    27.         If Not hwnd.Equals(IntPtr.Zero) Then
    28.             If bEnabled Then
    29.                 Return EnableWindow(hwnd, True)
    30.             Else
    31.                 Return EnableWindow(hwnd, False)
    32.             End If
    33.         End If
    34.         Return True
    35.     End Function
    36.  
    37.     Private Shared Function SetTaskbarVisible(ByVal visible As Boolean) As Boolean
    38.         Dim hwnd As IntPtr = FindWindow("HHTaskBar", Nothing)
    39.  
    40.         If Not hwnd.Equals(IntPtr.Zero) Then
    41.             If visible Then
    42.                 Return SHFullScreen(hwnd, SHFS_SHOWTASKBAR)
    43.             Else
    44.                 Return SHFullScreen(hwnd, SHFS_HIDETASKBAR)
    45.             End If
    46.         End If
    47.     End Function
    48.  
    49.     Private Shared Function SetStartButtonVisible(ByVal visible As Boolean) As Boolean
    50.         Dim hwnd As IntPtr = GetForegroundWindow()
    51.  
    52.         If Not hwnd.Equals(IntPtr.Zero) Then
    53.             If visible Then
    54.                 Return SHFullScreen(hwnd, SHFS_SHOWSTARTICON)
    55.             Else
    56.                 Return SHFullScreen(hwnd, SHFS_HIDESTARTICON)
    57.             End If
    58.         End If
    59.     End Function
    60.  
    61.     Private Shared Function SetSIPVisible(ByVal visible As Boolean) As Boolean
    62.         Dim hwnd As IntPtr = GetForegroundWindow()
    63.  
    64.         If Not hwnd.Equals(IntPtr.Zero) Then
    65.             If visible Then
    66.                 Return SHFullScreen(hwnd, SHFS_HIDESIPBUTTON)
    67.             Else
    68.                 Return SHFullScreen(hwnd, SHFS_HIDESIPBUTTON)
    69.             End If
    70.         End If
    71.     End Function
    72.  
    73.  
    74.     Public Shared Sub ShowTaskBar()
    75.         SetTaskBarEnabled(True)
    76.         SetTaskbarVisible(True)
    77.     End Sub
    78.  
    79.     Public Shared Sub HideTaskBar()
    80.         SetTaskbarVisible(False)
    81.         SetTaskBarEnabled(False)
    82.     End Sub
    83.  
    84.  
    85.     Public Shared Sub ShowSIP()
    86.         SetSIPVisible(True)
    87.     End Sub
    88.  
    89.     Public Shared Sub HideSIP()
    90.         SetSIPVisible(False)
    91.     End Sub
    92.  
    93.     Public Shared Sub HideStartButton()
    94.         SetStartButtonVisible(False)
    95.     End Sub
    96.  
    97.     Public Shared Sub ShowStartButton()
    98.         SetStartButtonVisible(True)
    99.     End Sub
    100.  
    101. End Class

    3. No idea about asp notification for .Net. What exactly are you looking for

  8. #8

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    Re: simple problem with mobile pc applicaiton

    Sorry strider, i have not put my question clearly...here is what actually i want

    1. i have data in xml file. it has only one table. i want to read data from it, one record at a time, till the end of table. how to do it efficiently?

    2. i am developing application using VB.NET. I support SHfullScreen is for eVB. what is the alternative for VB.NET.

    3. there is one notification API for eVB, is there anything similar to it for VB.NET.

    4. you can check my project rrequirement in my previous post. there is one important feature i need in my application. We know that if we open other applicaiton on pocket pc, our application (its form ) will be hidden. What i need is that for a particular timer event, my application window should appear on the screen , no matter which application is presently top-most on the screen. how to do this? this is the real heart of my applicaiton....

  9. #9
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    1. If you are importing from xml it may be better to use a dataset as the dataset has a feature where you can read data in from an xml file to the dataset and vice versa.

    Dim l_myDs As New DataSet
    l_myDs.readXML(fileName)
    l_myDS.WriteXML(fileName)

    2. the code for the SHfullScreen works in CF.net as i have used this in several projects. it disables the taskbar and startmenu so the user cannot launch any other application hence preventing yours from being put in the background.

    3. Have no idea what notification API is. Done very little EVB

    4. Should be answered as part 2

  10. #10
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    this site may help answer some of your question and give you sample code

  11. #11

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    Re: simple problem with mobile pc applicaiton

    thanks strider!!!

    1.can u explain...the below code...that you write in sample class

    <DllImport("coredll.dll", EntryPoint:="FindWindow")> Private Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
    End Function

    Private Const SHFS_SHOWSTARTICON As Integer = &H10
    Private Const SHFS_HIDESTARTICON As Integer = &H20

    -- here what is <dllimport > and &H10

    2. i want to BEEP or play sound when timer reaches a certain time.. i am using beep function, but no sound is coming... any other alternative to make a big alarm sound.

    3. when i use your SHfullscreen functions i can hide START button, but still the VOLUME icon, phone icon, etc are visible in top. how to hide them....the problem is that if we dont hide them, then user can click on them and then we he click the taskbar, the start button is again appearing, which is completly destroying the purpose of using SHFULLSCREEN.

    4. i want to store just hour and minute in my database. but if we use date/time datatype, seconds are automatically get 00. however when i convert table into xml, the time is ok, but it is taking as today's date in date portion of variable. i just want hour and minute in my data. .. i also dont want to use string or integer variables...

  12. #12
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    1. Here the code is using the core.dll which is located on the device. Coredll.dll is the main system dll for Windows CE and contains Win32 API functions, such as those shown in the code (Hiding SIP, Taskbar etc) and more.
    Look at microsoft site to find other function such as playing sounds and running threads etc.

    2. Should be answered as part of the first question..

    3. Answer you cant hide then, but disabling the taskbar and startmenu disables their functionality so if the user clicks on them it does NOTHING. This all works for me by simply in my main controller class of the application adding the following code
    VB Code:
    1. Dim bc As New BarControl
    2.         bc.HideStartButton()
    3.         bc.HideTaskBar()
    4.         bc.HideSIP()
    Beware you need to enable all of these before exiting the appilcation otherwise they will stay disabled

    4. It you want to extract part of the time use the substring function to just get the HH:MM part of the time or check out FormatDateTime() in .NET
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  13. #13

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    A big thanks

    thanks

  14. #14

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    Re: simple problem with mobile pc applicaiton

    Oops!

    everything is working fine if we disable as per your code, BUTTTTT .. if the pocket pc is having phone facility and if you press phone button..then phone dialer is coming........how to disable this also........

    2. what is the most efficient and easiest way to tranfer my XML file from my desktop pc to pocker pc and vice-versa. this i have to do atleast 2 times a week.. after installing the application....

    my application will be storing the data in a xml file, this file we will get and generate reports..so we need to copy / collect xml files from all the pocket pcs (about 30 in different locations of city) atleast 2 times a week...

  15. #15
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    1. No idea, never needed to do it as i dont work with pocket pc's. Use other WinCE devices

    2. If you write your own FTP class using the winnet.dll, you could transfer them over GPRS to s server location. You could also buy this implementation from www.sapphire-solutions.co.uk

    Or if you want to transfer them to a laptop that you carry around with you, you could use the desktop.communications of the opennetcf library where you can write an application to copy files to/from the device
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  16. #16

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    Re: simple problem with mobile pc applicaiton

    Another big problem !!!!!!!

    my pocket pc, as normal, go to sleep if not in activity for some time, and then my applicaiton, even though working, is not displaying on my device screen and even the alert is not ringing... i want to make sure that my application displays on screen , etc everytime. how to do ?????

    any programming options to make pocket pc not to go into sleep.

  17. #17
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: simple problem with mobile pc applicaiton

    How do you move the panels?



    Quote Originally Posted by Shaggy Hiker
    Frankly, you have very little space on a PDA, and that is how it will have to be.

    If you feel that you have sufficient space for your controls and the keyboard, then that is good. If you don't have enough space, you will have to split the controls onto different "forms".

    I put the forms bit in quotes because I still don't believe that using more than one form is a good idea. Instead, use one form with different panels on it. Any controls on the panel will move with the panel, so if you move a single panel into the screen area, all the controls will move with it. The organizational plan then is to swap panels in and out as needed. Set the left property to 0 on all panels, and the top porperty to 300, or so. Then when you want to show a panel, you simply need to change the top property to 0.

    The advantage to this is that it is really fast. There is almost not time cost in swapping panels, whereas there is a potentially significant cost to loading forms (I think Strider posted another alternative that could work, as well).

    In either case, have the panel or the form fill the screen, but put the controls above the area where the keyboard will go. If you don't have enough room for that, then you will need multiple screens.

  18. #18
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    Panel1.Location = New Point(10, 10)

    of instead of moving panels just hide and show them when needed

    panel1.visible = True/False
    panel1.bringtotop
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  19. #19
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: simple problem with mobile pc applicaiton

    Yeah...but it is abit annoying to keep shifting it out of the way when you are fiddling with the rest...

  20. #20
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    i rarely use many panels in that way instead i user many forms....

    i have found the best way to use forms is to have a controller class which creates an instance(Singleton Pattern) of each form while the splash screen is being displayed. then pass in a reference of this controller class to each form. now you will have no loading time assosicated with swapping forms.



    if u are using the many panels just make the size of the form big in the dev environment and make all you controls and when you are happy how they work then place them on top of each other
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  21. #21

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    62

    Re: simple problem with mobile pc applicaiton

    no solution to my problem yet!!!!!!!!!!!!

    i want to make my pocket pc never sleep and also the disable stop button.... to close the application, we MUST have to hard reset it..... any idea

  22. #22
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: simple problem with mobile pc applicaiton

    Quote Originally Posted by Strider
    1. No idea, never needed to do it as i dont work with pocket pc's. Use other WinCE devices

    2. If you write your own FTP class using the winnet.dll, you could transfer them over GPRS to s server location. You could also buy this implementation from www.sapphire-solutions.co.uk

    Or if you want to transfer them to a laptop that you carry around with you, you could use the desktop.communications of the opennetcf library where you can write an application to copy files to/from the device
    How do you use the opennetcf library???

    i need to copy files from my pc to my pocket pc....

  23. #23
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    there is a library (dll) that you can download here

    this file will allow you do various things on the device from a desktop pc



    download a sample here
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  24. #24
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: simple problem with mobile pc applicaiton

    Cheers,

    got it working now...

    I have just not realised how difficult working with a PPc is untill now...

  25. #25
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: simple problem with mobile pc applicaiton

    well its lucky you are not using EVB....what a *****
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  26. #26
    Lively Member
    Join Date
    Jan 2007
    Location
    Austin, TX
    Posts
    120

    Re: simple problem with mobile pc applicaiton

    Strider - I used your code from Sept of 04, and it worked AWESOME!!! you saved me a bunch of time!
    Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width