Jump to content

Need help


BeZ
 Share

Recommended Posts

Here is my script

#include <GUIConstants.au3>
#include <File.au3>
;#NoTrayIcon

Dim $button_start
Dim $prix
Dim $cout

MsgBox(0, "Script", "Starting Script")

Bloquage ()

Func Bloquage ()
    GuiCreate("blocked", 1024, 768, 0, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    $button_start = GUICtrlCreateButton("Click to start", 452, 374, 150)
    $fname = GUICtrlCreateInput ( "Prenom / First name", 452, 326, 150, 20)
    $lname = GUICtrlCreateInput ( "Nom de famille / Last name", 452, 350, 150, 20)
    
    While 1
        GUISetState()
        $msg = GUIGetMsg()
        Select
            Case $msg = $button_start and $lname = "Nom de famille / last name"
                Erreur ()
                
            Case $msg = $button_start and $lname <> "Nom de famille / Last name"
                _FileWriteLog(@ScriptDir & "\Internet.log","Lastname : " & GUICtrlRead($lname) & " | " & "First name : " & GUICtrlRead($fname))
                ExitLoop
        EndSelect
    WEnd
EndFunc

Func erreur()
    MsgBox(0, "Erreur", "Entrer votre nom / Enter youre name")
    bloquage ()
EndFunc

In the part:

Case $msg = $button_start and $lname = "Nom de famille / Last name"
                Erreur ()
                
            Case $msg = $button_start and $lname <> "Nom de famille / Last name"
                _FileWriteLog(@ScriptDir & "\Internet.log","Lastname : " & GUICtrlRead($lname) & " | " & "First name : " & GUICtrlRead($fname))

It always write the log and exit even if the $lname is "Nom de famille / Last name". What am I doing wrong?

Link to comment
Share on other sites

GuiCtrlRead($lname) <> "Nom de famille / Last name"
oÝ÷ Ù©l¢Ø^¢Ø^­«­¢+Ø)Õ¥
ÑɱI ÀÌØí±¹µ¤ôÅÕ½Ðí9½´µ¥±±¼±ÍйµÅÕ½Ðì(

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

HI,

you need a coach :-)

#include <GUIConstants.au3>
#include <File.au3>
;#NoTrayIcon

Dim $button_start
Dim $prix
Dim $cout

MsgBox(0, "Script", "Starting Script")

Bloquage ()

Func Bloquage ()
    GuiCreate("blocked", 1024, 768, 0, 0, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    $button_start = GUICtrlCreateButton("Click to start", 452, 374, 150)
    $fname = GUICtrlCreateInput ( "Prenom / First name", 452, 326, 150, 20)
    $lname = GUICtrlCreateInput ( "Nom de famille / Last name", 452, 350, 150, 20)
    
    While 1
        GUISetState()
        $msg = GUIGetMsg()
        Select
            Case $msg = $button_start 
                If GUICtrlRead($lname) = "Nom de famille / last name" Then 
                    Erreur ()
                Else
                _FileWriteLog(@ScriptDir & "\Internet.log","Lastname : " & GUICtrlRead($lname) & " | " & "First name : " & GUICtrlRead($fname))
            EndIf
                ExitLoop
        EndSelect
    WEnd
EndFunc

Func erreur()
    MsgBox(0, "Erreur", "Entrer votre nom / Enter youre name")
    bloquage ()
EndFunc

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

I found it before you guys tell me .. Well i found it like 1 min ago and now I come here to see if someone posted and u guys tell me to do exactly what I did :nuke:

While 1
        GUISetState()
        $msg = GUIGetMsg()
        Select
            Case $msg = $button_start and GUICtrlRead($lname) = "Nom de famille / Last name"
                Erreur ()
                
            Case $msg = $button_start and GUICtrlRead($lname) <> "Nom de famille / Last name"
                _FileWriteLog(@ScriptDir & "\Internet.log","First name : " & GUICtrlRead($fname) & " | " & "Last name : " & GUICtrlRead($lname))
                ExitLoop
        EndSelect
    WEnd

Just didnt want to double post or edit so you guys think i just want to get my posts up...

But now i have another problem, the message box appear under the gui (because gui is top-most). I guess I can fidn this by myself but is there a way to make the msgbox even more top-most lol ?

262144 MsgBox has top-most attribute set 0x40000

I think I got it :P. I wonder if it will work tho.

Edited by BeZ
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...