|
I am trying to simulate a user clicking through a series of tasks in IE. Some of those tasks require a user to click on dialog boxes, for example “Deleting this item may have harmful consequences”, or clicking through a “Save As” sequence of dialogs. I can successfully click on the buttons using windows messaging BM_CLICK. The only problem is I have to wait for 1 to 2 seconds after the dialog box is instantiated for the click to happen reliably. But just waiting for a couple of seconds is not an option in this situation. I have tried a number of things to try to deterministically figure out when it is a proper time to be able to click, like setting the dialog to the foreground, set it as the active window, I have trying using BM_LEFTDOWN, and BM_LEFTUP instead of click, trying to send a null message with a callback to make sure it is in a state to process messages, all to no avail.
I think that there is some process that must be happening in the first second or two, that I am unaware of. I would like to be able to hook into the button and listen to all the messages it is receiving or sending from the very instant that it is instantiated and maybe wait for a certain set of messages to happen before I continue the simulation.
Is there a relatively easy way of hooking into another windows messaging queue and seeing ALL the messages that it is sending or receiving (similar to spy).
-KKinnett
|
|
|
|
|
|
If you want to wait until the application is ready to accept input check out the WaitForInputIdle[^] function.
Steve
|
|
|
|
|
I am having an error
e:\Assign1\Form1.h(595): error C3861: 'strip': identifier not found, even with argument-dependent lookup
I am tryin to use the strip() function. Anyone can help?
sherryann ... i am learning
|
|
|
|
|
What strip() function? I can't find one documented
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Mark Salsbery wrote: What strip() function? I can't find one documented
That is a NSFW function.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
1 - try to put something meaningful in the subject line, so people who can help are attracted to it
2 - if you have an error, posting the error is great, but posting the code as well, is even better.
3 - Your form is called Form1, are you using C++/CLI ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How do I specify compiler options in the DDK build environments?
I trying to build with /EHsc to enable c++ exceptions...
Thanks for any help.
|
|
|
|
|
Got it:
"USER_C_FLAGS = /EHsc"
in the sources file.
|
|
|
|
|
Be very careful if you are recompiling drivers in the DDK with that flag. They may not be (in fact, probably are NOT) written to handle exceptions. If you're just compiling your own user-mode app from the DDK environment, no worries.
Judy
|
|
|
|
|
Thanks, I'll have to look at that since it's part of a printer driver
|
|
|
|
|
Hi
I injected a DLL into another process. So far, it works fine.
Now I'd like to send messages to the DLL ... I'tried PostMessage but it always returns ERROR_INVALID_THREAD_ID
The code looks like this:
CreateRemoteThread(hProc, NULL, NULL, (LPTHREAD_START_ROUTINE)LoadLibAddy, (LPVOID)RemoteString, NULL, &ThreadId);<br />
<br />
while(!PostThreadMessage(ThreadId, WM_MYMSG, NULL, NULL))<br />
{<br />
if(GetLastError() == ERROR_INVALID_THREAD_ID)<br />
break;<br />
else Sleep(500);<br />
}
and the DLL loops until a message is received (so it loops infinitivly atm )
while(1)<br />
{<br />
if(GetMessage(&msg, NULL, 0, 0))<br />
break;<br />
}
thanks in advance !
|
|
|
|
|
Do any of these potential problems apply?
"GetLastError returns ERROR_INVALID_THREAD_ID if idThread is not a valid thread identifier, or if the thread specified by idThread does not have a message queue."
"Windows 2000/XP: This thread must either belong to the same desktop as the calling thread or to a process with the same locally unique identifier (LUID). Otherwise, the function fails and returns ERROR_INVALID_THREAD_ID."
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Did you find that information hidden in the documentation?
|
|
|
|
|
Extremely well hidden!
I'm pretty sure I find 2% of answers in my code and 97% hidden in the documentation.
The other 1% I pull out of my
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
I had to do this with MMC a few years ago. I used custom messages WM_APP+n where n > 50 and posted them to the main window. My 'injected' Dll, actually a Console plugin installed an application wide Message Hook and filtered out the things it was interested in. Not an elegant solution I know and I hope you don't have to stoop to it. At least you are trying to recieve messages on your own thread not relying on MS to give your control some runtime.;)
http://msdn2.microsoft.com/en-us/library/ms644959.aspx[^]
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
|
|
|
That's true, although I tend to disagree.
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
What was his question & reply?
|
|
|
|
|
read the title (if it appeared you were too dumb to miss it)
|
|
|
|
|
This is the user who normally just types jibberish and has nothing better to do.
______________________
stuff + cats = awesome
|
|
|
|
|
Do you know suchon_phuong ?
|
|
|
|