Actually I m getting tht value for view in dialog.
You appear to have asked this same question previously although in different ways, and yet nowhere have you clearly explained what you are trying to do. All I can determine is
you are using a dialog, for some unknown purpose
you need to do something with a view somewhere
you have some reason to use an OPENFILENAME structure in or from the dialog
you think lpfnHook is an answer to something
you do not understand the SendMessage() call
Can you please try reposting the question with a clear definition of what your program is trying to do and what bits are not working. Place any code you post between <pre></pre> tags, and try spelling words in full rather than using 'txtspk', so that we can understand the problem and work to a resolution for you.
I have a CWnd Derived window. I have added several Child windows.
I create the child window [main_view_win] using WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL the scroll bar exists and works however there are two problems.
the scroll bar buttons initially are not drawn. ( thumb and middle part are drawn ) Once they are clicked on they are drawn properly.
when the child window [main_view_win] is covered by another window ( for example notepad ) the scrollbar's do not redraw until they are physically clicked on.
I have tried the following with no luck.
Made sure no other child window was overlapping.
Tried with clipchildren clip siblings turned on
turn off all painting functions to make sure i was not doing something stupid.
turned on and off erase background.
I did a quick test adding a scrollbar as a seperate child window and it worked just fine.
I was about to change my code ,illiminating the WS_VSCROLL and WS_HSCROLL, then I thought the smart people of codeproject might know what is happening.
The display area of a tab control is the area in which an application displays the current page. Typically, an application creates a child window or dialog box, setting the window size and position to fit the display area. Given the window rectangle for a tab control, you can calculate the bounding rectangle of the display area by using the TCM_ADJUSTRECT message.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
Your question is short, but the answer heavily depends on how much math knowledge you have.
Possibly the biggest tip I can give anyone who ever wants to deal with graphics is to go back you your end-of-school (ie A-level) math books, and learn about matrices (matrix-es) and vectors. It's fine if you don't know it now. If you are unwilling or unable to do this, quit now and start learning how to say "would you like fries with that?".
If you don't already know about it, I'd advise you learn about SetROP2(R2_NOT) for your mouse handling code, to draw / undraw tracking lines.
I hope that helps steer you in the right direction. A more exact answer would depend on the details of your application and skill level.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]
to add to warrior panda's reply :p, you can try [this] to understand vectors. Once you know that, you should not have any problem calculating angles or rotating a rectangle. you just need to specify the rotate center and angle of rotation and then rotate each of the 4 vectors obtained by joining rotate center and 4 corners. easy, huh?
1. get the coordinates of the two points on the 'top' edge. (this assumes one of them is the anchor point of the rotation)
2. find the change in x and change in y (dx and dy)
3. use atan(dy/dx) (or atan2(dy/dx)) to find the angle in radians of the line that connects them