No announcement yet.

program display orientation on PC startup- help needed

  • Filter
  • Time
  • Show
Clear All
new posts

  • program display orientation on PC startup- help needed


    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.

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

  • #2

    I was able to get PSremote to remember it's location by holding shift and closing the window as outlined here:

    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
      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
        Maybe I'll whip something up for this on Monday, if there's still a need.


        • #5
          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
            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


            • #7
              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:

              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
                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.