Results 1 to 7 of 7

Thread: Keep window on top

  1. #1
    FLAC PatO's Avatar
    Join Date
    Dec 2000
    Location
    Afton MN
    Posts
    1,120

    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. #2
    Super Moderator xBrady's Avatar
    Join Date
    Apr 2004
    Location
    USA
    Posts
    3,687
    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.

  3. #3
    FLAC PatO's Avatar
    Join Date
    Dec 2000
    Location
    Afton MN
    Posts
    1,120
    Quote 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?

  4. #4
    Super Moderator xBrady's Avatar
    Join Date
    Apr 2004
    Location
    USA
    Posts
    3,687
    Quote 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.

  5. #5
    FLAC PatO's Avatar
    Join Date
    Dec 2000
    Location
    Afton MN
    Posts
    1,120
    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?

  6. #6
    FLAC PatO's Avatar
    Join Date
    Dec 2000
    Location
    Afton MN
    Posts
    1,120
    Quote 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?

  7. #7
    Super Moderator xBrady's Avatar
    Join Date
    Apr 2004
    Location
    USA
    Posts
    3,687
    Quote 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.

Similar Threads

  1. Onscreen keyboard
    By gti in forum Map Monkey
    Replies: 40
    Last Post: 06-14-2008, 11:00 PM
  2. Alpine City Cruise
    By Hell-Stopper in forum RR Skins
    Replies: 170
    Last Post: 02-22-2007, 11:05 PM
  3. iGuidance 2.x auto-run shortcut
    By ziggyrama in forum GPS
    Replies: 1
    Last Post: 08-13-2005, 07:05 PM
  4. SpeakEasy Voice Recognition - Release 0.9.1
    By ruairi in forum Software & Software Development
    Replies: 11
    Last Post: 06-03-2005, 06:19 PM
  5. Replies: 0
    Last Post: 04-08-2005, 06:07 AM

Bookmarks

Posting Permissions

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