Silas

Change window while active

2 posts in this topic

Hello everyone,

I am making a litle programm that helps my classmates how to fix their internet problems.
I just started with is so there isn't very much in the window yet..

But what i want to ask you guy's: is there a way that the window changes while it is active. Like first you see picture 1 and some text, and when you press the start button the hole window changes so that the picture and text are gone and you see something els. And that when you restart it, it is resetted. I tried it whit just opening a new window but that became somewhat odd. Can you guys help me? (And i don't mean by making litle tabs.)

 

In other words: when you press the start button, the picture and start button disapears, and in stead of that other buttons and text and pictures appear.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#Region ### START Koda GUI section ### Form=c:\backup\bots\bronnen\koda\wifi-s.kxf
$Form1 = GUICreate("WIFI-S ©", 762, 467, -1, -1)
GUISetBkColor(0xFFFFFF)
$Start = GUICtrlCreateButton("Start", 568, 368, 131, 57)
GUICtrlSetFont(-1, 11, 400, 0, "Segoe UI")
$Logo = GUICtrlCreatePic("C:\Backup\Bots\WIFI-S\Sources\Home\Logo Wifi-S.jpg", 8, 8, 132, 132)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Start
            Start()

    EndSwitch
WEnd

Func Start()
   
EndFunc

Thank you very much if you have a answer because i searched a lot but i didn't find anything like this.

Share this post


Link to post
Share on other sites



Yes that is possible. Just open the helpfile and look for the appropriate GUICtrlxxxxx functions.

Ik weet zeker dat je het zelf kan vinden en zorg ervoor dat er niet nog een Topic gesloten wordt vanwege Bots, want dat zou nummer 3 zijn en dat blijft niet zonder consequenties!  De directory naam belooft niet veel goeds.  (Lets see what Google makes of this when translated to English) 

Jos 


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

  • Similar Content

    • cookiemonster
      Can't click button after show window
      By cookiemonster
      I have a window with two buttons, when i click the second button it shows a new window and hides the orgional window, when you click close on the second window, it hides the second window and shows the first one again, but now on the first one I can click the buttons but they no longer do anything, why is this?
    • RobOtter
      Resize handler for unresizable windows
      By RobOtter
      Hi,
      I want to write a tool to resize usually unresizable windows (like the file properties window of Windows Explorer for example).
      Although I have already managed to set the window border style to resizable, this of course doesn´t add the resizing feature itself. So, how do I hook on this to perform the resizing of window and controls myself? I think of some kind of event handler but have no idea how start. Can you help me with this?
      Thanks,
      Rob
    • Tirk
      How can I move a GUI wiindow
      By Tirk
      How can I move a GUI window? How can I adjust the gui's position (coordinates) ?
      ... When I click to the green four-way arrow and move the mouse --> move the gui window.

    • stoyan
      Center application window in the current monitor
      By stoyan
      Multi-monitor aware window centring function. Can handle various work area setups as outlined below:

      Those are the variants I've tested.
      #include <Math.au3> #include <WinAPI.au3> #include <WinAPIConstants.au3> #include <WinAPIGdi.au3> #include <WinAPISys.au3> #include <WindowsConstants.au3> Func activeWindowCenter() Const $window = WinGetHandle('[ACTIVE]') Const $monitorInfo = _WinAPI_GetMonitorInfo(_WinAPI_MonitorFromWindow($window)) Const $area[] = [DllStructGetData($monitorInfo[1], 1), DllStructGetData($monitorInfo[1], 3), DllStructGetData($monitorInfo[1], 2), DllStructGetData($monitorInfo[1], 4)] Const $size = WinGetPos($window) If @error Then Return EndIf If BitAND(_WinAPI_GetWindowLong($window, $GWL_STYLE), $WS_MAXIMIZE) Then Return EndIf Const $areaWidth = _Max($area[0], $area[1]) - _Min($area[0], $area[1]) Const $windowOffsetX = ($areaWidth - $size[2]) / 2 Const $x = _Min($area[0], $area[1]) + $windowOffsetX Const $areaHeight = _Max($area[2], $area[3]) - _Min($area[2], $area[3]) Const $windowOffsetY = ($areaHeight - $size[3]) / 2 Const $y = _Min($area[2], $area[3]) + $windowOffsetY WinMove($window, '', $x, $y, $size[2], $size[3], 2) EndFunc Here's simple usage:
      ; include the definition HotKeySet('#o', 'activeWindowCenter') While 1 Sleep(1000) WEnd  
    • Kronitron
      I need a challenge
      By Kronitron
      I taught myself how to script and have done some pretty basic stuff so far.  I wrote the script below to detect the current orientation of my monitor, then switch it to a different orientation. 
      I'm bored and I've got the day off, so I'd like to tackle a new challenge.  Please review the script below to get an idea of my skill level, then suggest something challenging for me to write.  Just no API usage.  Thanks!
      $Desktop_Height = @DesktopHeight $Desktop_Width = @DesktopWidth Run("control desk.cpl") WinWaitActive("Screen Resolution") ControlSend("Screen Resolution", "", "", "!o") If $Desktop_Height < $Desktop_Width Then ControlSend("Screen Resolution", "", "", "{Down}") ElseIf $Desktop_Height > $Desktop_Width Then ControlSend("Screen Resolution", "", "", "{Up}") EndIf ControlSend("Screen Resolution", "", "", "!a") WinWaitActive("Display Settings") ControlSend("Screen Resolution", "", "", "!k") WinWaitActive("Screen Resolution") ControlSend("Screen Resolution", "", "", "!{F4}") Exit