Moving a child window

This is a discussion on Moving a child window within the Windows Programming forums, part of the Platform Specific Boards category; how would i make it so that you can click and drag a child window or something with a bitmap ...

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

    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
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    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 06:27 PM.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    arctidog
    Guest
    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, 10: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21