Sign in to follow this  
Followers 0
Misuna

_IELinkClickByText doesn't work

2 posts in this topic

#1 ·  Posted (edited)

Hi

I've the problem, that _IELinkClickByText doesn't work (func is called: Google). I want´it to pick the first Google result, but nothing happens.

Does anyone have an idea why?

thanks in advance

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <inet.au3>
#include <IE.au3>
#include <ColorConstants.au3>
#include-once

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=prog.ico
#AutoIt3Wrapper_Outfile=Pc Komponenter .exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

 #Region find OS
Dim $OS = @OSVersion ; OS Version
Dim $textos = ""; Output tekst til msgbox.
Switch $OS ; Et Switch statement. For at gøre de sammlede data bedre læsbare.
Case "WIN_2008"
$OS = "Windows Server 2008"
Case "WIN_81"
$OS = "Windows 8.1"
Case "WIN_8"
$OS = "Windows 8"
Case "WIN_7"
$OS = "Windows 7"
Case "WIN_VISTA"
$OS = "Windows Vista"
Case "WIN_2003"
$OS = "Windows Server 2003"
Case "WIN_XP"
$OS = "Windows XP"
Case "WIN_2000"
$OS = "Windows 2000"
Case "WIN_NT4"
$OS = "Windows NT 4.0"
Case "WIN_ME"
$OS = "Windows ME"
Case "WIN_98"
$OS = "Windows 98"
Case "WIN_95"
$OS = "Windows 95"
Case Else
$OS = "Ukendt"
EndSwitch
$textos &= "OS = " & $OS
#EndRegion

#Region GPU
$textgpu = ""
Dim $Obj_WMIService = ObjGet("winmgmts:\\" & "localhost" & "\root\cimv2")
Dim $Obj_Services = $Obj_WMIService.ExecQuery("Select * from Win32_VideoController")
Local $Obj_Item
For $Obj_Item In $Obj_Services
    $textgpu &= $Obj_Item.Name
Next
#EndRegion

#Region RAM
$textram = ""
Dim $Obj_WMIService = ObjGet("winmgmts:\\" & "localhost" & "\root\cimv2")
Dim $Obj_Services = $Obj_WMIService.ExecQuery("Select * from Win32_PhysicalMemory")
Local $Obj_Item
For $Obj_Item In $Obj_Services
    $textram &=  $Obj_Item.Speed & @crlf
Next
#EndRegion

#Region Motherboard
$textmobo1 = ""
Dim $Obj_WMIService = ObjGet("winmgmts:\\" & "localhost" & "\root\cimv2")
Dim $Obj_Services = $Obj_WMIService.ExecQuery("Select * from Win32_ComputerSystem")
Local $Obj_Item
For $Obj_Item In $Obj_Services
    $manufacturer =  $Obj_Item.Manufacturer
Next
$textmobo1 &= $manufacturer

$textmobo2 = ""
Dim $Obj_WMIService = ObjGet("winmgmts:\\" & "localhost" & "\root\cimv2")
Dim $Obj_Services = $Obj_WMIService.ExecQuery("Select * from Win32_ComputerSystem")
Local $Obj_Item
For $Obj_Item In $Obj_Services
    $model = $Obj_Item.Model
Next
$textmobo2 &= $model
#EndRegion

#Region CPU
$Output = ""
$objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
Local $colItems = $objWMIService.ExecQuery("SELECT Name FROM Win32_Processor", "WQL", 0x10 + 0x20)
If IsObj($colItems) then
    For $objItem In $colItems
        $Output &= $objItem.Name
    Next
