program stucks cause it opened modal dialog in other application
-
Hi, problem is the following: I have a program sending a ButtonClick Message to another app so that this app opens a modal dialog. To achieve this I use PInvoke and the function
SendMessage(hWnd, BM_CLICK, 0, 0)
. This code works, but when the Button is clicked and the modal dialog opens, my program (the one, which sent the message) stopps running, means no code after calling SendMessage is executed (can clearly see this in the debugger). When I manually close the opened dialog in the other app my program runs on. I can't explain myself this behaviour because all other programs run on properly. For example I could write another program, which runs the code, which should be executed after SendMessage. This program would run without any problems. Can anyone explain this to me? Any solutions to let my program work on? Thanks -
Hi, problem is the following: I have a program sending a ButtonClick Message to another app so that this app opens a modal dialog. To achieve this I use PInvoke and the function
SendMessage(hWnd, BM_CLICK, 0, 0)
. This code works, but when the Button is clicked and the modal dialog opens, my program (the one, which sent the message) stopps running, means no code after calling SendMessage is executed (can clearly see this in the debugger). When I manually close the opened dialog in the other app my program runs on. I can't explain myself this behaviour because all other programs run on properly. For example I could write another program, which runs the code, which should be executed after SendMessage. This program would run without any problems. Can anyone explain this to me? Any solutions to let my program work on? ThanksThe
SendMessage
function calls the window procedure for the specified window and does not return until the window procedure has processed the message. To send a message and return immediately, use theSendMessageCallback
orSendNotifyMessage
function.
-
The
SendMessage
function calls the window procedure for the specified window and does not return until the window procedure has processed the message. To send a message and return immediately, use theSendMessageCallback
orSendNotifyMessage
function.
...or
PostMessage
orPostThreadMessage
:) mav -
...or
PostMessage
orPostThreadMessage
:) mavTHX for the completion and congratulations for beating me by seconds on the other thread ;)
-
THX for the completion and congratulations for beating me by seconds on the other thread ;)
Only because my answer was much shorter :-D
-
Only because my answer was much shorter :-D