|
I can't change A or C. B is the only app I am writing and have control over.
|
|
|
|
|
Have you tried PostMessage() with the WM_KEYDOWN message?
|
|
|
|
|
Sh*t/Alt/Ctrl keys can't be sent using postmessage.
|
|
|
|
|
njhy wrote: sh*t/Alt/Ctrl keys can't be sent using postmessage.
Wrong. Those keys can be sent by using PostMessage()
::PostMessage(myHwnd, WM_KEYDOWN, VK_SHIFT, 0);
::PostMessage(myHwnd, WM_KEYUP, VK_SHIFT, 0);
This code will send a shift key press and release event to the window with the handle myHwnd . And similarly you could send just any key press event, even multiple (simultaneous) key press events.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Try it your self. It does not work.
::PosMessage(myWnd, WM_KEYDOWN, VK_F13, 0); // VK_13 is SHIFT + F1
::PosMessage(myWnd, WM_KEYUP, VK_F13, 0);
or
::PosMessage(myWnd, WM_KEYDOWN, VK_SHIFT, 0);
::PosMessage(myWnd, WM_KEYDOWN, VK_F1, 0);
::PosMessage(myWnd, WM_KEYUP, VK_F1, 0);
::PosMessage(myWnd, WM_KEYUP, VK_SHIFT, 0);
|
|
|
|
|
Hmm... I've got it working by executing my code from within a DLL (a hook, to be precise). Neither do I have dev tools on this machine, so I can't test something right now.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I tried in a hook DLL, but did not work either. Can you post your codes here?
|
|
|
|
|
I'll be happy to share code with you if that would help you. I'll write to you when I am on my Dev machine.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
what about a combination of keybd_event(Shift/Ctrl/Alt) and PostMessage(key).
|
|
|
|
|
Hi everybody,
- I want to scan a list of parallel port of my PC in my app.
- and I want to set parallel port to ECP mode in BIOS from my app.
I use VC++ 6.0, Win2k.
How to do that ?
Best Regards,
Quang,
|
|
|
|
|
Hi,
The OS's from Win2000 to greater versions will not allow to access the ports directly. you may need to use a third party component to do it. i think in net u can find free libraries.
|
|
|
|
|
quangpk wrote: - I want to scan a list of parallel port of my PC in my app.
Have you tried the Win32_ParallelPort WMI class?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
- I write a DLL with funtions inport/outport, use CreateFile,OpenSCManager,OpenService,StartService,....
- I copy my App with my DLL file to some PC. some of them work ok and some other didn'n work.
Why ?
|
|
|
|
|
quangpk wrote: Why ?
I have no clue. What have you discovered using the debugger? Have you narrowed the problem down to just one or two statements? Are you checking return values from functions?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi, I copy file hwinterface.sys to folder .../window/system32/drivers/
(I use win NT2K) my App work.
|
|
|
|
|
quangpk wrote: my App work.
Great.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi
I want to disable pasting on an edit control
i have created a subclass control for CEdit and am using the following bit of code to disable pasting
which works in the way it stops the user being able to paste into the edit control
but it is disabling the v character as well so they are unable to type that in
Can anyone advise on a solution, so that it disables paste but the user can still use the v char
thanks
Simon
BOOL CCPEditControl::PreTranslateMessage(MSG* pMsg)
{
switch( pMsg->message )
{
case WM_KEYDOWN:
{
switch( pMsg->wParam )
{
case 0x56:
{
if( GetKeyState(VK_CONTROL) )
return true;
}
break;
}
}
break;
case WM_RBUTTONDOWN:
{
return true;
}
break;
}
return CEdit::PreTranslateMessage(pMsg);
}
|
|
|
|
|
si_69 wrote: Can anyone advise on a solution
No, and if there was one you certainly would not find it in the documentation[^]
led mike
|
|
|
|
|
You just need to override the default processing for the WM_PASTE message, something like:
LRESULT CCPEditControl::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch( message )
{
case WM_PASTE:
{
return 0;
}
break;
}
return CEdit::DefWindowProc(message, wParam, lParam);
}
Gavin Taylor
|
|
|
|
|
See replies here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You found he's the same guy and linking him to the replies over there? You're such a detective.
|
|
|
|
|
We can also find questions by George_George at other sites.
Maxwell Chen
|
|
|
|
|
OK, That does it - he must be a cabal of nascent developers. All those questions cannot be the work of one man! (Or even a multi-tasking woman)
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
VC++ 6.0
I am using CDatabase - for opening MDB file.
Does anyone knows anything that will give me number of tables present into databse with their names?
Thanks in advance
AmolM
|
|
|
|
|