Link to home
Start Free TrialLog in
Avatar of soriega
soriegaFlag for Sweden

asked on

Move window without resize

Hi. I am trying to move a window to the upper left corner of my screen. I seem to have no problem moving the window to the corner , but it becomes very very small no matter what I set as nWidth & nHeight. The window i am moving is a "no resizeable" window, and i simply want it in the corner and nothing else.

    Declare Function MoveWindow Lib "user32.dll" Alias _
                    "MoveWindow" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long

Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

try something like this...

Dim frm As New Form1
        frm.Location = New Point(Me.Left + 200, Me.Top + 100)
        frm.Show()
Avatar of soriega

ASKER

Not really, i want to move another window, Not the Form of my application. Is there some way of using this method with the hwnd ?
I thought this was useful
Declare Function MoveWindow Lib "user32.dll" Alias _
                    "MoveWindow" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
This one seem to work, but it becomes very small, and it can after then only be closed
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial