From: JoDeGr8 on 28 Dec 2009 06:09 Hi All, In my application i have a pop-up dialog which gets popped up from the system tray. This dialog gets popped up with the thumbnail sized screenshot and fades away after displaying it for 10 secs when the user presses 'Print Scrn' or any key set by the user. But when the user presses the 'Print Scrn' in quick successions the existing popup dialog should update the new changes if it is visible. I have the 'DoModal()' in a seperate thread which will get spawned up from the hook procedure after detecting 'Print Scr' key press. I just need a way to communicate[to send the update information] with a dialog box[if it is 'alive'] which is opened by another thread. I see this feature in Nod32 antivirus. When it catches a virus it displays a popup dialog to show the virus information and uses the same dialog if it catches any other virus within 15 seconds of the dialog lifetime. What all modifications should i have to do to include this feature? Thank you. Regards, J.
From: Alex Blekhman on 28 Dec 2009 08:05 "JoDeGr8" wrote: > I just need a way to communicate[to send the update information] > with a dialog box[if it is 'alive'] which is opened by another > thread. I think you overengineer it a bit. All you need to do is to 1. Register unique message with RegisterWindowMessage call. 2. Install keyboard hook in order to catch PrintnScrn key press. 3. When PrintnScrn is pressed, post previously registered message to your dialog window. 4. In response to the message repaint/update the dialog. Alex
|
Pages: 1 Prev: Deleting only folders Next: Derivable singleton implementation |