Navigation

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Rules
    • Help

    Do more on the web, with a fast and secure browser!

    Download Opera browser with:

    • built-in ad blocker
    • battery saver
    • free VPN
    Download Opera

    [Solved]Setting Window Position (Opera 33)

    Opera for Windows
    2
    3
    400
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dacke9000
      dacke9000 last edited by

      I would very much like to know how I can reposition the Opera window position on my computer before startup. I have a laptop and have very different screen dimensions when I'm docked. I want my window positioned and sized one way when I'm docked at work and another when I'm mobile.

      I can't seem to find any registry values in order to do this and when I attempt to programmatically set the values using the SetWindowPos function from User32.dll it fails. I think that this is because Opera creates an executable for every window that it has open.

      Yes I know that I can just position the window myself with the mouse, but I have all of my other programs scripted to open and position themselves for my different profiles using a PowerShell script. It would be helpful if I could include Opera as well.

      Reply Quote 0
        1 Reply Last reply
      • A Former User
        A Former User last edited by

        Can PowerShell identify a windows by its title (like AutoIt can) instead of its executable?

        Reply Quote 0
          1 Reply Last reply
        • dacke9000
          dacke9000 last edited by

          Thank you for the push in the right direction. As far as Get-Process goes it will return to me all 6 processes (if I have 6 tabs open) but only one of them has the MainWindowTitle value set. Here is the PowerShell code that I am using to script all of my information. Hopefully it will help another.

          function GetWindowProcess() {
              Param([Parameter(Mandatory=$true, HelpMessage="The name of the process in memory (ps-list).`n")]
                    [string] $processName, 
                    [Parameter(Mandatory=$false, HelpMessage="True if you want to only affect the process with a Main Window Title (default false).`n")]
                    [bool] $useMainWindowTitle = $false)
              if ($useMainWindowTitle) {
                  return (Get-Process | Where { $_.MainWindowTitle -and $_.Name -eq $processName })
              }
              else {
                  return Get-Process -Name $processName
              }
          }
          
          [System.Diagnostics.Process] $proc = GetWindowProcess -processName 'opera' -useMainWindowTitle $true
          

          Now that I have the window process I can get it's MainWindowHandle and affect it with the aforementioned SetWindowPos function. Thanks! :yes:

          Reply Quote 0
            1 Reply Last reply
          • First post
            Last post

          Computer browsers

          • Opera for Windows
          • Opera for Mac
          • Opera for Linux
          • Opera beta version
          • Opera USB

          Mobile browsers

          • Opera for Android
          • Opera Mini
          • Opera Touch
          • Opera for basic phones

          • Add-ons
          • Opera account
          • Wallpapers
          • Opera Ads

          • Help & support
          • Opera blogs
          • Opera forums
          • Dev.Opera

          • Security
          • Privacy
          • Cookies Policy
          • EULA
          • Terms of Service

          • About Opera
          • Press info
          • Jobs
          • Investors
          • Become a partner
          • Contact us

          Follow Opera

          • Opera - Facebook
          • Opera - Twitter
          • Opera - YouTube
          • Opera - LinkedIn
          • Opera - Instagram

          © Opera Software 1995-