|
|
Are you implying that the trapping of those keys cannot be done programmatically?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Then why suggest going to another forum? While it's not a trival task (i.e., writing a msgina.dll replacement), those keys that the OP was interested in can easily be "trapped" with code. Yes?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
1. We get lots of people posting in the wrong forums.
2. There might have been people in the OS forum familiar with the subject in terms of controlling the features programmatically.
Yes ?
Sheesh, who pressed your button ?
The tigress is here
|
|
|
|
|
Trollslayer wrote:
1. We get lots of people posting in the wrong forums.
Of course, but what automatically led you to believe this was one?
Trollslayer wrote:
2. There might have been people in the OS forum familiar with the subject in terms of controlling the features programmatically.
Yes ?
Of course, but more often than not, folks in non-programming forums would be all too quick to say something along the lines of "Hey, this is a programming question. Take it to a related forum." It's usually the programming forums that answer both programming and non-programming questions.
Trollslayer wrote:
Sheesh, who pressed your button ?
No one, that I recall. I was simply trying to verify what you meant. Lack of details = misinterpretation.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Papa: Thank for a quick reply,
I have check out that app but I dont now how to just use the disable of the keys. And I dont want to use the checkbox I just want to use it when the app starts.
Can you help me... please.
|
|
|
|
|
Then check the second link that i gave you, it has a sample program that use a small class to make this task as easy as calling DisableKeys
Just check the class
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Well I did and I get this;
LINK : fatal error LNK1104: cannot open file "Debug\TaskKeyHook.lib"
What should I do.
|
|
|
|
|
Does TaskKeyHook.lib exist in the Debug folder?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
No that whas the poblem,
But it whas in the realese folder so it works fine now.
But tht I whant to do is to set this funktion on the init dialog funk.
|
|
|
|
|
hian i creted a small program to deal with it
if you like give me your email i will send you both dll and program
I Think It will Work
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Thank,
but it works fine now.
Thank anyway.
|
|
|
|
|
look man just use the windows keyboard hook and when you detect that ctrl+alt+del was hit just return 1; /error and the keyboard will have no //effect
else
return 0; //success
gabby
|
|
|
|
|
Thank you. The cause of the assertion was exactly due to the problem u said.
I want to draw some lines to the screen ,when uses dbl clicks,but I dont have a valid DC then...
Could u give me any suggestion on this one...
|
|
|
|
|
You need to store the data for your lines some other way.
Perhaps in an array of some data class representing the drawing to be performed.
Then, when the user does something, like move the mouse, add some data to your array for the new lines, and then call Invalidate() for your window.
The OnDraw will be called because of the painting to be done, and then you can go through your list of objects and draw the lines.
Basically, you should internally represent all drawing to be done with some data classes and then transform that data to drawing function calls in the OnDraw method.
If you do nto have htis data, and user draws soemthing, then when another window covers yours, and you get a paint message (OnDraw is claled) you will probably lose all the drawing you already did.
|
|
|
|
|
|
I have inserted a dialog to my Dll and generate a class named as CTestDlg by the classview. I alse write a dllexport function:TestDlg
void __declspec(dllexport) __stdcall TestDlg()
{
CTestDlg dlg;
dlg.DoModal();
}
I have checked this dll in an application,but the dialog is not shown,why?
|
|
|
|
|
Try this (from msdn) :
You must add the AFX_MANAGE_STATE macro at the begining of all the exported functions in regular DLLs that dynamically link to MFC to set the current module state to the one for the DLL. This is done by adding the following line of code to the beginning of functions exported from the DLL:
AFX_MANAGE_STATE(AfxGetStaticModuleState( ))
rrrado
|
|
|
|
|
search this forum, somedays ago
there was a similar question.
Its because the ressources (the DLG template)
is loaded from the MainApp ressources and not
from the DLL ressources.
|
|
|
|
|
Hi Guys,
Would like to what is wrong with the following...
[1]Iam drawing to a screen the contents of a page(say, 1st page) & some rectangles as well.(Mfc application-using deviceContext)
Now,I want to load a different page(say, 2nd page) with no figures.
How will I clear everything from screen for drawing the 2nd page,so that the 2nd page doesnt overlap on the contents of the first page...
[2]
// In the MFC generated OnDraw
// m_drawer is a pointer to my defined class to which Iam passing the DC for drawing.
void CMfcTestView::OnDraw(CDC* pDC)
{
CMfcTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
m_drawer->AttachDC(pDC);
}
// Have another function to draw a line to screen on the button down action.
void CMfcTestView::OnLButtonDown(UINT nFlags, CPoint point)
{
CView::OnLButtonDown(nFlags, point);
m_drawer->DrawLine();
}
void DrawLine()
{
CPen newPen(PS_SOLID,2,RGB(color[0],color[1],color[2]));
CPen *pOldPen = m_deviceContext->SelectObject(&newPen);
//Drawing Line
// This call gives me a assertion failure in wingdi.cpp
m_deviceContext->MoveTo(offset,initialyPos);
}
There is no assertion failure when I call "m_drawer->DrawLine()" from OnDraw().
What could be the reason of this.....
Thanks..
|
|
|
|
|
I think the DC you receive in OnDraw is the result of a lower level BeginPaint call.
The DC is released once the 'painting cycle' has completed - after your OnDraw returns, the DC is no longer valid.
You might be retaining it too long.
|
|
|
|
|
Thanks,That might be the reason.Will check that.
Could u put some light on the first part of my question...
Thanks.
|
|
|
|
|
Get the extents of your device context.
See CDC::GetWindowExt in MSDN
Create a 'solid' brush the color of the background.
See CBrush::CreateBrushIndirect in MSDN
Then fill a rectangle the size of your DC to 'erase' the background
See CDC::FillRect in MSDN or try CDC::FillSolidRect - then you do not need the brush.
|
|
|
|