Website window sizing

I'm using VS 2012 and want to create an app that opens up a specific website, however I do not want the website window opened in the maximized state. What code can I use to manipulate the window size when it opens?

To resize the Browser, it is not so simple.
Since browsers uses tab, the process returned by Process.Start may not be the process that need to be resized.
Some browser will have more than 1 process.
as example
IE will have 1 or 2 process for all tabs
Chrome will have 1 process per tab plus 3 processes.
Also, since you dont know which Browser is the default Browser, you need your code to find out
Try this code. I tested it with IE, Chrome and Safari and it worked
Imports Microsoft.Win32
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim url As String = "www.google.com"
Dim WindowSize As New Size(500, 500)
Dim P As New Process
Process.Start(url)
Threading.Thread.Sleep(1000)
Dim regkey = Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\shell\Associations\UrlAssociations\http\UserChoice", False)
Dim browserName As String = ""
If regkey IsNot Nothing Then
Dim progIdValue = regkey.GetValue("Progid").ToString()
If (progIdValue.ToString().ToLower().Contains("chrome")) Then
browserName = "chrome"
ElseIf (progIdValue.ToString().ToLower().Contains("firefox")) Then
browserName = "firefox"
ElseIf (progIdValue.ToString().ToLower().Contains("safari")) Then
browserName = "safari"
ElseIf (progIdValue.ToString().ToLower().Contains("opera")) Then
browserName = "opera"
ElseIf (progIdValue.ToString().ToLower().Contains("ie")) Then
browserName = "iexplore"
End If
End If
Dim pr = Process.GetProcesses().Where(Function(PRo) PRo.ProcessName = browserName).ToArray
For Each Browser As Process In pr
If Browser.MainWindowTitle <> "" Then
SetWindowPos(Browser.MainWindowHandle, IntPtr.Zero, 20, 20, WindowSize.Width, WindowSize.Height, 0)
End If
Next
End Sub
Public Declare Function SetWindowPos Lib "user32.dll" (hWnd As IntPtr, hWndInsertAfter As IntPtr, X As Integer, Y As Integer, cx As Integer, cy As Integer, wFlags As Integer) As Boolean
End Class

