Jump to content
Sign in to follow this  
YOUF

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

Recommended Posts

YOUF

#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 ~!

Share this post


Link to post
Share on other sites
ChrisL

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.