Results 1 to 7 of 7

Thread: need help moving a window

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2005
    Location
    earth
    Posts
    89

    need help moving a window

    Hello, lets say I have the notepad program opened in the middle of the screen what function could I use to move it so that it would be in the top left hand conner of the screen. Thank you
    Aim: zhahaman2001

  2. #2

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: need help moving a window

    Use the GetWindowRect method. Not sure what the next step would be since I don't use these APIs, but that should provide you with a start.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2005
    Location
    earth
    Posts
    89

    Re: need help moving a window

    Quote Originally Posted by Deepak Sakpal
    Are you talking about external program or your application?
    yes, notepad.exe as the external program
    Aim: zhahaman2001

  5. #5
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Re: need help moving a window

    Here you go: http://allapi.mentalis.org/apilist/S...lacement.shtml - you might also want to take a look at the related functions at the bottom there.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 2005
    Location
    earth
    Posts
    89

    Re: need help moving a window

    Thank you, this is a great start however how would I find the hWnd for the notepad.exe thats running?
    Aim: zhahaman2001

  7. #7
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: need help moving a window

    vb Code:
    1. Dim processes() As Process
    2. processes = Process.GetProcessesByName("notepad")
    3. Dim hWnd As Integer = processes(0).Handle.ToInt32

Posting Permissions

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



Click Here to Expand Forum to Full Width