Similar Messages

  • Window sizing not saved?

    I resize a sheet in Number v3 and save it bit the careful sizing I set is not saved and a small default window size opens when I re-open the file. How can I save my window sizing as per Number 09?
    Thanks
    Gary

    Hi,
    I think window auto-tuning is enabled.
    You can disable it by running the following commend.
    netsh interface tcp set global autotuninglevel=disabled
    Hope this helps.

  • Wrap Up Window Sizing

    In UCCX 10, is it possible to modify the Wrap Up Window size. I have a customer with quite a few wrap up codes, they would like to have the window sized accordingly so all wrap up codes are visible within the window.
    Thanks
    Ben

    Thanks David, Im wondering if this is possible within Finesse, seeing that this is this way Cisco is moving towards.
    Cheers
    Ben

  • In Events, want to scroll through window-sized images...

    Searched a bit on this, and haven't found a "yes" but thought I would check to see the current thinking.
    What I was hoping to do, was utilize the Apple mouse scroll button to easily view all the photos in an event, when they were clicked on to become window-sized. I know I can use the forward and back arrow keys to wander through the set, but the mouse is much more handy (and, I'm afraid, what I was used to with PSE and a scroll-wheel mouse on the PC.) It does let me use the scroll for the thumbnail view, and I'm just hoping I'm missing a setting to allow me to scroll the full-size pictures, too?
    This is a useful tool for flipping back and forth when comparing two very similar pics, when trying to select the better one, for example.
    Thanks again in advance for all help.

    Unbelievable! 100s pf apps and not even sorted alphabetically, you just have to have free time to hunt because sony developers didnt have the time to code a simple search feature! I wish i knew this before i bought the tv I would definitely go for another brand!

  • Window sizing for PDA

    I am using RH X5. Output format is neg to the developer.
    However, how can I set the window sizing to be viewable on a PDA
    sized screen? I have minimal graphics but use a lot of tables.
    Thanks!
    Susan

    Did actually figure this out. These are the basic steps :
    Minimized the screen
    Clicked Alt and spacebar (this pops up a menu).
    Selected Move.
    Using cursor keys I arrowed down and right a couple of times (cursor starts in top left)
    Then I clicked on screen and the Desktop window showed up. I resized to where I wanted it.
    Did this process a couple of times until when I opened up a new window it came up to the size I wanted.

  • Unix window sizing

    Hi,
    I ran into the window sizing on the Unix box.
    When I ran my application on window environment, all
    the windows appeared OK. However, when I ran my
    application on the Unix box, the windows shrunk
    dramatically. Sometimes, I could even see the words
    on the window.
    Is there a way to fix this?
    Thanks
    Anthony

    Hello Anthony,
    we use AIX 4.3.x on IBM and see the same problems on Motif 2.1.
    1. Forte supports up to 3.0.N only Motif 1.2 on Unix-Platforms. At 3.0.N some
    UNIX-OS's are supported with Motif 2.1.
    2. The size of text depends on what font you has installed at UNIX Platform.
    You are able to change the default Fonts at X11 and the available sizes of
    fonts. X11 use at standard less fonts and font-sizes and maybe only 16
    colors.
    Because more colors and fonts increase the memory usage of X11.
    3. All widgets, which are designed for WINDOWS are converted at X11/Motif.
    (e.g. List-View, Tree-View)
    4. The functionality of 'size to parent' and other behaviours of
    grid-fields differ
    at X11/Motif.
    Solution: 1. You design the look and feel of the graphic client at UNIX-side.
    2. You don't use WINDOW-specific widgets.
    3. You migrate to Motif 1.2 at UNIX-side if your platform is
    not supported
    with Motif 1.2 (some other failures may also occur at
    2.1 which may occur
    a stack-backtrace error).
    4. Set FORTE_STACK_SIZE at UNIX >= 100.000
    5. See technotes at cyber-support for specific problems at Motif
    Summary:
    You will see, the graphical support at Motif (also keyboard specific
    behaviours) must
    be adjusted at X11/Motif before a synonym usage like WINDOWS is available.
    You will see that Forte does not prefer Motif as favourite graphical client.
    Don't be worry, you are able to adjust a lot of things in X11/Motif to have
    a look
    and feel like WINDOWS. LINUX has a graphical interface (fvwm) which simulates
    the same behaviours of graphical interfaces like WINDOWS. This is only done
    by adjustement of X11-parameters and ini-files.
    Hpe this helps
    Joseph Mirwald
    At 10:45 05.03.01 -0800, Anthony D wrote:
    Hi,
    I ran into the window sizing on the Unix box.
    When I ran my application on window environment, all
    the windows appeared OK. However, when I ran my
    application on the Unix box, the windows shrunk
    dramatically. Sometimes, I could even see the words
    on the window.
    Is there a way to fix this?
    Thanks
    Anthony
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • AIX v Windows Sizing Guide?

    XI31 SP3
    There's a windows sizing guide (3.0) however, not one for an AIX implementation.  Can anyone please offer any thoughts/feedback on an AIX installation as to performance considerations.
    Assuming BI System (XI31 SP3),  100 concurrent users, highest concentration on webi reports and dashboards. 
    Thanks in advance!

    Hey Mark,
    I found the following url on a wiki page: [https://websmp102.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000738725&]
    The wiki may prove useful if you will be migrating to BI4.0. The url to the wiki is..  [http://wiki.sdn.sap.com/wiki/display/BOBJ/AllyouneedtoknowbeforeupgradingtoBI4.0]
    good luck!
    Deepu.

  • 6.0.1 update lost default window sizing and all windows open full screen now, why and how do I get my original window sizes back?

    After updating Firefox to version 6.0.1, all browser windows open in full screen size. I need new browser windows to open in their original default size since I use a website for work that opens multiple browser windows.
    I used to be able to fix this problem by renaming my localstore.rdf file in my profile and then restarting Firefox but this does not seem to work in this last update.
    This appears to be a recurring problem for Firefox and it's extremely frustrating.

    Safe mode disables the installed '''Extensions''', themes ('''Appearance''') and '''Plugins''' in '''Tools''' ('''Alt''' + '''T''') > '''Add-ons'''. So it could be that an extension is causing it. You can try to isolate it starting with script blockers and similar extensions and '''Disable''' or '''Remove''' it.
    Please also note that safe mode also disables hardware acceleration: '''Tools''' > '''Options''' > '''Advanced''' > '''General''': '''Use hardware acceleration when possible'''.
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
    [http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars]

  • Can't open pdf files in Safari browser windows (bank website window) after I installed Adobe Reader 11update on my Mac last night

    I previously had Adobe Reader 9, which worked perfectly.

    Here's EXACTLY what happens:  I am in a Safari browser website and try to open a pdf file (my bank statement).  When I click on the link I get this message in a black window: "Adobe Reader.  Before viewing a PDF file in this browser you must launch Adobe Reader and accept the End User License Agreement, then Quit and relaunch the browser."  So I launch Adobe Reader but there is no End User License Agreement to accept.  I have done this several times with no result.  I am using a MacBook Air with OS 10.9.4 and Safari 7.0.5.

  • 10.4.11 update and remote window sizing

    Very odd problem has popped up this evening:
    I upgraded a user's G5 iMac from 10.4.10 to 10.4.11, everything seems fine except for using remote control software such as ARD 3.2.1 and Timbuktu 8.7.
    When I first attempted to log into the machine after the update using Timbuktu, the machine was responding extremely slow and I figured out why. The window was not sizing correctly. It was off by about 3 horizontal pixel lines. So whenever you moved the cursor, it had to redraw the screen over and over as it attempted to resize inside the window. I turned off fit to window and it did the same thing. Basically making the machine unusable in a remote setting. I updated to Timbuktu 8.7 from 8.6, but this did not fix the problem.
    So I used the ARD machine to log in remotely. Oddly, I had the exact same problem. The response time was much better and I could do a little more, but still it was sluggish as it shifted the desktop back and forth as it attempted to redraw the screen any time I shifted the mouse up or down.
    Has anyone else had any problems with using ARD and the 10.4.11 update? I am using ARD Admin 3.2 and client 3.2.1
    Thanks,
    G

    I did try one thing: I logged off and back in as the "remote" user - the user account I had setup when I installed ARD on all the machines. When I do that, it works fine. Log back in as the main user, screen does the wacky scaling thing. Are there any particular prefs or files that control this that reside in the user's folder?

  • Help retrieving window sizing side/corner in Linux

    I'm coding in CVI 8.1 and using the 2010 RTE for Linux.  In Linux, EVENT_PANEL_SIZE fires multiple times instead of EVENT_PANEL_SIZING (as it is in Windows).  The problem is that the EVENT_PANEL_SIZE event doesn't provide any callback data in either eventData1 or eventData2.  Therein liles my problem, I need to know what side/corner of the window is being dragged to fire the EVENT_PANEL_SIZE events in Linux.  I'm going to go out on a limb and bet that the functionality for this hasn't improved since the 2010 Linux RTE release.  Hopefully someone can correct me if I'm wrong (we're in the middle of upgrading to latest CVI) or steer me in the right direction to acquire what side/corner the resize drag occurs on. 
    I'm really hoping I don't need to fall back to X to get the drag side info.
    Thanks,
    -shrew

    Thanks for the reply.  But I was already aware of the sizing functionality as I have programmed it for Windows.  What I wanted to know was how to retrieve the panel side that was being resized in Linux - as in PANEL_SIZING_TOPLEFT, PANEL_SIZING_TOP, PANEL_SIZING_BOTTOM, PANEL_SIZING_BOTTOM_RIGHT, etc.  The "PANEL_SIZING_---" flags are only available from an EVENT_PANEL_SIZING - NOT an EVENT_PANEL_SIZE (which arrives in Linux in lieu of EVENT_PANEL_SIZING) - that is the problem!
    I have done it, but it isn't the most streamlined thing in my opinion.  To determine the panel side being dragged I maintain the panel's Rect state (the entire window including window manager decorations and titlebar): top, left, width and height.  Without going into detail about how to get the sizing information the following is done:
    Every time EVENT_GOT_FOCUS ocurrs the Rect state is updated
    When an EVENT_PANEL_SIZE ocurrs in Linux I can determine the side being dragged by comparing the prior Rect state to the current state:
    If previous top and previous left are same as current top and current left:
    If previous width and previous height are different than current width and current height then we know the bottom right corner is being dragged so I can issue my own PANEL_SIZING_BOTTOMRIGHT
    If previous width and current width are same but previous height and current height are different then we know that the bottom edge is being dragged so I can issue my own PANEL_SIZING_BOTTOM
    Otherwise the only possibility now is PANEL_SIZING_RIGHT
    Etc.
    For readers of this who are dealing with Linux it is good to note this post as well.  Sometimes it is necessary to access the lower level X functions to get things done in Linux.

  • When you close Safari and then Reopen it, Shouldn't the Websites/Windows Reopen?

    At least thats what I thought was one of the new things with Lion.
    If you close Safari, and then reopen it, the windows you left open are supposed to re-open.  But thats not happening for me most of the time.  If there are tabs, the tabs still say the name of the websites but the pages themselves are blank.  Other windows are just blank.  Ive tried calling Tech Support in the past and never got a satisfactory response.
    It keeps getting frustrating because I have to manually retype all the URLs to get the pages back.

    I mean quitting Safari with the windows open- not closing the windows.
    I have plenty of bookmarks but dont want to bookmark pages that Im just currently using - and dont necessarily want to go back to all the time.
    I just would like Safari and Lion to work the way its supposed to

  • Template Images Move w/ Different Browser Window Sizing

    I need to know if it is possible to "lock" the images I have
    in my template so that when the browser window is resized the
    elements do not move and relocate themselves. If the window is
    sized down I just want it to cut off the images. Anyone have any
    suggestions? The help is greatly appreciated.

    Did you see my previous extensive reply?
    Suggestion 1: it's a bad idea to use file/pathnames that
    contain spaces (or
    any punctuation other than hyphen or underscore) like this -
    background-image: url(../images/IW%20background%20file2.jpg);
    ../images/top row/toppic3.jpg'
    -----------------^
    Suggestion 2: The indent icons are NOT appropriate for
    general layout. The
    have a SEMANTIC meaning (what is contained within them should
    be quoted
    material)....
    <blockquote>
    <p><a href="#" onmouseout="MM_swapImgRestore()"
    Suggestion 3: When you want help with a layout problem, the
    best bet is to
    upload the offending page and post a link to it, rather than
    to just paste
    the code into a reply.
    Suggestion 4: All layout problems are related to a) the HTML
    markup you have
    on the page, and perhaps b) the CSS that cascades into that
    markup. Most of
    the answers given here will be given referencing HTML/CSS
    markup. To
    understand the answers that are given, you will need to have
    some
    understanding of HTML and CSS (and you will *definitely* need
    this to work
    effectively with DW). So -
    The images across the top of your page are simply adjacent
    image tags
    contained within anchor tags, which are all contained within
    a single
    paragraph tag, within a blockquote tag, directly within the
    body of the
    page, e.g.,
    <body>...<blockquote><p><a><img></a><a><img></a><a><img></a><p>
    The <blockquote> tag is a block tag. A block tag fills
    the width of its
    container, whatever that might be. This <blockquote>
    tag, therefore, will
    therefore reach from the left page margin to the right page
    margin, because
    it is only contained within the <body> tags - i.e.,
    there is no container
    wrapping the <blockquote> other than the
    <body></body> tags. As the browser
    viewport width changes, the space between the page's left and
    right margins
    changes concommitantly, reducing or enlarging the amount of
    space in which
    the <blockquote> tag sites. Thus, the effective width
    of the blockquote tag
    is affected immediately by the browser viewport width. In a
    similar
    fashion, the <p> tag, also a block tag, changes its
    width to accommodate the
    flexing of the viewport window. Since the images are just
    arrayed in
    adjacent locations within that <p> tag, if the width of
    the <p> tag is less
    than the aggregate width of the images, then the images will
    wrap to the
    next line.
    Is that the "motion" you are seeing? If so, it's unrelated to
    the
    incidental fact that the page is also made from a Template.
    You can fix this with a bludgeon or a scalpel.
    Bludgeon: Use CSS to give that <p> tag an explict
    width, and to set overflow
    to hidden, e.g.,
    <p style="width:969px;overflow:hidden;">....
    Scalpel: Redesign the page layout....
    Hope that helps.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "dbodrero" <[email protected]> wrote in
    message
    news:[email protected]...
    >I posted the code from one of the pages having the
    problem above. Is this
    >what is needed to look at or do we need to look into the
    code for the
    >template page? Thanks.

  • Fixed Website Window

    Hello. I'm going crazy trying to find an answer to my
    question. I'm trying to adjust a site that has a fixed left side.
    It's the type of site that allows you to expand the browser window
    to the right, exposing just blank space. I'm interested in a fixed
    window that does not expand - that does not have a horizontal
    scrolling bar (that is, unless you shrink it). How do I do this?
    I've been googling like mad, but all I find is the fixed or fluid
    debate tidbits. This doesn't address my question, of course.
    Thanks.

    > How do I set the browser window at a fixed width
    You don't - you can't (at least not reliably in all
    browsers). Does that
    answer the question?
    > I don't want the user to expand
    > the browser window horizontally to the left.
    But - I can't do that. I can drag to the right from the right
    margin, or to
    the left from the left margin, but the behavior of your
    current page would
    be the same in either case. The page is snug with the left
    margin and you
    get a wider gutter on the right. That's because the page is
    fixed width
    with no alignment specified so it gets the default of left
    alignment.
    > I've enjoyed the AP boxes because they allow me to
    design the
    > page with absolute certainty - is it that I'm using too
    many?
    Which is why everyone that uses them inappropriately does so.
    The problem
    with using absolutely positioned elements as a primary layout
    tool is well
    explained here -
    http://apptools.com/examples/pagelayout101.php
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "galleryrx" <[email protected]> wrote in
    message
    news:[email protected]...
    > Murray *ACE*, thanks for your thoughts. I am working
    with a template. The
    > website is not yet doing what I want because I don't
    want the user to
    > expand
    > the browser window horizontally to the left. How do I
    set the browser
    > window at
    > a fixed width. I've enjoyed the AP boxes because they
    allow me to design
    > the
    > page with absolute certainty - is it that I'm using too
    many? And
    > regarding the
    > flash header and the navigation bar, this came with the
    template. This
    > will
    > actually appear as static html with the option of a
    flash movie. I know
    > this
    > isn't the best solution, but the html navigation will be
    there for
    > accessibility issues and for iphone use. So, I'm still
    trying to figure
    > out the
    > window width situation.
    >

  • Setting Website Window Background Color ??

    I apologize for this novice level question - but how do I set
    a background color for the entire browser window?

    Modify > Page Properties > Appearance and select a
    Background color
    Ken Ford
    Adobe Community Expert - Dreamweaver
    Fordwebs, LLC
    http://www.fordwebs.com
    "tcraw1010" <[email protected]> wrote in
    message
    news:futu5p$fps$[email protected]..
    >I apologize for this novice level question - but how do I
    set a background
    >color for the entire browser window?

Maybe you are looking for

  • Best practices on number of pipelines in a single project/app to do forging

    Hi experts, I need couple of clarification from you regarding endeca guided search for enterprise application. 1)Say for example,I have a web application iEndecaApp which is created by imitating the jsp reference application. All the necessary presen

  • How do I get the music from my Shuffle to my new microsoft computer?

    i had my older ipod on my mac and sync a lot of music on it. Now how to i get my old music from my ipod and put it on my new computer?

  • Macbook Pro 2,2 Fans

    Is it normal for fans to be kicking up to 6000 RPM once the temperature of the CPU reaches around (so iStat tells me) 68C and the GPU in the 60's... (shouldn't the computer be melting?) The fan has just been coming on a lot more lately, especially wh

  • Sync problem "not authorized to sync from this computer"!!

    When I want to sync my iphone with application that I download to my itunes in my comuter. it gives error and says you are not authorized to sync your iphone at this computer???Why not??

  • Growing a tree

    I know the people behind this commercial "   http://vimeo.com/7307911   " used xfrog and a couple of months to achieve this stunning result. There's a lot of tools out there to render out full grown trees, BUT is i possible to make a naturally , grow