Thread: Moving a child window

  1. #1
    Registered User AtomRiot's Avatar
    Join Date
    Jan 2003

    Moving a child window

    how would i make it so that you can click and drag a child window or something with a bitmap on it to reposition it inside that window?
    i am using "windows.h" api to do it.
    would i create a static and put a bitmap on it or should i make it in wm_paint with a paintstruct?
    or is there another way to do it. i am just needing to move it, i dont need to resize it or anything.
    any help would be greatly appreciated.
    All Your Base Are Still Belong to Someone!!!
    And you Remember that!!!

  2. #2
    Join Date
    Jan 2002
    Uraldor's method is excellent.

    edit: put your static 'image' control with the bitmap inside another control/window. This should give the effect of being able to drag the image around with the minimum amount of code.
    Last edited by Ken Fitlike; 01-11-2003 at 07:27 PM.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Well, I would use MoveWindow (), just get the size of the child window, then put it in the MoveWindow () function:

    MoveWindow (hwnd, cxPos, cyPos, cxSize, cySize, FALSE);


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  4. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM