Jump to content

If you have two windows, How to change picture ?


Recommended Posts

If have two windows, how can I change picture of the first window without delete the second window ? Thank you in advance for your answers. Best regards :D

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 500, 500, 302, 218)
$Pic1 = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\ExtrasAutoIt.bmp", 0, 0, 0, 0, $SS_BITMAP)
GUISetState(@SW_SHOW, $Form1)
$Form2 = GUICreate("Form2", 500, 500, 302, 218)
$Pic2 = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\ExtrasLogo.bmp", 0, 0, 0, 0, $SS_BITMAP)
WinSetOnTop("Form2", "", 1)
GUISetState(@SW_SHOW, $Form2)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   ;GUISetState($Form2, @SW_DISABLE)
   ;WinSetOnTop("Form2", "", 0)
   GUICtrlDelete ($Pic1)
   $Pic1 = GUICtrlCreatePic("C:\Program Files\AutoIt3\Examples\ExtrasTech.bmp", 0, 0, 0, 0, $SS_BITMAP)
   MsgBox (0, "", "Form1 picture changed :)")
   Exit
EndSwitch
WEnd
Edited by maxrealqnx
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...