Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to action "keybd_event in ExecWB"

Posted on 2000-04-04
6
Medium Priority
?
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 120 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses

688 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