Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect when a Window is Moved

Status
Not open for further replies.

nbgoku

Programmer
May 25, 2004
108
US
how do i detect when a window is moved


the reason i ask this is b/c i want to get the new position and move all the child windows with the parent window when the parent window is moved
 
All children are automatically moved when you move some window. To detect windows moevments use message WM_MOVE or create a windows hook.

Ion Filipski
1c.bmp
 
oh maybe its not a child then, maybe i used the wrong term

what i did was create a new dialog box, and launch the dailog box from the main dialog (parent) when a button is pressed

is it still suppoused to move automatically? if it is is there any settings i should change in the property mode maybe?
 
ok how do implement this WM_MOVE, i dont see how i should use this?
am i suppoused to use it with the OnMove() function? maybe some other function?
 
OK OK i got some coding and tried to use it but it didnt work

Code:
LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {

       switch(msg) 
			 {
             case WM_MOVE:

                  MessageBox(hWnd, "WM_MOVE: The Window Moved", "Goodbye!", MB_OK);
                  return 0;
			}
       return DefWindowProc(hWnd, msg, wParam, lParam);
 }


i have a CDialog, and a CPostfilterDlg, should this be in the code somewhere, like

Code:
CPostfilterDlg::LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
...
return CDialog::DefWindowProc(hWnd, msg, wParam, lParam);

i dont know how to declare a LRESULT CALLBACK in the .h file, how do i do that?
 
ah ok never mind, i figured it out, for anyone interested on what i used, i used: WM_ON_MOVE and OnMOVE()


works good to :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top