|
Could you show me an example of using SendInput to send a key to an active window plz ? I find it difficult to find a specific example
|
|
|
|
|
I found this using Google.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank you very much
|
|
|
|
|
DavidCrow wrote: I found this using Google.
he he he Answer of yahoo getting very popular
|
|
|
|
|
Plz help me one more time. I would like to know how to send WM_KEYUP by SendInput. When I send a key, it seems to be pressed forever ...
|
|
|
|
|
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I've read many pages from the pages you gave me but I still can't find the answer They recommend to use SendMessage but it doesn't work with SendMessage...
|
|
|
|
|
Is the problem with sending or receiving? What does your code look like?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This is my code :
HWND windowHandle = ::FindWindow(0, _T("Test"));
INPUT *key;
::SetForegroundWindow(windowHandle);
key = new INPUT;
key->type = INPUT_KEYBOARD;
key->ki.wVk = VK_CONTROL;
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));
::SendMessage(windowHandle,WM_KEYUP,0,0);
|
|
|
|
|
capint wrote: ::SendMessage(windowHandle,WM_KEYUP,0,0); //==> No effect ?
What does SendMessage() return?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i am doing dialog based appliations and in the dialog there are lots of controls(radio buttons, combo boxes and buttons).
i guess the default size of fonts is 10. i need to change that to 12 and make it bold. how do i do that?? is there any way to make the font default to 12?
|
|
|
|
|
|
thanks a lot for the response.. i will certainly try out with the material u provided.. thanks again..
|
|
|
|
|
You must first create your font with CreateFont and then use of SetFont.
|
|
|
|
|
If you do not wish to change font programatically you can change it from dialog properties. There is a option to change the dialog template which inturn will apply to all child controls.
Regards,
Sandip.
|
|
|
|
|
good tip!, one could easily modify the RC files for same. like for dialog Rc entry should be something like this :-
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About TestProject"
FONT 8, "MS Sans Serif"
you could edit this to change the font size to 12 :-
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About TestProject"
FONT 12, "MS Sans Serif"
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
good tip!, one could easily modify the RC files for same. like for dialog Rc entry should be something like this :-
<small>IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About TestProject"
FONT 8, "MS Sans Serif"</small>
you could edit this to change the font size to 12 :-
<small>IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About TestProject"
<b>FONT 12</b>, "MS Sans Serif"</small>
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
hey thanks for the tip.. but will this give me an exception?? and is this a temporary solutions??
|
|
|
|
|
Chandrasekharanp wrote: hey thanks for the tip.. but will this give me an exception?? and is this a temporary solutions??
Naah it is permanent solution and it won't give you any exception
|
|
|
|
|
Hi all,
Please tell me how can use enter key on ListCtrl.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
Yes but it not working.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Why not work and also did you use of WM_KEYDOWN?
|
|
|
|
|
Did you subclassed the ListCtrl
-@SuDhIrKuMaR@-
|
|
|
|
|
ListCtrl used in FormView.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|