Link to home
Start Free TrialLog in
Avatar of marco_coder
marco_coder

asked on

sendinput this:???? that i can`t send.........NEED HELP C/C++

hi,

i want to send the ? symbol....
but it does not work......
can someone please help me?

Thanx.
void Send_q()
{
INPUT *key;
 
key = new INPUT;
key->type = INPUT_KEYBOARD;
key->ki.wVk = 0x3f; //63;  // the ? symbol
key->ki.dwFlags = 0;
key->ki.time = 0;
key->ki.wScan = 0;
key->ki.dwExtraInfo = 0;
SendInput(1,key,sizeof(INPUT));
key->ki.dwExtraInfo = KEYEVENTF_KEYUP;
SendInput(1,key,sizeof(INPUT));
 
 
 
 
}

Open in new window

Avatar of abel
abel
Flag of Netherlands image

The SendInput might not work on a Vista system because of the User Interface Privilege Isolation settings. If it fails as such, it will not raise an error, it just does nothing.

In all other cases, it should just send the keystrokes. What is the context wherein it is used? Is there a focus on a certain window or input element before you try this? And have you tried other characters besides the question mark? May the receiving function block certain characters, i.e., is it different if you just type the question mark?
Avatar of Member_2_4694817
Member_2_4694817

1)  What does your call to SendInput return? (should be the number of events that it successfully inserted)

2)  I think the KEYEVENTF_KEYUP belongs into the dwFlags, not dwExtarInfo (?)

3)  Just to make sure, check the contents of windows.h if a corresponding VK_... for '?' is really defined using its ASCII code.
ASKER CERTIFIED SOLUTION
Avatar of abel
abel
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Note that, if the dwFlags is zero, as in the first SendInput, it should mean a KEYDOWN event. The code above then effectively sends two KEYDOWN messages...
Avatar of marco_coder

ASKER

Its used to send query`s to google......
so i can submit more then 100,000 sites at once.....
sitemaps.............

only this gives me trouble......
the ? sign.

Thanx
Thanks for clarifying. But we will have to delve deeper to find this problem. SendInput sends your question mark (if you want to be sure, send the question mark to another application or download and install an API viewer which can show you what API calls are being made).

Might the problem be on Google's side? The question mark has a specific meaning in the URL HTTP scheme. It starts the query string. If you do not escape it as "%3F" it cannot be used inside an URL (unless it starts the querypart, meaning, only one question mark allowed that does so). So, in short, if your string is part of Google's query string and contains a question mark, it has to be escaped, otherwise Google cannot process it.

If you still have problems, please explain in more detail what your code does, what the tool or program is it sends keystrokes to and what the reaction is when you do it by hand and when you do it through code, if necessary, with screenshots.
Alternative: In fact if you want to submit lots of pages within the same site, use the google sitemap API, i.e. in principle a textfie containing the page urls.
If you really want to submit lots of sites, I wonder why '?' would play a role in the starting anchor. Moreover, it seems likely that such a big bunch of sites might consist of many identical sites (e.g. domains with different spellings and same content); this is discouraged by google, i.e. will probably not lead to better ranking.
Well i have coded a nice php DYNAMIC database driven meta tag generator.
And my content: 7 million unique products.

And i use tor onion to change ip.
With setcoords i set my mouse at tor onion
right click, move down, left click
sleep 30 seconds...
then i execut cmd ping google.com >online.txt

if the network is up my string compare will find certain words....
then i can submit sites + sitemaps

Its just a part of a solution........ thats why i need to send the ? sign.
Then everything works.
Thanx.







> thats why i need to send the ? sign.

though I don't see why that is necessary, esp. since Google has many APIs you can use transparently and since once they've received a sitemap, will automatically read it in almost daily, I'm not here to judge your approach. Have you read and tried what I said in my last comment? You didn't come back at it, so I assumed everything was fine: https://www.experts-exchange.com/questions/24166349/sendinput-this-that-i-can-t-send-NEED-HELP-C-C.html?cid=238#23724348.
That link didn't go well. Should be: #23724348
Do note so far that your question was about the SendInput function. The SendInput function (win32 API) does not have any problem with the question mark, or any other key. So the problem must be elsewhere.
Lets explain again, i have a database with over 70.000 urls......
and i have a uniq databank of ip`s....

But for the submission software i wrote i need to send the ? sign.
Look at this code...
[code]
void Send_q()
{
INPUT *key;
 
key = new INPUT;
key->type = INPUT_KEYBOARD;
key->ki.wVk = 0x3f; //63;  // the ? symbol
key->ki.dwFlags = 0;
key->ki.time = 0;
key->ki.wScan = 0;
key->ki.dwExtraInfo = 0;
SendInput(1,key,sizeof(INPUT));
key->ki.dwExtraInfo = KEYEVENTF_KEYUP;
SendInput(1,key,sizeof(INPUT));
 
 
}
[/code]

I dont understand why it does not send the ?

Other letters no problem........
But ?  big problem.