Jump to content

this is "while .... WEnd" Cannot work!


Recommended Posts

#include <WindowsConstants.au3>

#include <GUIConstantsEx.au3>

#NoTrayIcon

$Form1 = GUICreate("Form1", 100, 50, 1323, 730, $ws_popup, $WS_EX_TOOLWINDOW)

$PIC1 = GUICtrlCreatePic("1.jpg", 1, 1, 100, 50)

$Form2 = GUICreate("Form2", 100, 50, 1323, 795, $ws_popup, $WS_EX_TOOLWINDOW)

$PIC2 = GUICtrlCreatePic("2.jpg", 1, 1, 100, 50)

GUISetState(@SW_SHOW, $Form1)

GUISetState(@SW_SHOW, $Form2)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $PIC1

Run("regedit.exe")

Case $PIC2

run("notepad.exe")

EndSwitch

WEnd

help me ~!

Link to comment
Share on other sites

This seems to be working, I had to change the pictures to files that actually existed otherwise it went a bit skitz

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
;#NoTrayIcon

$Form1 = GUICreate("Form1", 100, 50, 1323, 730, $ws_popup, $WS_EX_TOOLWINDOW)
$PIC1 = GUICtrlCreatePic(@Systemdir & "\oobe\images\mslogo.jpg", 1, 1, 100, 50)
$Form2 = GUICreate("Form2", 100, 50, 1323, 795, $ws_popup, $WS_EX_TOOLWINDOW)
$PIC2 = GUICtrlCreatePic(@Systemdir & "\oobe\images\mslogo.jpg", 1, 1, 100, 50)
GUISetState(@SW_SHOW, $Form1)
GUISetState(@SW_SHOW, $Form2)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

        Case $GUI_EVENT_CLOSE
            Msgbox(0,"","Exit")
            Exit
        Case  $PIC1
            Msgbox(0,"","Pic1")
            Run("regedit.exe")
        Case $PIC2
            Msgbox(0,"","Pic2")
            run("notepad.exe")
    EndSwitch
WEnd
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...