Click here to Skip to main content
15,891,698 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Problem with use of Mutex and System Tray Icon Together. Pin
«_Superman_»7-Aug-09 19:25
professional«_Superman_»7-Aug-09 19:25 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
Le@rner7-Aug-09 19:49
Le@rner7-Aug-09 19:49 
AnswerRe: Problem with use of Mutex and System Tray Icon Together. Pin
Randor 7-Aug-09 20:44
professional Randor 7-Aug-09 20:44 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
Le@rner7-Aug-09 22:30
Le@rner7-Aug-09 22:30 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
PJ Arends8-Aug-09 6:34
professionalPJ Arends8-Aug-09 6:34 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
Randor 8-Aug-09 6:52
professional Randor 8-Aug-09 6:52 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
PJ Arends8-Aug-09 8:09
professionalPJ Arends8-Aug-09 8:09 
GeneralRe: Problem with use of Mutex and System Tray Icon Together. Pin
Randor 9-Aug-09 11:39
professional Randor 9-Aug-09 11:39 
PJ Arends wrote:
But he does point out the reason why FindWindow() is not an appropriate method to find the first instance of the app.


Hi PJ,

You are correct. In retrospect I think Supermans idea of using CreateEvent/SetEvent would be the best option. I just spent the last 15 minutes using WinDbg to step through calls to FindWindow in the user32.dll that shipped with Windows7. It appears that FindWindow has the same behavior as previous versions of Windows in that it results in the call to SendMessageW which could potentially result in a deadlock.

PJ Arends wrote:
He also illustrates a method using EnumWindows() and SendMessageTimeout() to better accomplish the desired task


I have reviewed his code and determined that it does not handle modality. His code should call GetLastActivePopup or ShowOwnedPopups. Even this technique has some disadvantages...

Superman's idea is superior in every respect. It would allow the previous instance to respond to the event and activate its own windows.

Thanks for your comments PJ!

Best Wishes,
-David Delaune
Questionsome confuse about compatible DC and compatible Bitmap Pin
xtwgigu7-Aug-09 17:24
xtwgigu7-Aug-09 17:24 
AnswerRe: some confuse about compatible DC and compatible Bitmap Pin
Rozis9-Aug-09 8:41
Rozis9-Aug-09 8:41 
GeneralRe: some confuse about compatible DC and compatible Bitmap Pin
xtwgigu9-Aug-09 14:21
xtwgigu9-Aug-09 14:21 
QuestionChanging DefaultSecurity Settings on a New Folder. Pin
Bram van Kampen7-Aug-09 14:44
Bram van Kampen7-Aug-09 14:44 
Question[Message Deleted] Pin
transoft7-Aug-09 9:16
transoft7-Aug-09 9:16 
AnswerRe: C++ question Pin
David Crow7-Aug-09 9:44
David Crow7-Aug-09 9:44 
GeneralRe: C++ question Pin
transoft7-Aug-09 10:15
transoft7-Aug-09 10:15 
QuestionTVN_SELCHANGED double access Pin
Vaclav_7-Aug-09 5:53
Vaclav_7-Aug-09 5:53 
AnswerRe: TVN_SELCHANGED double access Pin
Le@rner7-Aug-09 19:14
Le@rner7-Aug-09 19:14 
GeneralRe: TVN_SELCHANGED double access [modified] Hacked to solve! Pin
Vaclav_8-Aug-09 12:16
Vaclav_8-Aug-09 12:16 
Questionstack,graphics Pin
kumarashoka7-Aug-09 5:46
kumarashoka7-Aug-09 5:46 
AnswerRe: stack,graphics Pin
harold aptroot7-Aug-09 6:01
harold aptroot7-Aug-09 6:01 
AnswerRe: stack,graphics Pin
Chris Losinger7-Aug-09 7:38
professionalChris Losinger7-Aug-09 7:38 
AnswerRe: stack,graphics Pin
David Crow7-Aug-09 9:36
David Crow7-Aug-09 9:36 
GeneralRe: stack,graphics Pin
Chris Losinger8-Aug-09 10:36
professionalChris Losinger8-Aug-09 10:36 
Questionpointer Pin
kumarashoka7-Aug-09 5:21
kumarashoka7-Aug-09 5:21 
AnswerRe: pointer Pin
Maximilien7-Aug-09 5:35
Maximilien7-Aug-09 5:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.