Solved

How to action "keybd_event in ExecWB"

Posted on 2000-04-04
6
297 Views
Last Modified: 2013-11-20
I want to know the Reason
that keybd_event("Tab") doesn't
working in ExecWB.

Where is this code Wrong?

 void CMyHtmlView::OnNavigateComplete2(LPCTSTR strURL)
{
// TODO: Add your specialized code here and/or call the base class

ExecWB(OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER, NULL, NULL);

HWND aWnd = (HWND)GetActiveWindow();

::SetActiveWindow(aWnd);

::keybd_event(VK_TAB,MapVirtualKey(VK_TAB,0),0,0);

::keybd_event(VK_TAB,MapVirtualKey(VK_TAB,0),KEYEVENTF_KEYUP,0);
      
CHtmlView::OnNavigateComplete2(strURL);
}
0
Comment
Question by:bluewin
  • 3
  • 3
6 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 40 total points
ID: 2685245
The ExecWB does not return until it is done. That means the dialog box is no longer there when keybd_event is executed. There seems no way to achieve what you want.
0
 

Author Comment

by:bluewin
ID: 2685471
Then can I access and handle
the dialog box
that ExecWB created.

Isn't there any solution?

0
 
LVL 23

Expert Comment

by:chensu
ID: 2685487
You may create another thread right befoer ExecWB. In that thread, try to use FindWindow to locate the dialog box. But this method is not stable and very ugly.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:bluewin
ID: 2685534
Could you donate me
the outline or skeleton of

Creating Thread,
Finding the window of CFileDialog...

Thank you very much.

0
 
LVL 23

Expert Comment

by:chensu
ID: 2685630
Use AfxBeginThread to create a worker thread. See the documentation on AfxBeginThread and the article Multithreading: Creating Worker Threads in Visual C++ Programmer’s Guide.
0
 

Author Comment

by:bluewin
ID: 2685643
Thank you from the bottom of my heart for your kindness.
Good Luck!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
how do i create updater to My Activex application? 3 74
iSeries DB2 Query 2 84
notReplace  challenge 53 102
Window placement 17 65
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now