|
Here you are :
http://www.codeproject.com/dll/#Hooks[^]
[edit] just did the clickety police myself [/edit]
my favorite being J.M Newcomer 's article, which is complete.
Also, the Keyboard hooks from Hirosh Joseph has very good code.
Hooking is really easy : capture windows messages, get your app informed about you catching these messages (usually using user defined messages), and handle these messages in your app.
~RaGE();
|
|
|
|
|
How Do we create new fonts from a Bitmap the size of the font is given. plz do mail me to sreeram_gsr@rediffmail.com
Sreeram
|
|
|
|
|
I am trying to use a Timer in a non MFC framework . I have been able to use this timer in the past. Suddenly I am faced with problems which I am failing to comprehend .
The timer is called as :
timerID=::SetTimer(NULL,NULL,1000,this->TimerCallback1);
that confirms to the syntax
UINT_PTR SetTimer( HWND hWnd,
UINT_PTR nIDEvent,
UINT uElapse,
TIMERPROC lpTimerFunc
);
My Call back is defined as
static VOID CALLBACK TimerCallback1(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime);
Still My Timer Function is not getting called !!!
The strange part is that The timer does get called when the interval is less than 400 msec !!!!
|
|
|
|
|
You have to dispatch the messages, otehrwise WM_TIMER gets stuck in the queue.
act_x wrote:
The strange part is that The timer does get called when the interval is less than 400 msec
That's because you have no messages coming before 400ms, and WM_TIMER is the first one which gets handled by your function.
~RaGE();
|
|
|
|
|
So do i have to keep polling the message queuue by doing
GetMessage() and check to see if it is a WM_TIMER message ?
|
|
|
|
|
No you do not have to check it, but I think you must have a DispatchMessage() somewhere.
~RaGE();
|
|
|
|
|
Does anybody know how to change the caption of the main dialog window dynamicly?
|
|
|
|
|
SetWindowText("Your window text here");
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hi,
I use ShellExecute to run some dos commnds from by application.
Everything works fine but I have to sit in a tight loop to wait for the command to finish like that
<br />
do<br />
{<br />
retval=WaitForSingleObject (sei.hProcess, 0);<br />
} while (retval ==WAIT_TIMEOUT);<br />
This makes my application hang the PC for a long time.
Any elegant way to do it ?
Shay
|
|
|
|
|
Do exactely the same code in a separate thread.
~RaGE();
|
|
|
|
|
Use CreateProcess(), then you'll get a handle you can wait for with WaitForSingleObject()
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
AFAIK, this hangs the app as well, no ?
~RaGE();
|
|
|
|
|
Yup. But using a kernel wait instead of a busy wait would be much nicer for your CPU.
If you want your application to continue to respond to input, then you should use MsgWaitForMultipleObjects() with a message pump. This lets your application respond to input and paint messages while waiting for an event to become signaled.
Ryan
"Everybody has a right to be stupid, but
some people abuse the privilege."
Uncle Joe Stalin
|
|
|
|
|
Ryan S Roberts wrote:
MsgWaitForMultipleObjects() with a message pump
Could you post a tiny code snippet ? I'm interested in this (already tried something like that, but kept having my app crash, probably because of the message queue ...)
~RaGE();
|
|
|
|
|
That's because the time-out interval is 0, which means test the object's state and return immediately. Supply a reasonable time-out interval such as 2000.
|
|
|
|
|
if it's possible to receive events fired by HTML controls that are placed in an HTML file that is displayed in a CHtmlView ???
If is possible, how can I do it ??
|
|
|
|
|
|
I paint something on a window, and wanna save the drawing as a bitmap file? What can I do? Please help me!
stanley
|
|
|
|
|
I am reading a binary file in c++ (reading every 1024 bytes) but get an error when I do this:
do
{
nBytesRead = infile.read( BytePtr,1024 ); // fails on this line
cout << BytePtr << endl;
}
while( nBytesRead > 0 );
The error line says there is no acceptable conversion. I can do this in mfc but it doesn't allow me to do it in c++.
How can I do this in c++??
|
|
|
|
|
How is BytePtr declared? What is read() supposed to return?
|
|
|
|
|
|
Thanks have tried that.
BytePtr is declared as:
ifstream infile;
char *BytePtr = new char[1025];
thanks.
|
|
|
|
|
.NET doesn't have Classwizard, How can I add mouse buttons (OnLButtonDown,..), or OnPaint ???
Ehsan Behboudi
|
|
|
|
|
Hi,
you will have a good tutorial here:
http://www.codeguru.com/columns/Kate/KG061902.html
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Select the resource (dialog) where you want to add the mouse buttons to, in your resource view. Right click on the resource in the right document view. Select properties from the pop-up menu.
A new window appears, click on Control Events in the toolbar. This shows all events for all the controls in your resource.
|
|
|
|