Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. events on PocketPc's

events on PocketPc's

Scheduled Pinned Locked Moved C#
question
14 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Not Active

    No, there is no way to get events in an EVENT DRIVEN Windows application. :rolleyes:

    H Offline
    H Offline
    Heath Stewart
    wrote on last edited by
    #5

    Actually, in Windows CE there really isn't an easy way of doing it, and no single way I've seen documented or have used that would work like hooking messages in Windows (the real kind :)). The easiest way is probably to use Control.Capture, which is supported in the .NET CF. Only one window can capture the mouse, however, but you can get mouse events to fire for windows that are not your own. In most cases, you'll need to override WndProc and handle these yourself as windows messages. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]

    P N 2 Replies Last reply
    0
    • H Heath Stewart

      Actually, in Windows CE there really isn't an easy way of doing it, and no single way I've seen documented or have used that would work like hooking messages in Windows (the real kind :)). The easiest way is probably to use Control.Capture, which is supported in the .NET CF. Only one window can capture the mouse, however, but you can get mouse events to fire for windows that are not your own. In most cases, you'll need to override WndProc and handle these yourself as windows messages. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]

      P Offline
      P Offline
      pat270881
      wrote on last edited by
      #6

      Sorry but i do not exactly know how you mean that? I read the API of the System.Windows.Forms.Control class but i do not exactly know how i can use this for my problem? Regards patrick

      H 1 Reply Last reply
      0
      • H Heath Stewart

        Actually, in Windows CE there really isn't an easy way of doing it, and no single way I've seen documented or have used that would work like hooking messages in Windows (the real kind :)). The easiest way is probably to use Control.Capture, which is supported in the .NET CF. Only one window can capture the mouse, however, but you can get mouse events to fire for windows that are not your own. In most cases, you'll need to override WndProc and handle these yourself as windows messages. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #7

        Maybe I misunderstood, but I thought he wanted button click events or app load events from a custom built app (your app). In which case they are just easy to retrieve as any Windows app.

        H 1 Reply Last reply
        0
        • N Not Active

          Maybe I misunderstood, but I thought he wanted button click events or app load events from a custom built app (your app). In which case they are just easy to retrieve as any Windows app.

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #8

          Judging from a previous question, I think he wants when any event happens. But I could be wrong, too. I guess we both need a little more clarification, huh? It definitely helps when we get a problem description that consists of more than "I need X" or "It doesn't work". Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]

          P 1 Reply Last reply
          0
          • P pat270881

            Sorry but i do not exactly know how you mean that? I read the API of the System.Windows.Forms.Control class but i do not exactly know how i can use this for my problem? Regards patrick

            H Offline
            H Offline
            Heath Stewart
            wrote on last edited by
            #9

            You simply set the Capture property of any control you want to capture mouse events to true. Look over the Control.Capture property documentation. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]

            P 1 Reply Last reply
            0
            • H Heath Stewart

              Judging from a previous question, I think he wants when any event happens. But I could be wrong, too. I guess we both need a little more clarification, huh? It definitely helps when we get a problem description that consists of more than "I need X" or "It doesn't work". Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]

              P Offline
              P Offline
              pat270881
              wrote on last edited by
              #10

              Yes, Mr. Stewart understood me in the right way. I do not need it for a custom application. If an event on the PocketPc arises, doesn't matter if a button is pressed, a program is started or something else, i should get be noticed so i can make a screen shot. regards pat

              1 Reply Last reply
              0
              • H Heath Stewart

                You simply set the Capture property of any control you want to capture mouse events to true. Look over the Control.Capture property documentation. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]

                P Offline
                P Offline
                pat270881
                wrote on last edited by
                #11

                This is a little bit irritating, because i want to implement it in a generic way, and so i cannot set the property of a control to true or false or? - Or do i not understood you in a correct way`? regards pat

                H 1 Reply Last reply
                0
                • P pat270881

                  This is a little bit irritating, because i want to implement it in a generic way, and so i cannot set the property of a control to true or false or? - Or do i not understood you in a correct way`? regards pat

                  H Offline
                  H Offline
                  Heath Stewart
                  wrote on last edited by
                  #12

                  You really should read about the Control.Capture property. Setting this on a control causes the control to receive mouse events from anywhere on the desktop regardless of whether or not your control has the focus. This is about as generic as it gets. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]

                  M 1 Reply Last reply
                  0
                  • H Heath Stewart

                    You really should read about the Control.Capture property. Setting this on a control causes the control to receive mouse events from anywhere on the desktop regardless of whether or not your control has the focus. This is about as generic as it gets. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]

                    M Offline
                    M Offline
                    mathon
                    wrote on last edited by
                    #13

                    Hello @Mr. Stewart: Are you sure that the solution with the Control.Capture property works for the whole PocketPc? - because i developed a little solution with this, and i only get a solution for a specific application? Can you please give me a further hint, how you meant that?? thanks in advance regards pat

                    H 1 Reply Last reply
                    0
                    • M mathon

                      Hello @Mr. Stewart: Are you sure that the solution with the Control.Capture property works for the whole PocketPc? - because i developed a little solution with this, and i only get a solution for a specific application? Can you please give me a further hint, how you meant that?? thanks in advance regards pat

                      H Offline
                      H Offline
                      Heath Stewart
                      wrote on last edited by
                      #14

                      Have you actually read the documentation for the Control.Capture property? It states that a background window will only receive events for messages passed to its visible client area. Only a foreground window can receive events for the desktop client area. You need to read the documentation. If this isn't suitable, then you'll need to read through the Windows CE / Pocket PC documentation on http://msdn.microsoft.com/library[^]. Search for APIs that may work. Control.Capture is really your only option in .NET without having to P/Invoke or create an RCW. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups