Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,
i've one dialog based application with some controls.i want to change the position of controls based on some conditions.is there any methods other than SetWindowPos() and MoveWindow()to change the position?please help me..
thank you in advance..
Posted
Comments
Joan M 27-Jun-11 3:52am    
Jijesh you should improve your question with all the details you are posting as comments... in that way the other members will see the extra information easily and you will get more chances to get an answer. ;)

Till now i have seen SetWindowPos or MoveWindow are used to move a child window.But why you don't want to use these methods?Can you explain what is the problem with them?
 
Share this answer
 
Comments
Jijesh Balakrishnan 27-Jun-11 3:19am    
when i used those two methods, its not working properly
Chandrasekharan P 27-Jun-11 3:24am    
what is not working properly? where are you having trouble? can you elaborate a little more. I guess these are the only 2 methods which will help you in changing the position of the controls in runtime.
Jijesh Balakrishnan 27-Jun-11 3:40am    
actually i'm using an interface for web browser.i should change the position of that interface dynamically.and moreover, some controls also shuld be changed as same.in my code, i've used both SetWindowPos() and MoveWindow() to do this.but only for web browser,its not moving.i don't know the reason by which its happend?thats why i asked for some other solution.i didn't get any error message, but the window is not placed properly.
The two functions (SetWindowPos and MoveWindow), as far as I know work well. Why are you saying they didn't work properly?
 
Share this answer
 
Comments
Jijesh Balakrishnan 27-Jun-11 4:17am    
actually i'm using an interface for web browser.i should change the position of that interface dynamically.and moreover, some controls also shuld be changed as same.in my code, i've used both SetWindowPos() and MoveWindow() to do this.but only for web browser,its not moving.i don't know the reason by which its happend?thats why i asked for some other solution.i didn't get any error message, but the window is not placed properly.
Chandrasekharan P 27-Jun-11 4:22am    
why don't you put that piece of code so that it will be easier to analyse and tell you what the exact problem is.
It simply must be a result of the code you have entered!

I just followed the directions given here[^], for creating an app with a webbrowser control in a dialog.

I just left the default dialog as it was and added a webbrowser control to it. After creating a member variable to access it with, I entered the following code into the event handler code for the OK button. Works exactly as advertised - pixel perfect. Right place, right size..

void CwebBrowserControlDlg::OnBnClickedOk()
{
    MessageBox(L"Clicked It", L"Info", MB_OK);
    m_Explorer.MoveWindow(0,0, 300, 100, true);
    // TODO: Add your control notification handler code here}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900