Jump to content

Do Function Once


BrettF
 Share

Recommended Posts

I am trying to get thsis function (in the case section of the GUI to work once and the not to load the page again.) It wont. It ends up loading the page in an infinite loop (well duh! its in while wend tags...) i have tried to use IF $var = 1 then do the function $var = 0 else ;do nothing but it dosnt work. Could someone please help?

$Restricted = "www.google.com.au"
        Case _IEAttach (WinGetTitle ("Ba-Browser"),"URL") = $Restricted
        IF NOT $times = 1 Then
        DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetwindow, "str", @ScriptDir & "\Restricted_Page.html")
        TrayTip ( "Popup", "An attempted load on a restricted site has been performed.", 10,1)
        $times = 0
            IF @error = 7 Then
                EndIf
        Else
                
        EndIf

Why wont it work???

Thanks, Bert. :)

Link to comment
Share on other sites

  • Moderators

I am trying to get thsis function (in the case section of the GUI to work once and the not to load the page again.) It wont. It ends up loading the page in an infinite loop (well duh! its in while wend tags...) i have tried to use IF $var = 1 then do the function $var = 0 else ;do nothing but it dosnt work. Could someone please help?

$Restricted = "www.google.com.au"
        Case _IEAttach (WinGetTitle ("Ba-Browser"),"URL") = $Restricted
        IF NOT $times = 1 Then
        DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetwindow, "str", @ScriptDir & "\Restricted_Page.html")
        TrayTip ( "Popup", "An attempted load on a restricted site has been performed.", 10,1)
        $times = 0
            IF @error = 7 Then
                EndIf
        Else
                
        EndIf

oÝ÷ ÙhrÂíÜ(®Dájy,êí?ú®¢×ºÚ"µÍQÜH
È[
If what is at error... TrayTip?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

IF @error = 7 Then
If what is at error... TrayTip?
Hi,

I think it should come from _IEAttach ==> 7 ($_IEStatus_NoMatch) = No Match

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

  • Moderators

Hi,

I think it should come from _IEAttach ==> 7 ($_IEStatus_NoMatch) = No Match

So long,

Mega

Well then, the @error is even more messed up than I thought...

I'm aware of 4 @error returns for DLLCall() and none that I'm aware of for ToolTip(), but I was being facetious about the @error, it was my way of saying... hey, it's not supposed to be there.

I'd look up his DllCall() but he didn't provide the link to MSDN to it.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Well then, the @error is even more messed up than I thought...

I'm aware of 4 @error returns for DLLCall() and none that I'm aware of for ToolTip(), but I was being facetious about the @error, it was my way of saying... hey, it's not supposed to be there.

I'd look up his DllCall() but he didn't provide the link to MSDN to it.

Dont worry Guys... I'll have to re-write it anyway. :)

Link to comment
Share on other sites

  • Moderators

Dont worry Guys... I'll have to re-write it anyway. :)

I see the reason you didn't provide the MSDN link, it uses cwebpage.dll...

If the DLL is failing (we don't know because you aren't using error handling for it that I know of), are you sure that the $internetwindow is a hwnd?

And having never worked with that DLL personally, from the little bit I've searched on google and here, I don't see anyone using anything for the 'str' parameter but actual links where you are using a file... I don't know if that is correct or not.

I'd like to know where some API documentation is for this though if anyone knows.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...