Home > Software engineering >  How to simulate click on "ok" button? Thank you very much!
How to simulate click on "ok" button? Thank you very much!

Time:10-07



As shown in figure, modify the home page in INTERNET options, and I want to use the VBS to simulate click "ok" button
If is direct analog keyboard press the return key, homepage here will be a newline instead of point "ok" button
My current method is the following

WshShell. SendKeys "% b"
WScript. Sleep 500
WshShell. SendKeys "% {F4}
"
Press ALT + A "application", such as 500 milliseconds after press ALT + F4 exit
So go through two steps, and the middle to the response time of the 500 milliseconds
If simulated click on "ok" button, only one step, how to simulate click "ok" button, please?

Please give specific complete code, I am a novice, bother you, thank you!

CodePudding user response:

This home page address can be modified directly by the registry...

CodePudding user response:

Home Page Settings in the registry HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Internet Explorer \ Start Page of the Main key,

CodePudding user response:

reference 1st floor Topc008 response:
this homepage address can be modified directly by the registry...

IE11 after software update, already can't

CodePudding user response:

refer to the second floor caozhy response:
home Page Settings in the registry HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Internet Explorer \ Main Start Page button,

IE11 after software update, already can't

CodePudding user response:

Sending 3 Shift + Tab keys, the focus can be moved to the confirm button, at this time to Enter,

CodePudding user response:

http://www.autohotkey.com

CodePudding user response:

reference 5 floor of123 reply:
sending 3 Shift + Tab keys, the focus can be moved to the confirm button, at this time to Enter,

I was hoping to 2 steps into step 1, you this method to the step 4,,,,

CodePudding user response:

Then you'll have to use FindWindow FindWindowEx and SendMessage API, I'm afraid not step can do,

CodePudding user response:

You try to simulate the keys Ctrl + Enter line no,

CodePudding user response:

references 9 f Chen8013 response:
Ctrl + Enter do not you try to simulate buttons,
no, actually when you reply, can field test,

CodePudding user response:

I wish I could test, won't say "try... Line no "!
Or no 9 f the reply,
-_ -!!!!!!

Would you please tell me, on the android mobile phone how to try...

CodePudding user response:

refer to 7th floor xxwl2008 response:
Quote: refer to fifth floor of123 response:

Sending 3 Shift + Tab keys, the focus can be moved to the confirm button, at this time to Enter,

I was hoping to 2 steps into step 1, you this method to the step 4,,,,
press Shift + Tab to go, so focus on the Tab page, then send the enter key can directly,

Words using vb to do much more accurate, convenient, you can use the API function lookup to determine button and operation,

CodePudding user response:

Under the promotion, by the way my clsWindow. CLS class:
http://download.csdn.net/detail/sysdzw/5833701
Add module modWindow and clsWindow can use the

 Dim w As New clsWindow 
If w.G etWindowHwndByTitle (" Internet properties ") & gt; 0 then w.C lickElementByText "sure"
  • Related