Handling WM_KEYDOWN in edit control on modal property sheet - c++

First of all: I'm using C++ and ATL+WTL.
I am trying to handle the WM_KEYDOWN for an edit control that is on a page of a modal property sheet. I'd like to get the VK_NEXT key while VK_CONTROL is down. Without success so far, I only get VK_NEXT if VK_CONTROL is not down. The modal property sheet seems to eat this combination, it is used to cycle through the tabs in a standard property sheet. I have already tried to let the edit control handle WM_GETDLGCODE and return DLGC_WANTALLKEYS but still don't get this combination. However if I use modeless property sheet everything works fine (property sheet does not handle Ctrl+PageDown and edit control receives those keys). In my application I don't want to make a modeless property sheet.
So the questions is: Is there any way to handle those keys (VK_CONTROL + VK_NEXT) in edit control placed on modal property sheet?

Related

Validating List Control In-Place Edit

In my list control I have in place edit control.
On killfocus event of edit control I am validating the text.
My requirement is when clicking on scrollbar of listcontrol I should validate with old text(it should behave like esc key )
In my application when clicking on scrollbar of listcontrol the killfocus event of edit control getting triggered and the text is getting validated with current text.
How to validate with old text?
Thanks.
As you receive a LVN_BEGINLABELEDIT you also receive a LVN_ENDLABELEDIT notification. Return TRUE or FALSE according your needs.

Regarding MFC Property sheet

I have two queries.
Is there any way to disable the traverse to other property pages when I am working on one page in MFC ?
Is there any way to go to the next page of the property sheet on click of a button in the current page in MFC ?
1.
CMyPropertySheet::DisableNextButton()
{
SetWizardButtons(PSWIZB_BACK);
}
CMyPropertySheet::EnableNextButton()
{
SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);
}
I'm not sure, if this makes the button invisible. Maybe SetWizardButtons(PSWIZB_DISABLEDFINISH) will also disable the next button, if the finish button isn't yet reached.
2.
CMyPropertySheet::GoToNextPage()
{
PressButton(PSBTN_NEXT);
}
Is there any way to disable the traverse to other property pages when
I am working on one page in MFC ?
respond to the PSN_KILLACTIVE message and return TRUE
MFC equivalent: OnKillActive
Is there any way to go to the next page of the property sheet on click
of a button in the current page in MFC ?
send a PSM_PRESSBUTTON message with wParam as PSBTN_NEXT
MFC equivalent: PressButton, like PressButton(PSBTN_NEXT)

How do I get messages to embedded dialogs in MFC?

I seem to have the original problem from Embedded Modeless Child Dialog not getting messages. I have managed to add rows to my property page using tips form What is the best way to manage data for rows of similar controls in MFC? but now when I click on the controls in the embedded dialog, nothing happens. I assume there's some message routing I need to do in the parent dialog but I don't know what it is.
The properties of the row dialog resource included Disabled = True. I have no idea how that happened.

How do i create a drag and drop start event in REPORT listview in winapi

I've stumbled into a problem with drag and drop.
I've got a REPORT style of my list view.
First thing to think of is catching the LVN_BEGINDRAG message, but I was unable to catch it in the parent window procedure. I went to MSDN and figured out that REPORT style doesn't support this notification because other styles had some mentioning of d'n'd in their description and report style didn't have one.
So I went the other path - handling NM_CLICK notification, but actually it's not perfect for the situation. The problem is that if i want to drag the already selected item, and click on it and hold the button, then no notification comes until I stop pressing the button.
I've also tried subclassing listview to catch LVM_LBUTTONDOWN to get 100% drag enter before any other calculations happen inside of a window proc, but it doesnt' do the job also; or maybe I've done some bad work subclassing the list view. Anyways. I need advice how to do it properly.
My target drag and drop zone is a treeview control actually.
Thanks

Detect Window Move in Property Page (win32)

I implemented a wizard using property sheet. One one page I display tooltip if user enters something invalid. It is a tracking tooltip so I have to manually turn it on and off. Now I want to move the tooltip when the wizard page moves.
It seems that only the property sheet window receives WM_MOVE event from Windows. The page does not. Is there a way to get notified in the page window when the wizard moved?
The property page isn't moving in relation to its parent window, the property sheet - that's why it's not getting WM_MOVE messages. You can set up a WM_MOVE handler in the property sheet and have it forward another message to the property page with PostMessage or SendMessage. I'd suggest a message in the WM_APP range.