Solved

senddmessage

Posted on 1997-04-17
1
211 Views
Last Modified: 2013-12-04
for mikeblas.

i want to send the following keystrokes from my application to netscape in order to make netscape go home.


1. alt
2. g
3. h

i tried it with:  SendMessage but i do not know

what i am doing wrong.

i work under win95 with bc++4.5.
0
Comment
Question by:stephan papadakis
1 Comment
 

Accepted Solution

by:
seg earned 50 total points
ID: 1334626
i take it you want to send the Alt-g to bring down the Go submenu and then the h to select the Home subitem. if this were to work at all (which it may not), you'd have to send at least 2 messages. possible solutions:

SendMessage(hWnd, WM_SYSKEYDOWN, VK code for g, ???);
SendMessage(hWnd, WM_KEYDOWN, VK code for h, ???);

SendMessage(hWnd, WM_SYSCHAR, Ansii code for g, ???);
SendMessage(hWnd, WM_CHAR, Ansii code for h, ???);

the reason there are 2 is because to accomplish what you want requires 2 steps: bring down the Go submenu, select an item off that submenu.

another thing you might try is just send a WM_COMMAND with the menu id of the Home item (which you can get by running Spy++)..
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

839 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