|
Can't you just send it as an attachment?
Regards,
Rohit Sinha
|
|
|
|
|
Hi, does anybody know (can tell us/point us to source code/docs) how to change keyboard mappings for the whole system. Eg. say we want to have Ctrl-K act as if someone pressed the Down Arrow. Can we intercept keyboard messages for the whole system, and then change them before other applications receive them?
thanks in advance
|
|
|
|
|
I suppose you could write a filter and attach it to the driver stack. That way you could modify the IRP before it reaches the RIT. Take a look at kbfiltr in the DDK. There is also another another similar solution at www.sysinternals.com (ctrl2cap), but kbfiltr seems to give you more freedom to manipulate the entire buffer, like inserting keystrokes.
BTW, I will probably have to write something similar in a couple of weeks, so if you find another way I'd be glad to hear about it...
/moliate
The corners of my eyes catch hasty, bloodless motion -
a mouse?
Well, certainly a peripheral of some kind.
Neil Gaiman - Cold Colours
|
|
|
|
|
Rather than using the driver idea (which would work, but is yeuch), you could look at
SetWindowsHookEx (WH_KEYBOARD/WH_KEYBOARD_LL, ...) which can be used for your purpose. Just a search
in MSDN gives many examples.
(And you can debug it more easily!)
Iain.
|
|
|
|
|
I want to Create a Frame/view/doc structure On a ActiveX Control,but It will be Found Memory leak! And I Found that the
reasons is :
CDocManager* CDocManager::pStaticDocManager;
CPtrList* CDocManager::pStaticList;
How Can I avoid Memroy leak?
the Following is My Code :
BOOL Create()
{
if( m_pFrameWnd )
{
if( IsWindow(m_pFrameWnd->m_hWnd) ) return TRUE;
}
CSingleDocTemplate * pDocTemplate;
pDocTemplate = new CSingleDocTemplate(IDR_MAPTYPE,
RUNTIME_CLASS(CMapDoc),
RUNTIME_CLASS(CMapFrame),
RUNTIME_CLASS(CMapView));
// pDocTemplate in destructor function delete this!
CMapDoc * pDoc = new CMapDoc;// in destructor function delete this!
CCreateContext Context;
Context.m_pCurrentDoc = pDoc;
Context.m_pNewDocTemplate = pDocTemplate;
Context.m_pNewViewClass = RUNTIME_CLASS(CMapView);
Context.m_pLastView = NULL;
Context.m_pCurrentFrame = NULL;
CMapFrame * pFrameWnd = new CMapFrame;// in destructor function delete this!
m_pDoc = pDoc;
m_pFrameWnd = pFrameWnd;
m_pDocTemplate = pDocTemplate;
CRect rcMap;
GetClientRect(&rcMap);
BOOL ret = m_pFrameWnd->Create(AfxRegisterWndClass(CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE, rcMap,this,NULL,&Context);
m_pFrameWnd->ShowWindow(SW_SHOW);
return ret;
}
ZHANGYIFEI
|
|
|
|
|
Hello,
I wrote a Windows-Application (not a console applic.)
If I start it in a Console (DOS-Windows in Win98/NT),
so I can give commandlines for example:
"mywinprog.exe var1 var2 var3", it's works fine.
So I can start the winprog with a batchfile ( example.bat in a console ).And for any result, I send ReturnValues from "mywinprog.exe" .
My Problem:
I want to write a String/Text into this console, where I start the mywinprog.exe.
How can I do this ???
The API Funct. is : WriteConsole(handle, text, strlen (txt),0,0), but if I use the GetStdHandle(STD_OUTPUT_HANDLE), I receive value NULL.
With API FindWindowEx(..), I could'nt find the console.
|
|
|
|
|
Hi,
I have a table in MS Access that has Date(short Date) and Time(short Time) fields. I have a CRecordSet object that is to be mapped to the fields of that table.
My questions:
1. What should be data type of the variables in CRecordSet object, to be mapped to corresponding Date and Time fields in MSACCESS.
2. How to retrieve values from these variables. How to use them if they are COleVariant variables.
Help from any one will be appreciated.
Adnan.
|
|
|
|
|
Here's the scenario...
I've a VB project that uses COM objects & also opens an ADO database connection. When the app is shutdown, it just hangs... if i try attaching the debugger to the process, i get the dreaded "DM0025 - Error attaching to process" msg taking down the process that i want to debug
What is also strange about the behavior is that if i dont open an ADO database connection, then the app shutsdown cleanly. I've to mention that the COM object also connects internally to an Oracle database.
How do you go about debugging this behavior?
Any pointers would be appreciated. TIA
Chen Venkataraman
|
|
|
|
|
1. try to attach before shutdown
2. check that you have admin permissions
3. do not use Oracle
|
|
|
|
|
Hey, I posted this before wondering how I could shut down an external program. I am trying to shutdown kazaa and I learned that all I had to do was send the WM_CLOSE command to it.
Now, this would work on most normal programs but Kazaa is in the system tray so instead of closing Kazaa it just "minimizes" it into the tray. If I send the message a second time then it maximizes again. How can I shut it down completely? Thanks for any help.
|
|
|
|
|
Use Spy++ to find out the ID of the message that Kazaa uses to close when you select the close function from the right click menu when it is minimized to system tray.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
Wow, never heard of Spy++ before but thats a great tool. Anyway I found the messages to be WM_DESTROY and then it also called WM_NCDESTROY. Now I have the button call these messages when its pressed but it says that "Kazaalite has performed an illegal operation." The program closes fine but is there anyway I can shut it down without this happening?
|
|
|
|
|
WM_DESTROY and WM_NCDESTROY are messages sent by Windows when it is closing a Window. They aren't messages you can send to a window to make it close.
Instead, try sending a WM_SYSCOMMAND message, with wParam=SC_CLOSE and lParam=0 . This tells the application to close the window.
Software Zen: delete this;
|
|
|
|
|
When I do that it says "Debug Assertion Failed" in EXPLORER.EXE.
|
|
|
|
|
::TerminateProcess() is probably more adequate for this kind of program.
|
|
|
|
|
When you are calling an ActiveX DLL in a VC++ app and you declare a pointer to the SAFEARRAY, how do you reference the actually array data that is being passed back in the function call.
|
|
|
|
|
Explain yourself better and I might be able to help.
|
|
|
|
|
Hi,
Got your email. So you are trying to access the raw array data in C++?
a couple of q's:
> CtGetDigitalOutput128 is being called by C++, not VB, right? (VB can't easily use raw array data.)
> What error/problem do you have when trying to do this, and where?
|
|
|
|
|
Howdy'
I need to resize a CButton according to the text I'm placing in it, when the button is created.
Is there a thing I can do that is easier than doing a DT_CALCRECT on the text(or something like that), and resizing the button to fit ?
Thanks.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
I want to interrupt:
ReadFile(((Messgeraete*)lparam)->h_com, &inbuffer1, 13, &nBytesRead1, NULL);
I've used ReadFile without timeout.
Interruption should be done from another Thread.
Does anybody no an order which kills the "ReadFile".
Thanks
Heiko
|
|
|
|
|
I solve this problem by reading a little bit of the file at a time ( usually 2K, 4K or 8K) then checking to see if I should try to read more. If your are going to use threads use a kill event as your check.
John
|
|
|
|
|
Sorry, for not mention it
I don't want to read from a File. I want to read two times 13bytes for com1;
the 13th ist an carriage return.
You say I should use a kill Event, but I don't know which Event I should take.
Can you give me an example.
Here is a part of my programcode:
h_com = CreateFile("COM1", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
...settings of dcbs and COMMTIMEOUTS
ReadFile(((Messgeraete*)lparam)->h_com, &inbuffer1, 13, &nBytesRead1, NULL);
ReadFile(((Messgeraete*)lparam)->h_com, &inbuffer2, 13, &nBytesRead2, NULL);
Now I need the command (which I want to use in my Thread) to kill the ReadFile
Thanks
Heiko
|
|
|
|
|
Thanks for the info, now that I see what you mean I am not sure how to do this.
John
|
|
|
|
|
Solution was to kill the whole thread which contains the command readfile
|
|
|
|
|
Use ReadFile asynchronously by defining overlapped structure.
Use GetOverlappedResult for waiting for reading completion or for your stop event.
Don't forget to use OpenFile with the flag FILE_FLAG_OVERLAPPED.
|
|
|
|