Endif
; GuiCtrlSetData($label, $Output )  ; to write it in a label
#EndRegion

 Opt("GUIOnEventMode", 1)
 Global $hGUI2, $hButton2 ; Predeclare these variables
 gui1()

 Func gui1()
     $hGUI1 = GUICreate("Hvad sidder der i min computer?", 614, 436, 300, 125)
     GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close_Main") ; Run this function when the main GUI [X] is clicked
     $Components = GUICtrlCreateLabel("Komponenten", 208, 32, 190, 43)
     GUICtrlSetFont(-1, 24, 400, 0, "Calibri")
     $ComputerName = GUICtrlCreateLabel("Computername", 472, 8, 130, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $Name = GUICtrlCreateLabel(@ComputerName, 472, 32, 100, 19)
     GUICtrlSetFont(-1, 10, 400, 0, "Calibri")
     $Bruger = GUICtrlCreateLabel(@UserName, 472, 48, 100, 19)
     GUICtrlSetFont(-1, 10, 400, 0, "Calibri")
     $OS = GUICtrlCreateLabel($textos, 472, 62, 128, 19)
     GUICtrlSetFont(-1, 10, 400, 0, "Calibri")
     $CPU = GUICtrlCreateLabel("Prozessor", 48, 120, 80, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $Hvilken_CPU = GUICtrlCreateLabel($Output, 208, 120, 356, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $GPU = GUICtrlCreateLabel("Grafikkarte", 48, 176, 100, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Corbel")
     $Hvilken_GPU = GUICtrlCreateLabel($textgpu, 208, 176, 308, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $RAM = GUICtrlCreateLabel("Arbeitsspeicher", 48, 232, 140, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     Local $aMem = MemGetStats()
     $Hvor_Meget_RAM = GUICtrlCreateLabel(Floor($aMem[1]/900000) & "GB", 208, 232, 150, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $Hvor_Meget_RAMSpeed = GUICtrlCreateLabel($textram, 280, 232, 150, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $Hvor_Meget_RAMMhz = GUICtrlCreateLabel("Mhz", 320, 232, 150, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $HDD_Space = GUICtrlCreateLabel("Festplatte", 48, 344, 140, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Corbel")
     Local $iFreeSpace = DriveSpaceFree("C:")
     $Hvor_Meget_Lagerplads = GUICtrlCreateLabel(Floor($iFreeSpace/1024) & "GB", 208, 344, 150, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $af = GUICtrlCreateLabel("frei von", 280, 344, 65, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     Local $iTotalSpace = DriveSpaceTotal("C:")
     $Hvor_Meget_Totallagerplads = GUICtrlCreateLabel(Floor($iTotalSpace/1024) & "GB", 350, 344, 200, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $Mobo = GUICtrlCreateLabel("Mainboard", 48, 288, 80, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $Hvilket_Bundkort = GUICtrlCreateLabel($textmobo1, 208, 288, 341, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $Hvilket_Bundkort2 = GUICtrlCreateLabel($textmobo2, 280, 288, 341, 27)
     GUICtrlSetFont(-1, 14, 400, 0, "Calibri")
     $Copyright_MisunaDK = GUICtrlCreateLabel("Copyright MisunaDK", 504, 416, 102, 17)
     GUICtrlSetFont(-1, 8, 400, 0, "Calibri")
     $Button1 = GUICtrlCreateButton("Schliessen", 345, 400, 73, 25)
     GUICtrlSetOnEvent($Button1, "Close")
     $Button2 = GUICtrlCreateButton("Beurteile", 265, 400, 75, 25)
     GUICtrlSetOnEvent($Button2,"Rate")
     $Button3 = GUICtrlCreateButton("Hilfe", 185, 400, 75, 25)
     GUICtrlSetOnEvent($Button3,"hjaelp")
     GUISetState(@SW_SHOW)

     While 1
         Sleep(10)
     WEnd
 EndFunc

 Func gui2()
     $hGUI2 = GUICreate("F.A.Q.", 400, 300, 410, 200)
     GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close_Secondary_Gui") ; Run this function when the secondary GUI [X] is clicked
     GUICtrlCreateLabel("hier", 72, 142, 75, 23)
     GUICtrlSetOnEvent(-1, "google")
     GUICtrlCreateLabel("'game-debate'" , 100, 100)
     GUICtrlSetOnEvent(-1, "gamedebate")
     $tekst = GUICtrlCreateLabel("Welche Marke ist meinen Computer?" & @CRLF & _
                        "- Wenn du deinen Computer nicht selbst gebaut hast, ist die" & @CRLF & _
                        "  Name des Mainboards normalerweise auch die Marke" & @CRLF & _
                        ""& @CRLF & _
                        "Kann ich ...spielen?" & @CRLF & _
                        "- Guck mal auf                       nach." & @CRLF & _
                        ""& @CRLF & _
                        "Welche intel HD graphics family Karte habe ich?" & @CRLF & _
                        "- 1. Drück" & @CRLF & _
                        "  2. Wähl 'ARK|intel'" & @CRLF & _
                        "  3. Scroll runter zum Graphics specifications - Processor Graphics", 20, 30, 350, 590)
     GUICtrlSetFont(-1, 9, 400, 0, "Calibri")
     GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
     GUISetState()
 EndFunc

#Region Funcs
 Func On_Close_Main()
     Exit
 EndFunc

 Func On_Close_Secondary_Gui()
     GUIDelete($hGUI2)
     GUICtrlSetState($hButton2, $GUI_ENABLE)
 EndFunc

 Func hjaelp()
     GUICtrlSetState($hButton2, $GUI_DISABLE)
     gui2()
 EndFunc

  Func Close()
    Exit
EndFunc

 Func Rate()
    ShellExecute("http://misuna.webs.com/din-mening")
EndFunc

;Func google()
;   Run("C:\Programme\Internet Explorer\iexplore.exe http://www.google.dk/#q=" & _INetExplorerCapable($output) & " graphics")
;   _IELinkClickByText($oIE, "ARK")
;EndFunc

Func google()
    $oIE = _IECreate("http://www.google.de/#q=" & ($output) & " graphics")
    _IELinkClickByText($oIE, "AMD", 0)
EndFunc

Func gamedebate()
    ShellExecute("http://www.game-debate.com")
EndFunc
#EndRegion
Edited by Misuna

Share this post


Link to post
Share on other sites



You really expect that Google will return links where "AMD" is the only text ?

Have a better look at the Example 2  in the _IELinkClickByText page in the helpfile

Share this post


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
Sign in to follow this  
Followers 0