Results 1 to 8 of 8

Thread: program display orientation on PC startup- help needed

  1. #1
    Constant Bitrate
    Join Date
    Feb 2006
    Location
    NWI USA
    Posts
    133

    program display orientation on PC startup- help needed

    Hi-

    I have been researching this all afternoon. What I want to know is how to go about making a given program appear on a specific location of the monitor or monitors once it is launched. Many programs do this by default, for example winamp will open and display from the last location it was displayed before closing.

    The programs that I need to do this are:

    psremote, camera control software for canon cameras

    Capture!, mp3car forum sourced webcam software


    any ideas or links to a tutorial would be greatly appreciated

    I have set up a small 4" LCD as a secondary monitor and the only thing keeping me from being able to use that 4" exclusively to control my system is this issue.

    thanks
    current system: car2pc adapter playing aux in for a sansa fuze media player. simple. cheap. effective.

  2. #2
    Constant Bitrate
    Join Date
    Feb 2006
    Location
    NWI USA
    Posts
    133
    update-

    I was able to get PSremote to remember it's location by holding shift and closing the window as outlined here:
    http://www.pcmech.com/article/how-to...-dual-monitor/

    This method does not work for the capture! software.
    current system: car2pc adapter playing aux in for a sansa fuze media player. simple. cheap. effective.

  3. #3
    Variable Bitrate
    Join Date
    Nov 2007
    Posts
    303
    Two ideas come to mind:

    1) Write something that enumerates all open windows, finds the one you care about (by matching the window title and/or window class, for example) and then moves/sizes the window if it finds it. Then it sleeps for a few seconds... you could use WM_TIMER (or System.Windows.Forms.Timer) for example.

    You could also enumerate all running processes and look at each process' main window. You'd use Process.MainWindowHandle in .Net, I'm not sure what the native-code equivalent is.

    2) Better yet, hook window-creation of process-start, and only check after these events (or check several times after, every 250ms or so). I'm not sure how but I vagely remember looking at APIs for this several years ago. Try searching the MSDN documentation.

  4. #4
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    701
    Maybe I'll whip something up for this on Monday, if there's still a need.

  5. #5
    Constant Bitrate
    Join Date
    Feb 2006
    Location
    NWI USA
    Posts
    133
    that would be awesome, my project has pretty much been on hold lacking this fix.

    I have thought about ideally what I want, and I think it would be amazing to have a scalable window that mimics the desktop, and recalls its last settings and placement on the desktop.

    So essentially I want a mini-desktop on my desktop that is windowed and can be opened and closed like an app. It ideally would just be a smaller desktop with the start menu and icons ect accessible.

    This way instead of hacking existing software, the program thinks it is on the regular desktop and just does its normal thing. the mini desktop can be anchored wherever the user likes.

    Thanks in advance.
    current system: car2pc adapter playing aux in for a sansa fuze media player. simple. cheap. effective.

  6. #6
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    701
    I whipped up a small app. It does not try to be another desktop. This one just runs your app, but then forces it's size and position to whatever is stored in the accompanying INI file.

    All values are measured in PIXELS.

    Let me know if this will work for you. If not, I'll dig into it further.

    For testing, the included INI file will run Solitaire, force the size to be 400x400, and force the position to 100, 100.

    I can take this program a lot further if necessary. I just wanted to put a basic one out here to see if it will work for your purposes. I almost started coding a mini-desktop, but I think that would be overkill (for the moment anyway). The tricky part would be managing the app(s) that need to run in the mini-desktop. Not impossible at all, but more than I can do in 20 minutes.
    Attached Files Attached Files

  7. #7
    Variable Bitrate
    Auto Apps:loading...
    thekl0wn's Avatar
    Join Date
    Apr 2005
    Location
    PoCo, Indiana
    Posts
    284
    So, are you running the secondary display as an extended desktop?

    If so, then you just simply need to know where the display is located in reference to the primary. For example, while testing at home, I have my 10.4" TS setup as a secondary monitor that is simply an extended desktop, located at -800,0 in reference to the primary. To get a form to display just on that screen, simply dynamically place it there in the form's load event... Something like:

    Code:
    With Me
        .Location = New Point(-800,0)
        .WindowState = Maximized
    End With
    This should display the secondary form on the secondary screen, and fill it.
    Play with it, 'til it's broke.

  8. #8
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    701
    Well, I provided an app in an attempt to help someone. I got zero response, so I have no idea if it was helpful or not.

Similar Threads

  1. Replies: 7
    Last Post: 02-21-2008, 10:30 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
  •