|
Hi!
I've been trying to send keystrokes from say Window1 to Window2. It's easy when Window2 is the active one. However, I want to send it keystrokes even when it's not the active window. The code I've written for Window1 looks like below:
PostMessage(hWnd, WM_KEYDOWN, VK_CONTROL, MAKELPARAM(0x1, MAKEWORD(MapVirtualKey(VK_CONTROL, 0), 0x00)));
PostMessage(hWnd, WM_KEYDOWN, 'B', MAKELPARAM(0x1, MAKEWORD(MapVirtualKey('B', 0), 0x00)));
PostMessage(hWnd, WM_CHAR, 'B', MAKELPARAM(0x1, MAKEWORD(MapVirtualKey('B', 0), 0x00)));
PostMessage(hWnd, WM_KEYUP, 'B', MAKELPARAM(0x1, MAKEWORD(MapVirtualKey('B', 0), 0xC0)));
PostMessage(hWnd, WM_KEYUP, VK_CONTROL, MAKELPARAM(0x1, MAKEWORD(MapVirtualKey(VK_CONTROL, 0), 0xC0)));
The problem seems to be this - Window2 has 'Ctrl-B' defined as an accelerator. So, when one actually presses 'Ctrl-B' in Window2, the TranslateAccelerator function in Window2 translates the keystrokes to WM_COMMAND message. However, when the same keystroke sequence is sent programmatically, it doesn't get translated to WM_COMMAND.
Can someone help me out with this please.
Vijay Chauhan
|
|
|
|
|
Try to use
keybd_event()
or
SendInput()
Eventually try to activate application first.
|
|
|
|
|
Thanks, but I've already tried using SendInput. However, I don't really want to activate the other window before sending it the keystrokes. I want to continue working with the current window, while simultaneously updating the other window, even if it's minimized.
|
|
|
|
|
Hi,
I have a connection to an active Internet explorer window, where I call the Navigate2 method to download a http page. After calling this navigate method I would like to stop the current thread processing and wait for the web browser to completely download the page.
I currently have the following code,
m_webBrowser.Navigate2(URL);
while(m_webBrowser.GetBusy())
{
DWORD res = WaitForSingleObjectEx(m_webBrowser.GetBrowserWnd (),20000,TRUE);
}
but the method GetBusy() of web browser returns false after only a couple of milliseconds, but I know full well that the page is not yet downloaded. Also the function WaitForSingleObjectEx returns in a complete state.
What I woul ideally like to do is stop within this while loop and wait until the web browser has completely loaded the page, where I can then call the GetHtmlDocument method.
Any ideas
Thanks
CAB
|
|
|
|
|
Hmmm, I don't know. GetBusy has worked fine for me in the past, but then again I was using Navigate not Navigate2. I don't know why in your case it returns false before it should...
As an alternative, you may wanna use the OnDownloadComplete event handler and have it signal an event that you then check inside WaitForSingleObject. I've never done that before; I used your technique and it worked fine.
Good luck!
Alvaro
|
|
|
|
|
Hi,
I am writing an app which communicates with a server using tcp/ip sockets over the internet. What I want to be able to do is add support for connecting via a SOCKS5 proxy server. Has anyone got any suggestions for how to go about it?
James Spibey
I love the word naked, it's brilliant isn't it, 'naked'. When I was a kid I used to write the word naked on a bit of paper hundreds of times and rub my face in it - Jeff, Coupling, BBC2
|
|
|
|
|
hey guys
is there anything i can do like put an entry in the registry to get windows to delete a file when its next starts up. I could write a program and stick it ibn run once but that seems overklill when all i need to do is get windows to start up and delete a file and it only has to do this once.
Any ideas
Cheers
Peter
|
|
|
|
|
On NT, use MoveFileEx(). On 9x/Me, you need to edit %WINDIR%\wininit.ini. On 95, it should look like:
[rename]
NUL=C:\your\file\here.exe On 98/Me it's easier and can be done with WritePrivateProfileString():
[NUL]
c:\your\file\here.exe=1 Be aware that this file gets processed in real mode DOS, so you must use only short filenames.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Is there a way to open a message box in a particular place on the screen ???
elisabeth.sever@europlacer.fr
|
|
|
|
|
AFAIK, the only way is to use CBT hook and respond to HCBT_ACTIVATE notification. If you're not allergic to Visual Basic you may find KB article Q180936 helpful. It's titled 'HOWTO: Position a MsgBox Using a Windows Hook Procedure'
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Cool!
Thanks for the info Tomasz...
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
Nope! You cannot!
If you are very specific about where you want it to come you can write your version of MessageBox and call it instead of using the standard MessageBox.
I am not sure, but there should be something in CP!
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
I want to have a very flat frame, flat tool bar and flat menu, also there is no separate line between the tool bar and menu.
Thank you.
|
|
|
|
|
I need to trap any authentication that the domain makes for any principal, and add my condition to the procedure. I need to check if the prinicipal exists in my special DB and only if so the principal will be able to get the folder/file/process etc on the domain.If you have any relevant information I will be thankful!!!
B"H
|
|
|
|
|
Hi, All!
========
Is there a MSDN for windows XP ?
Thanks.
|
|
|
|
|
Do you mean "does MSDN include docs for windows XP development"? If so, yes it does. Furthermore, the last Platform SDK (now called something else, Windows SDK I think) include everything you need for XP (but not .NET)
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Kind of. Subscribe to MSDN (see M$ web site), and you'll get regular updates.
Alternatively, Look for books in Toys R Us. (Subtle Joke)
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
The MSDN library CD runs on Windows XP, there is no special version. The library contains technical information on creating applications using the new XP feature set.
Michael
|
|
|
|
|
- What means "GNU"?
- Can you help?
- Regards,
Maer
|
|
|
|
|
|
- Thanks pal!
- What means "GNU's not Unix"?
- Can you help?
- Regards,
Maer
|
|
|
|
|
It a bit of a joke. It is supposed to be the first recursive name. GNU can be expanded like:
GNU
GNU´s not UNIX
GNU´s not´s UNIX not UNIX
GNU´s not´s UNIX not´s UNIX not UNIX
.....
It was introduced by Richard Stallmann, who started Free Software Foundation and has made countless valuable contributions to the computer society (like emacs). Most of the linux operating system is based on GNU software (although Torvalds gets the honor for the kernel). The reason for creating GNU and GPL (GNU General Public Licence) was to fight Non-Free software (like UNIX), where the source is not available, and the user is bound by his licence. GPL does not prohibit any use of the source, as long as the final product is also released under GPL. There is also a lesser strict licence mostly used by GNU libraries, allowing developers to use GNU compilers (like gcc) to build non-free applications.
|
|
|
|
|
- Thanks, moliate pal!
- Your reply helps a lot. But I still have a question. I still do not understand the literal meaning of GNU (the meaning of letter "G" ). Is it just a joke?
- Can you help?
- Have a nice weekend,
Maer
|
|
|
|
|
It does not have any literal meaning. It is a word,"gnu" as I already told you, which is an animal's name. Later on, they added this recursive expansion, partly in humor
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
- Thanks, Nish pal!
- Your reply have clarified all my doubts.
- Have a nice weekend,
Maer
|
|
|
|