Can't Resize Window using SetWindowPos
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Can't Resize Window using SetWindowPos

  1. #1
    Join Date
    Mar 2009
    Location
    Visual Studio 2005, .net 2.0
    Posts
    18

    Can't Resize Window using SetWindowPos

    Hi,
    I'm developing on Windows XP and I need to resize a Remote Desktop window.
    I'm using the following code:
    Code:
    try
    {
       SetWindowPos(hwnd, HWND_TOP, 801, 2, 1000, 743, SWP_SHOWWINDOW);
    }
    catch(Exception ex)
    {
      MessageBox.Show(ex.ToString(), "Resize Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
    The window does not get resized, but I do not get an exception. I know for sure that my hwnd is valid because the SWP_SHOWWINDOW brings the window to the forefront.

    I've tested the code on Notepad and it works.

    Do some windows classes impose resizing restrictions that my code does not address?

    Thanks for your help,
    Steve

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,097

    Re: Can't Resize Window using SetWindowPos

    What window class are you trying to resize? It might also be a problem with some of the paramaters

  3. #3
    Join Date
    Mar 2009
    Location
    Visual Studio 2005, .net 2.0
    Posts
    18

    Re: Can't Resize Window using SetWindowPos

    Hannes,

    Thanks,

    The window class is TSSHELLWND (remote desktop).

    Any help you can provide is appreciated.

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center