Solved

How to action "keybd_event in ExecWB"

Posted on 2000-04-04
6
302 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 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
List out all word 7 359
twoTwo  challenge 35 120
abstract class with all non abstract mentods 6 87
JQuery serialize and unserialize 8 271
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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 …
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 video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

752 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