|
Hi all
I am not sure my method is good . I have a Win32 dialog proc where WM_PAINT is called. I have a bitmap which is statically loaded from the dialog (ie LoadBitmap not used). But I need to resize the bitmap according to DPI . So I need to retrieve this bitmap in WM_PAINT so that I can redraw it .
Can anyone help me ?
redindian
|
|
|
|
|
Can you more explain? HBITMAP of HWND?
|
|
|
|
|
I have dialog box which has some 11 edit-box and 3 combo-box.
Now for all these i have to disable the context-menu option, when the right click is clicked on these elements.
How can i do this?
|
|
|
|
|
override the WM_CONTEXTMENU message and don't call the base class function from it...
|
|
|
|
|
if you want your context_menu on right click on the editbox see an article of Mr PJ Arends about it.
|
|
|
|
|
How can we make the Property pages to appear vertically. We can do this using the CTabCtrl, but I was wondering how to do this using Property pages.
Thanks,
AJ
|
|
|
|
|
Ajay L D wrote: How can we make the Property pages to appear vertically. We can do this using the CTabCtrl, but I was wondering how to do this using Property pages.
Use CPropertySheet::GetTabControl to get a reference to the internal tab control of the property sheet. Now use this reference to the internal tab control for manipulating the property sheet tab control.
|
|
|
|
|
Thanks! I did try that by modifying the style in the dwStyle parameter of CPropertySheet::OnCreate function, but it did not work. Any idea from where I should set the style for the tab?
AJ
|
|
|
|
|
Ajay L D wrote: CPropertySheet::OnCreate function, but it did not work. Any idea from where I should set the style for the tab?
Instead of passing the style there (which is wrong) using ModifyStyle function to modify the style of the tab control.
|
|
|
|
|
Thanks! I got it by calling ModifyStyle from OnInitDialog. It did not work from OnCreate. It could be that the tabs are not yet created when OnCreate is called.
Thanks a lot!
AJ
|
|
|
|
|
Ajay L D wrote: It did not work from OnCreate. It could be that the tabs are not yet created when OnCreate is called.
You told you passed the style to the PropertySheet which won't work. Instead you should get the tab control and pass this style to it.
|
|
|
|
|
I have a 3 pane splitter window. How do I prevent the separator bars from resizing these panes. Any help is appreciated??
|
|
|
|
|
|
Where exactly is this link supposed to go to?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hmm... it did go to an (almost) identical post about 24 hours earlier, with a solution, but it's been erased.
|
|
|
|
|
Hi.
I have created one Dialog based application and on the dialog box I have created some edit boxes. Being a Dialog based application; I don’t have a class derived from CView class in my application.
I want to provide the facility by which I can drag the text from one of the edit box and drop it in some another application.
How can I incorporate the facility of drag and drop in this case as I need to handle
1. OnDrag()
2. OnDragEnter()
3. 3. OnDragOver()
4. OnDragLeave()
5. OnDrop()
Function from View class and as I said I dont have View class in my application?
Thanks.
Rakesh
|
|
|
|
|
|
Hi Billy.
Thanks for reply.
But as I mentioned; my application don't have view class rather its a dialog based appli. So I can't use the function that are mentioned in the document u forwarded me because these function are there in CView class.
How can I proceed then?
Please help
Thansk
Rakesh
|
|
|
|
|
You do not need the CView class. Follow the instructions on the page and sub-pages that I linked.
Drop Source:
[quote]
Otherwise, construct a COleDataSource object, initialize it with the selection, and call the data source object's DoDragDrop member function
[/quote]
Drop Target
[quote]
To implement a drop target
Add a member variable to each view in the application that you want to be a drop target. This member variable must be of type COleDropTarget or a class derived from it.
From your view class's function that handles the WM_CREATE message (typically OnCreate), call the new member variable's Register member function. Revoke will be called automatically for you when your view is destroyed.
Override the following functions. If you want the same behavior throughout your application, override these functions in your view class. If you want to modify behavior in isolated cases or want to enable dropping on non-CView windows, override these functions in your COleDropTarget-derived class.
Override To allow
OnDragEnter
Drop operations to occur in the window. Called when the cursor first enters the window.
OnDragLeave
Special behavior when the drag operation leaves the specified window.
OnDragOver
Drop operations to occur in the window. Called when the cursor is being dragged across the window.
OnDrop
Handling of data being dropped into the specified window.
OnScrollBy
Special behavior for when scrolling is necessary in the target window.
[/quote]
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
One of the things that I did for JRTSTools was to create a COleDropTarget -based class that uses registered messages for notifications to its "notification" window (the class treats the owner control/window and the notification window separately).
That way, it is completely reusable for any type of (non-CView -based) window - all that has to be done is adding the registered window message handlers.
I find it easier than creating a new class derived from COleDropTarget each time I need to add a drop target (or multiple drop targets) to a window - I have have just add the instances of the object, and wire-up the targets and notification window. Easier than creating two derived versions or using one and managing drag locations to determine behavior.
It also makes it easier to add or remove the drop target functionality at runtime based on other activity in the window.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
can somebody help me..
How to get the handle(HWND)of the window (dialog box)? i have tried the GetSafeHwnd()but as i don't have the Cwnd pointer also so that i can call this function . So how to get the CWnd pointer for that specific window?
|
|
|
|
|
|
What do you need to get, an HWND or a CWnd pointer? Is the dialog in your app?
|
|
|
|
|
Use
HWND hand= GetSafeHwnd();
CWnd* pWnd= CWnd::FromHandle();
redindian
|
|
|
|
|
You do not need CWnd to call ::GetSafeHWnd()
::GetSafeHwnd() is a win32 API
CWnd::GetSafeHWnd is the same but MFC wrapped .
redindian
|
|
|
|