Jump to content

click ie popup button and invisible or hide


Recommended Posts

Is there probably a way to click ie popup button and hide or invisible popup button in the same time?

I try to use WinSetState @SW_hide ,

the result is ie crashing or no response because button hide and the next click command won't work...

$oForm=_IEFormGetObjByName($oIE,"form1")
$obutton=_IEFormElementGetObjByName($oForm,"btn_OK")
$hWnd = _IEPropertyGet($oIE, "hwnd")
_IEAction($obutton,"focus")
ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")
WinWait("", "確定存檔嗎?")
WinSetState("","確定存檔嗎?",@SW_Hide)
ControlClick("", "確定存檔嗎?", "[CLASS:Button; TEXT:確定; Instance:1;]")

 

Link to comment
Share on other sites

1 hour ago, yffulf said:

the result is ie crashing

I would like to try your script but it is impossible for me to run it.  I would suggest if you want help that you make a fully runable script that we can test and replicate your issues.  Use _IE_Examples as the basis of your snippet...

Link to comment
Share on other sites

Thanks for reply, this is my full code:

#include <IE.au3>
#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>

$oIE=_IEAttach("延時工資請領明細(LEVEL4)","text")
_IELoadWait($oIE)
$oForm=_IEFormGetObjByName($oIE,"form1")
$obutton=_IEFormElementGetObjByName($oForm,"btn_OK")
$hWnd = _IEPropertyGet($oIE, "hwnd")
_IEAction($obutton,"focus")
ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")
WinWait("", "確定存檔嗎?")
ControlClick("", "確定存檔嗎?", "[CLASS:Button; TEXT:確定; Instance:1;]")

I will open a page manually, and use  code click button on the page,

after that, pop up  will show, I also use code click pop up button. 

What I want to do is click pop up button but don't show pop up.

a little tongue twister, sorry for my poor english...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...