Jump to content

Fill an inputbox in an integrated IE website


Recommended Posts

I could solve to 'integrate' the browser into my GUI, but I would like to fill in one of the Inputboxes.

It isn't an auto-login, just a program with it you can register to my application. And I just want to help the user with filling in the HWID. If it's still problem then sorry!

Here's the code:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("", 300, 150)
$oIE = ObjCreate("Shell.Explorer.1")
GUICtrlCreateObj ($oIE, 0, 0, 300, 150)
$oIE.navigate("http://triplez.x10.mx/Index.html")
GUISetState(@SW_SHOW)While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd

Site Source code:

<b>Account Registration</b><br><html><HEAD></HEAD><form action="Register.php" method="post">Username.....: <input type="text" name="name" /><br />HWID..........: <input type="text" name="hwid" /><br /><input type="submit" value="Register" /></form></html>

And what I want to Fill in:

I would like to fill in the HWID automatically with this:

Func _HWID()
$osdrive = StringLeft(@SystemDir, 3)
$original = "0" & @CPUArch & @KBLayout & DriveGetSerial("C:\") & StringUpper(DriveGetType($osdrive)) & DriveSpaceTotal($osdrive)
$original = _StringToHex($original)
Return $original
EndFunc
Edited by Unc3nZureD
Link to comment
Share on other sites

Add

$oHWID = $oIE.document.getElementsByName("hwid").item(0)

$oHWID.value = _HWID()

or

#include <IE.au3>

: : : : :

_IENavigate($oIE, "http://triplez.x10.mx/Index.html")

$oHWID = _IEGetObjByName($oIE, "hwid")

_IEFormElementSetValue($oHWID, _HWID())

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...