J
Jeremy
Hello,
I'm thinking this may be an easy one but I am getting frustrated. How
can I detect if a process is showing a modal dialog. Like "Are you sure
you want to exit?", or an error message etc...
I stumbled across the GetWindow API but am unsure how to work it
properly. The only examples I found are in VBA or VB6.
Private Declare Function GetWindow _
Lib "user32" (ByVal hWnd As IntPtr, ByVal nCmdShow As Int32) As IntPtr
Private Const GW_FIRST As Int32 = 0
Private Const GW_LAST As Int32 = 1
Private Const GW_NEXT As Int32 = 2
Private Const GW_PREV As Int32 = 3
Private Const GW_OWNER As Int32 = 4
Private Const GW_CHILD As Int32 = 5
Private Const GW_STYLE As Int32 = (-16)
Private Const WS_DISABLED As Int32 = &H8000000
Am I on the right track here or is the above even correct...can someone
give me a kickstart? Or is there an even simpler method to detect a
modal dialog? Thanks for your help!
Jeremy
I'm thinking this may be an easy one but I am getting frustrated. How
can I detect if a process is showing a modal dialog. Like "Are you sure
you want to exit?", or an error message etc...
I stumbled across the GetWindow API but am unsure how to work it
properly. The only examples I found are in VBA or VB6.
Private Declare Function GetWindow _
Lib "user32" (ByVal hWnd As IntPtr, ByVal nCmdShow As Int32) As IntPtr
Private Const GW_FIRST As Int32 = 0
Private Const GW_LAST As Int32 = 1
Private Const GW_NEXT As Int32 = 2
Private Const GW_PREV As Int32 = 3
Private Const GW_OWNER As Int32 = 4
Private Const GW_CHILD As Int32 = 5
Private Const GW_STYLE As Int32 = (-16)
Private Const WS_DISABLED As Int32 = &H8000000
Am I on the right track here or is the above even correct...can someone
give me a kickstart? Or is there an even simpler method to detect a
modal dialog? Thanks for your help!
Jeremy