Announcement

Collapse
No announcement yet.

Keep window on top

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Keep window on top

    I've written a small app to sniff messages from WinLIRC. The app displays a 1-character window to tell me which "mode" it's in (defines the function of buttons on the remote).

    My problems is that Frodo likes being on top. And it tends to hide my window after a mouse (er, finger) click.

    How do I get my window back on top? I'm using C# (though that shouldn't matter - it's likely a sendmessage command I'll have to use). Currently, I'm passing the window handle into SetForegroundWindow in USER32.DLL, but that's not cutting the mustard. Anyone have any thoughts on this?
    http://www.jeepmp3.com/
    CarPC Stolen. Starting over.
    Ne1 recognize the avatar?

  • #2
    You just have to set the TopMost property of your form to true. So like this:
    this.TopMost = true;

    Hope that helps.
    AMD XP 2600+/512MB RAM/120GB hard drive
    Opus 150W/DVD/GPS/7" Lilliput TS/802.11g/Bluetooth
    Installed.


    -GPSSecure- - GPS Tracking
    -AltTabber2.2.2- - Handy touchscreen utility.

    Comment


    • #3
      Originally posted by xBrady
      You just have to set the TopMost property of your form to true. So like this:
      this.TopMost = true;
      That only works on windows running in the same process... Thanks for the suggestion, though.
      http://www.jeepmp3.com/
      CarPC Stolen. Starting over.
      Ne1 recognize the avatar?

      Comment


      • #4
        Originally posted by PatO
        That only works on windows running in the same process... Thanks for the suggestion, though.
        I guess I didn't understand what you are trying to do. So you have your app that sniffs messages from another app and is not staying on top? Or is it the other program that won't stay on top? I'm not seeing where you are starting another process.
        AMD XP 2600+/512MB RAM/120GB hard drive
        Opus 150W/DVD/GPS/7" Lilliput TS/802.11g/Bluetooth
        Installed.


        -GPSSecure- - GPS Tracking
        -AltTabber2.2.2- - Handy touchscreen utility.

        Comment


        • #5
          As far as this thread is concerned, my program is a standalone appliction. It has a window which I need to always keep on top. On top of Frodoplayer, at any rate.

          In 95, this was easy to do. In fact, MS removed this capability because it was a major security risk (think virus software). I'm thinking that there may be a few options, but am uncertain how to implement them, hence the question.

          A couple I can think of are: Set up a windows message to detect when focus is lost and redraw the window on top. Integrate into the same process Frodo is running and use the TopMost property (can FrodoComm/Svcs do this?). Use a timer to force it on top.

          Any other suggestions? I'm going to start digging through MSDN....
          http://www.jeepmp3.com/
          CarPC Stolen. Starting over.
          Ne1 recognize the avatar?

          Comment


          • #6
            Originally posted by xBrady
            You just have to set the TopMost property of your form to true. So like this:
            this.TopMost = true;
            Doh! That DOES work...
            I sit corrected. You da man!
            http://www.jeepmp3.com/
            CarPC Stolen. Starting over.
            Ne1 recognize the avatar?

            Comment


            • #7
              Originally posted by PatO
              Doh! That DOES work...
              I sit corrected. You da man!

              Glad you got it working.
              AMD XP 2600+/512MB RAM/120GB hard drive
              Opus 150W/DVD/GPS/7" Lilliput TS/802.11g/Bluetooth
              Installed.


              -GPSSecure- - GPS Tracking
              -AltTabber2.2.2- - Handy touchscreen utility.

              Comment

              Working...
              X