Jump to content
Sign in to follow this  
RedneckTech

Maximize a window

Recommended Posts

RedneckTech

trying to activate a window. currently WinActivate is not working for me.

WinActivate("title")

WinWaitActive("Title")

If Winactive = 0 Then

_errortag("title")

Exit

EndIf

ive put message boxes all through there, the program hits that loop, but never activates the window. ive tried getting it to run multiple ways. the window is open and already minimized to the taskbar. if there is a way to maximize and activate a window it would be much appreciated. even went so far as to start trying _WinAPI functions to no avail.

unless you know how to send keystrokes/commands to a minimized window without activating it, this is a major cramp in the programming process

Share this post


Link to post
Share on other sites
Melba23

RedneckTech,

Perhaps this will explain how to activate a minimized GUI: :graduated:

#include <GUIConstantsEx.au3>

; Create our GUI
$hGUI = GUICreate("Test", 500, 500)

GUISetState()

; Minimize SciTE GUI
$sTitle = WinGetTitle("[CLASS:SciTEWindow]")
WinSetState($sTitle, "", @SW_MINIMIZE)

Sleep(2000)

; And now wake it again
WinSetState($sTitle, "", @SW_RESTORE)
WinActivate($sTitle)
WinWaitActive($sTitle)
If Winactive($sTitle) = 0 Then
    ConsoleWrite("Error" & @CRLF)
    Exit
EndIf

; And wait here
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
RedneckTech

thank you sooooooo much. if theres one thing i hate more than programming its editing someone elses work. combine those 2 and ive been tearing my hair out all day trying to figure this out lol

mainly just been afraid of getting into the GUI stuff as im still pretty nooby at this

Share this post


Link to post
Share on other sites
Melba23

RedneckTech,

My pleasure. ;)

Do not be afraid of asking even simple questions like that - some of us need all the hair we have left and if we can save any......! :graduated:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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  

×