Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Window manipulation in unity

Discussion in 'Editor & General Support' started by Jake12456, Apr 3, 2011.

  1. Jake12456

    Jake12456

    Joined:
    Feb 14, 2011
    Posts:
    11
    I am working in a CAVE system in unity3D. I have 4 windows networked together in order to manage the system. I am trying to make the windows on start up auto-place themselves on separate monitors in order to create the CAVE experience. To do this I need to have the windows begin or update with a set position to place them on different desktops on a multi-screened setup, and to have them be non full-screen and the windows not decorated. Is this possible in Unity or should I start looking into incorporating the winAPI?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,602
    Would need WinAPI if you want to position the window.
    Should not be hard though
     
  3. Jake12456

    Jake12456

    Joined:
    Feb 14, 2011
    Posts:
    11
    So I tried using winAPI and am having an issue. I am grabbing the current running process, grabbing a handle to the window, and then attempting to move it. However the handle I am getting is empty. Also when I check on any window data its null. I am however getting the process name and ID of my program so I know I AM getting the correct process. Does unity keep this info locked down? Here is my code if anyone can help.

     
  4. Jake12456

    Jake12456

    Joined:
    Feb 14, 2011
    Posts:
    11
    Ok got it. unity must do something in the background that doesn't coorelate the window handle to the process ID 1 to 1. I grabbed the forground window instead and it worked. heres the fix
     
  5. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    I can see this being handy for a lot of people. Could you put it on the wiki?
     
  6. Jake12456

    Jake12456

    Joined:
    Feb 14, 2011
    Posts:
    11
    Sorry for the late reply. If I get time I guess I'll post it. Feel free to post it if you want to.
     
unityunity