[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to use SendKeys() in MFC

Posted on 2004-04-05
6
Medium Priority
?
1,893 Views
Last Modified: 2013-11-20
We use a function SendKeys() in visual vabic of shell object. We send keys to other applications(like notepad,word etc.) by sendkeys.
I'm unable to access SendKeys in MFC. how can i access it or how can i send messages to other applications in MFC?
and how can i access shell object in MFC?
Waiting for reply.
and thanks for your response for my first question(deletesystemfile).
0
Comment
Question by:ManojKrChauhan
[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
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 60 total points
ID: 10757922
To send messages to other applications, you can use CWnd::SendMessage(..) http://msdn.microsoft.com/library/en-us/vclib/html/_mfc_CWnd.3a3a.SendMessage.asp
0
 

Author Comment

by:ManojKrChauhan
ID: 10766392
Can i send keyboard event to other application using SendMesage().
I want to send TAB key event to other application. how can i do it?
0
 
LVL 16

Expert Comment

by:nonubik
ID: 10766474
SendMessage(hAppWnd, WM_KEYDOWN, VK_TAB, 0), where the hAppWnd is the application's window handle
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 

Author Comment

by:ManojKrChauhan
ID: 10766809
It's not working. I open an exe through WinExec then send message to it.
no problem in WM_CLOSE,WMSETTEXT,WM_GETTEXT.
But keyboard messagees are not working. I want to send TAB key to application(without pressing it)
waiting for reply.
0
 
LVL 4

Expert Comment

by:mblat
ID: 10788756
Do you have control of other application?  Basically you are the one who is writing it or you trying to control 3rd party app?
0
 

Author Comment

by:ManojKrChauhan
ID: 10866282
I have done for sendmessage. Thanks
There is a problem related with sendkeys
when i open file file by shell function then it bacame active by appactivate() and i can send keys to its window by Sendkeys(). But when i open any file by shell.run the i activate the window by appactivate and tried to send keys. then keys don't send to its windows. I want to send keys to window which is open by shell.run
Like .MSC file we can open mmc.exe (only by shell.run() not shell() or winexec() or shellexecute())for win2k. when i open .msc file then i try to activate its window by appactivate() setforegroundwindow() etc. but no success.
 so please give a reply how can i send keys to such applications
             thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

656 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