I'm using the following code to return handle for a open file dialog box shown from Notepad.
Global $Result = DllCall("User32.dll", "HWND", "FindWindowExA", "HWND", WinGetHandle("[CLASS:Notepad]"), "HWND", Null, "STR", "#32770", "STR", "Open")
ConsoleWrite("FindWindowEx Return Value: " & String($Result[0]) & @CRLF)
This always returns 0x00000000
, but given parameters seems correct.
Why does this function return nothing here?
UPDATE
The following syntax worked, but I still can't specify the parent window:
Global $Result = DllCall('User32.dll', 'HWND', 'FindWindowExW', 'HWND', Null, 'HWND', Null, 'WSTR', '#32770', 'WSTR', 'Open')
This finds every dialog box (Paint, WordPad etc.) , but I only want to get the handle to dialog box with parent as Notepad.