Jump to content

Recommended Posts

Sorry i am not very familiar with autoit syntax and help files dont help much. What I want to do is have an if loop.

If a certain form exists (in IE) then call a certain function or do a certain operation.

Is there an IE function to see if a certain form exists?

Thanks in advance

Link to post
Share on other sites

I'm not sure about _IE* functions, but there probably is


But WinExists native function will certainly do that job

Few things to note

I'm not sure it's appropriate to label your topic as "Easy" if you don't know how to do it.

The help files do help, and very much.

Your topic is not really about and "if loop"

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to post
Share on other sites

well my bad it might not be easy :/ but the concept is.

Here is what i have so far. however it gives me syntax error.

$oValue = _IEFormElementGetValue(ByRef $oFormR)
If  $oValue > 0 Then

Func _Main()
    Sleep (7000)
Local $hBitmap, $hClone, $hImage, $iX, $iY
    ; Initialize GDI+ library
    ; Capture 32 bit bitmap
    $hBitmap = _ScreenCapture_Capture("")
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
    ; Create 24 bit bitmap clone
    $iX = 200
    $iY = 70
    $hClone = _GDIPlus_BitmapCloneArea($hImage, 248, 602, $iX, $iY, $GDIP_PXF24RGB)
    ; Save bitmap to file
    _GDIPlus_ImageSaveToFile($hClone, @DesktopDir & "GDIPlus_Image.bmp")
    ; Clean up resources
    ; Shut down GDI+ library
EndFunc   ;==>_Main
Sleep (2000)
_IEAction($oFormR, "focus")
ElseIf $oValue == 0 Then
MsgBox (0,"attention", "no form found")

basically this code does this. if a certain form is found on a page then it does the main function which takes a picture and crops it. However, if IEFormelement returns the value 0 meaning the form was not found i want a message box to appear

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...