I am using an ActiveX control to implement an embedded browser in an ATL app (IWebbrowser2). The problem is, that I can't jump between text fields using the tab key. Pressing the tab key just does nothing. Pressing the Enter key submits the form as expected.
The problem exists e.g. on the facebook login site.
How can I make the tab key work properly? Must I activate something in the ATL control to make this work?
Thank you!
Fabian
This article describes a way how to use IWebBrowser2 in C:
http://www.codeproject.com/KB/COM/cwebpage.aspx
In some comments below it, people have exactly the same problem. Seems IWebBrowser2 just has bug and does not translate keyboard messages (not just TAB, but also CTRL+C etc.) to the expected actions. In some comment there has been a workaround:
http://www.codeproject.com/Messages/3558959/Re-hot-key-not-work.aspx
However I have no knowledge about ActiveX so I have no idea if this is usable in your case.
Related
I am not very experienced with Qt and I have trouble doing what I want.
In my application, I search for archive files with password on a disk (that part works) and I want to ask the user for the password each time I find one new encrypted archive.
If I find multiple files while user hasn't given any password, I want the dialog for the first password to stay visible until that password is given and then the dialog for the next password can show and so on.
I use some sort of queue to remember which archives need a password, and I am trying to show and hide an unique dialog (actually a Popup) with the info of each archive and get the password from a TextField inside. In the meantime my application is doing other stuff in the c++ code like searching for archives and extracting them when a given password is OK.
My problem is that it is not really working. The dialog shows the first time, I get the first password but then the dialog doesn't show for the next password. Sometimes I can see the dialog a second time, for a few milliseconds, before it disappears without user interaction. My application is blocked because it cannot go on without the unasked passwords.
I get that I am doing something wrong but I don't get what exactly.
Can anyone help ?
I don't know if I was very clear, English is (obviously) not my mother tongue.
I found my mistake.
I did a component based on a Popup.
Inside the onClicked function of the Check or Skip buttons I was doing two things: send accepted() or refused() to trigger custom actions and then close the dialog.
I was doing that in that order, so the accepted or refused action, which among others things triggered the visibility for the "next" password dialog, occurred before the close event, which was setting the dialog visibility to false.
I switched the order and it's way better.
I feel a little silly now but at least I found it.
I have created an ActiveX control that uses five different colors. I would like to the control's property page to let the user choose the R, G and B values for each of the five colors. That won't be a problem. My problem is: how do I display the property page? For the sake of this question, let's say I want to connect it to the control's double-click event. The user would double-click on the control and the property page dialog box would appear. What code would have to be in the event handler to do that?
And yes, I know I'm working with antique technology. So is the rest of my company, and far too many other companies.
In case it matters, I'm writing the control in C++ using Visual Studio 2012.
As I was about to ask this question over on reddit since I don't have an answer here yet, it occurred to me that one would want to invoke a control's property page from the control's container, not the control itself. So, I went to my test application, typed my instance's variable name, and Intellisense showed me that the control has a property named ShowPropertyPages().
Using a Telegram Bot, I would like to know how I can send "transparent choice buttons" like in this image.
I dug in the documentation but here, they only explain how to make custom keyboard buttons, in such a way that the android keyboard pops up with custom buttons in order for the user to choose.
With the ones in the image I uploaded, ( the buttons named "<<", "" and ">>" ) a user could vote or navigate intuitively and not be bothered with custom keyboard.
What is the code I need to send them? Then, when an user presses them, how can I handle the choice?
I'm working with Python and Linux.
Thanks in advance.
I searched but couldn't find anything.
All you need to do is implementing inline keyboards that you can find more information about them here.
And for receiving the votes from the users firstly you need a database to store them and secondly you should use callback buttons or callback queries, which are part of inline keyboard markup in telegram bot API.
We have an MFC application that uses the CHeaderCtrl and have been using the HDS_FILTERBAR style to filter data. Works great. But our users want to be able to paste in text into the filter cell. I have not found a way to get a pointer to any CEdit-type of control here so that I can call >Paste. I have managed to detect a Control-V while in the filter in the application's ::PreTranslateMessage. There is a way to send text to the filter by way of a CHeaderCtrl->SetItem call, but this will immediately launch the filter. I just want to be able to paste text.
So...I tried (I was desperate) using keybd_event and SendInput to force keystrokes. This worked but had undesirable side effects, probably due to MFC's message handling, and in my case, the user already had the Control + V pressed down. But in just sending the letter 'A', and forcing the SHIFT key, I accidently discovered that the CHeaderCtrl's filter does support a paste if you:
CONTROL + SHIFT + V
The problem is its hard to do, and hard to tell my users to do this.
I can simulate this sequence using keybd_event, but again, its real quirky.
Can anyone find a way to either get access to the CEdit (if there even is one) to a filtered CHeaderCtrl or know of another workaround ? I tried using a spy utility, but was not sure what to look for. Sorry for the long post.
So remove Ctrl+V from the accelerator list and you can handle it inside the control...
(Answer added according to the comment).
I find this situation comes up from time to time, and I never seem to have a really robust generic solution to it.
I have a control - in this example an EDIT control on a dialog. I want to take certain actions in response to the user - and only the user - modifying the contents of the edit control.
The edit control can be set programmatically - e.g. when the dialog is being setup, there may be an initial value placed into the edit field. Or when the user selects an item from a listview, that selection's text may well be what's placed into the edit field.
But when the user modifies the contents of the edit field, I need to know that, and respond (in this scenario, I want to clear the selection from the corresponding listview).
I am currently looking at what control has focus, and only considering EN_CHANGE's to be "from the user" if the edit control has focus.
This works beautifully under Windows 7. This fails under XP (I haven't tested Vista yet).
In XP, if the edit field has the focus, but the user clicks on the list view, and the list view tells the edit control to set its contents, then I get a notification from the edit control which claims to still have focus (::GetFocus() == HWND of edit control). But this incorrect state doesn't occur in Win7.
This is a layered interface, so I cannot modify the list-view notification handler. It gets a selection change, and updates the edit field without my involvement or ability to really intervene other than to get notifications from both of them.
Any thoughts on how to generically, permanently solve the "Is this control notification really from the user" conundrum?
You can always track LVM_ITEMCHANGING, LVM_ITEMCHANGED, and EN_MSGFILTER messages. If the edit box is modified between LVM_ITEMCHANGING and LVM_ITEMCHANGED without an EN_MSGFILTER in between then you can probably assume the user did not modify the item. Or just check to see if there are any items selected when EN_CHANGE fires and if not or the text doesn't match the selected item, assume it is a user edit.
Or use ES_MULTILINE (from EN_CHANGE documentation):
The EN_CHANGE notification is not sent
when the ES_MULTILINE style is used
and the text is sent through
WM_SETTEXT.
I'd suggest using the right message. EN_CHANGE is too generic, you want to know if the user typed or pasted text. So why not subclass the control and watch for WM_KEYPRESS messages?
Alternatively, you can set a flag in your other code that sets the edit control content. You might be able to assume that anything that makes your wndproc re-entrant represents a programmatic change.
You aren't looking for something actually secure, are you? If you just want to exclude set content calls that's fairly straightforward. If you want to differentiate between user action and programmatic simulation of user keypresses, that's a much harder problem.