Sign in to follow this  
Followers 0
zvvyt

Parent GUI w/ backgroundimage and transparent child GUI ontop?

16 posts in this topic

Hello there!

The idea I'm having is the following:

To have a GUI with the left half scrollable and to have a background image which is "fixed" and won't be moved with the scrolling.

To do this I've so far come up with:

Placing the backgrond image onto a parent GUI

Creating a child GUI to the parent, ontop of the left half of the parent

Using "GUIScrollbars_Ex.au3" to easy insert my scrollbars into the child gui

The problem I'm having is that the background image places itself ontop of the child GUI, making the child not visible.

I have tried placing the same background image into the child GUI to recieve the same result I want, but by doing so the image will move with my scrolling. (The right half of the parent is covered by another image, so that's why I'm able of placing the same background image into the child GUI)

If I'm somehow able of placing the background image "behind" the child GUI I could use either a transparent .GIF or .PNG to make the child window show the image aswell as my controls.

Any direct thoughts about this, or do you need me to post some of the code?

Best regards,

Share this post


Link to post
Share on other sites



zvvyt,

do you need me to post some of the code?

Yes please - then we will see exactly what you have done so far. ;)

M23

P.S. When you post your code please use Code tags - put [autoit] before and [/autoit] after it. :)


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

Alrighty then! ^__^

I took only the parts about GUIs and their controls now, which I recon are what matters.

#include <ButtonConstants.au3>
#include "GUIScrollbars_Ex.au3"





$MainWindow = GUICreate("Main Window", 800,500,-1,-1,-1)
;$ItemBackground = GUICtrlCreatePic(".\..\LoL Recommended Builder\ItemsBackground.jpg",0,0,900,600,$bs_flat) ;--------Here's the background image stated in my last post
GUICtrlSetState($ItemBackground,$gui_disable)
$Border = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Border.jpg",802-260*(500/390)-38,0,38,500,$bs_flat)
$ChampionSplash = GUICtrlCreatePic("",802-260*(500/390),"",260*(500/390),390*(500/390),$BS_FLAT)
$ButtonCC = GUICtrlCreateButton("Change Champion",700,0,95,25,$GUI_NOFOCUS)
$RecItem1 = GUICtrlCreateIcon("icons.dll","NOITEM",470,440,50,50)
$RecItem2 = GUICtrlCreateIcon("icons.dll","NOITEM",525,440,50,50)
$RecItem3 = GUICtrlCreateIcon("icons.dll","NOITEM",580,440,50,50)
$RecItem4 = GUICtrlCreateIcon("icons.dll","NOITEM",635,440,50,50)
$RecItem5 = GUICtrlCreateIcon("icons.dll","NOITEM",690,440,50,50)
$RecItem6 = GUICtrlCreateIcon("icons.dll","NOITEM",745,440,50,50)
$HighlightRecItem = GUICtrlCreateGroup("","","","","")
GUICtrlSetState(-1, $gui_hide)
$HighlightSelectedItem = GUICtrlCreateGroup("","","","","")
GUICtrlSetState(-1, $gui_hide)
$Read = FileReadLine("List.ini",2)
$ItemDropdown = GUICtrlCreateCombo("",50,50,200,45)
GUICtrlSetState(-1,$gui_hide) ;--------------------------------------------------------------------------------------------Temp. Hidden
GUICtrlSetData(-1,$Read)
$SelectedItem = GUICtrlCreateIcon("","",300,100,64,64)
$BackButton = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Back.jpg",165,370,100,30) ;Back-button
GUICtrlSetState(-1,$gui_hide)
GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\ItemTextBackgroundDark.jpg",0,400,430,100) ;Background for itemtext
$ItemText = GUICtrlCreateLabel("",10,410,420,80)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@sw_hide,$MainWindow)


;-----------------------------------------------------------------------------Child Windows----------------------
$CatWindow = GUICreate("Main Category Window",430,400,0,0,$ws_child,"",$MainWindow) ;First child-window with the main categories
;$ItemBackground = GUICtrlCreatePic(".\..\LoL Recommended Builder\ItemsBackground.jpg",0,0,900,600,$bs_flat);----And here is where I tried placing the background again.
$CatDefense = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Cat.Defense.jpg",115,45,200,40)
$CatAttack = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Cat.Attack.jpg",115,110,200,40)
$CatMagic = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Cat.Magic.jpg",115,175,200,40)
$CatMovement = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Cat.Movement.jpg",115,240,200,40)
$CatConsumables = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Cat.Consumables.jpg",115,305,200,40)
GUISetState(@sw_hide,$CatWindow)

$CatWindowDefense = GUICreate("Defense",430,400,0,0,$ws_child,"",$MainWindow) ;A child-window showing the defense subcats
$DefenseSubcatHealth = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\SubCat.Health.jpg",115,45,200,40)
$DefenseSubcatMagicResist = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Subcat.MagicResist.jpg",115,110,200,40)
$DefenseSubcatHealthRegen = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Subcat.HealthRegen.jpg",115,175,200,40)
$DefenseSubcatArmor = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Subcat.Armor.jpg",115,240,200,40)
GUISetState(@SW_HIDE)

Best regards

Share this post


Link to post
Share on other sites

zvvyt,

That script looks very much as if it is game-related (League of Legends) - you have read the Forum Rules I take it? ;)

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

That script looks very much as if it is game-related (League of Legends) - you have read the Forum Rules I take it? :)

It is correct, that game is made "for" League of Legends!

I dunno if you're a player yourself or not, but the meaning of this program is to make a visual solution for a function created by Riot games themselves.

I'll describe this in short:

Ingame each champion has got a "Recommended build", an item build that if you follow it you'll do "good" in game with that character.

There's a way of making your own "Recommended build" for whichever champion you'd like, but to do so you have to type all the specific item numbers and such into a .ini file, all this implemended by Riot Games.

It works outside of "LoL", so it's nothing really to do with the game itself, therefor I take it this is allowed to take up for discussion? ;)

More about this function can be read here: http://na.leagueoflegends.com/board/showthread.php?t=1177803 where their "tech support" explains how to do this yourself w/ the .ini and so ^__^

Best regards,

Share this post


Link to post
Share on other sites

zvvyt,

I am not a gamer so I have no idea what you are talking about. I am locking this thread until I can find out more. Please accept my apologies in advance if this is an unnecessary precaution. ;)

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

As long as this remains a purely GUI question I'm going to allow this. There's no manipulation of the game here. There's no manipulation of the INI file, either. As long as this discussion remains strictly on the GUI it's fine.

Share this post


Link to post
Share on other sites

You can create the ScrollBar this is the basic code

#include-once
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hParent=GUICreate('',400,500)
GUICtrlCreatePic('Tc3.jpg',0,0 ,400,500)
GUICtrlSetState(-1,$GUI_DISABLE)
GUISetState(@SW_SHOW,$hParent)
$h_Child=GUICreate('',100,300,10,10,$WS_POPUP,$WS_EX_MDICHILD,$hParent)
GUISwitch($h_Child)
GUICtrlCreateEdit('',10,10,90,290)
GUISetState(@SW_SHOW,$h_Child)
Local $nMsg[1]
While $nMsg[0]<>-3
$nMsg=GUIGetMsg(1)
WEnd

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

First of all: Thank's for unlocking the thread! =)

You can create the ScrollBar this is the basic code

#include-once
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hParent=GUICreate('',400,500)
GUICtrlCreatePic('Tc3.jpg',0,0 ,400,500)
GUICtrlSetState(-1,$GUI_DISABLE)
GUISetState(@SW_SHOW,$hParent)
$h_Child=GUICreate('',100,300,10,10,$WS_POPUP,$WS_EX_MDICHILD,$hParent)
GUISwitch($h_Child)
GUICtrlCreateEdit('',10,10,90,290)
GUISetState(@SW_SHOW,$h_Child)
Local $nMsg[1]
While $nMsg[0]<>-3
$nMsg=GUIGetMsg(1)
WEnd

By adding the $WS_POPUP,$WS_EX_MDICHILD to the child made it be ontop and in position, but it "flickers" a bit when it "popups". Is that avoidable? Or do I "have to live with it?"

And then to the child gui being transparent: Ain't that possible to achieve w/ GuiCtrlCreatePic and a transparent .GIF? Or do I need to use GDI+ and a transparent .png?

Share this post


Link to post
Share on other sites

Ain't that possible to achieve w/ GuiCtrlCreatePic and a transparent .GIF?

If u r dealing with GIF's then Tracexx UDF will sound helpful

herez the link :

but it "flickers" a bit when it "popups". Is that avoidable? Or do I "have to live with it?"

I dont see any flicker with my code

Regards

Phoenix XL


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

If u r dealing with GIF's then Tracexx UDF will sound helpful

herez the link :

Link seem to be broken, but found it by Google.

Can I recieve same transparent result with .GIF as with .PNG? First time dealing with this matter so I have no clue >__<

I dont see any flicker with my code

Could be becuase I'm having another GUI up before the parent and child one.

EDIT: Fixed by reorganizing the GuiSetState-commands

Best regards,

Edited by zvvyt

Share this post


Link to post
Share on other sites

I haven't carefully read everything in this thread but I notice you keep referring to a transparent child. Transparent child windows are not so easy but you can do it in AutoIt if you have a child with the style $WS_EX_MDICHILD.

Here is a simple example

#include <windowsconstants.au3>
#include <winapi.au3>

$G1 = GUICreate("Parent")
GUICtrlCreateButton("quite a long button across the middle of the parent gui",20,200)
GUISetState()

$C1 = GUICreate("child",200,300,0,0,-1,bitor($WS_EX_MDICHILD, $WS_EX_LAYERED),$G1)
GUISetBkColor(0xacbdef);set the child background to some colour which we can set as the transparent colour
$btn1 = GUICtrlCreateButton("a button",20,50)
GUISetState()
_WINAPI_SetLayeredWindowAttributes($C1, 0xacbdef, 255)

sleep(9000)
1 person likes this

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I haven't carefully read everything in this thread but I notice you keep referring to a transparent child. Transparent child windows are not so easy but you can do it in AutoIt if you have a child with the style $WS_EX_MDICHILD.

Here is a simple example

#include <windowsconstants.au3>
#include <winapi.au3>

$G1 = GUICreate("Parent")
GUICtrlCreateButton("quite a long button across the middle of the parent gui",20,200)
GUISetState()

$C1 = GUICreate("child",200,300,0,0,-1,bitor($WS_EX_MDICHILD, $WS_EX_LAYERED),$G1)
GUISetBkColor(0xacbdef);set the child background to some colour which we can set as the transparent colour
$btn1 = GUICtrlCreateButton("a button",20,50)
GUISetState()
_WINAPI_SetLayeredWindowAttributes($C1, 0xacbdef, 255)

sleep(9000)

Your code worked like a charm on the transparancy! =D

Now it's just that when I click on a picture control in the child gui, an earlier hidden window comes back visible ... Just by adding the

bitor($WS_EX_MDICHILD, $WS_EX_LAYERED

and

GUISetBkColor(0xacbdef) _WINAPI_SetLayeredWindowAttributes($C1, 0xacbdef, 255)

Feels quite strange for me that this could happen. Will have a deeper look into it tomorrow.

EDIT: By removing the style $ws_child and replace it with $ws_popup I got away from the problem where another window would pop up. Dunno how, dunno why. Could be that something collided when I used both $ws_child and $ws_ex_mdichild.

Thanks for all your help in this matter! =D Much appreciated!

Edited by zvvyt

Share this post


Link to post
Share on other sites

Melba23

Melba23

Yes, me!

  • Posted Image
  • Moderators (Mod)
  • Posted Image
  • 11,757 posts
  • Gender:Not Telling
  • Location:Where never lark or even eagle flew

Posted Today, 03:50 AM

meows,

Regardless of whether you wrote the game or not, the Forum Rules prohibit the discussion of any script which interacts with or launches a game. Your script does exactly that and so is not permitted here - this thread is now locked. :naughty:

Please make sure your future posts are within the rules. :)

M23

This is not fair. I got locked for asking how to make a graphic buttom user clickable and I built the game. Some folks have friends in higher places than I do.

But thanks for the questions and answers. I learned a bit.

Share this post


Link to post
Share on other sites

meows,

This script did not interact with the game in any way as Valik makes quite clear:

There's no manipulation of the game here. There's no manipulation of the INI file, either

Your script by your own admission launches the game - which is prohibited under the Forum rules

Case $Icon1
        $Icon1= ShellExecuteWait("C:0aTestlvl3.exe", "","C:0aTest", "")
        ShellExecuteWait("C:0aTestChina2a.exe", "","C:0aTest", "")
EndSelect

That is the difference and that is why your thread was locked. :naughty:

And posting in another thread like this is not the way to make me change my mind. I will consider what to do with you during my drive home. :mad:

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

meows,

I have now returned home, eaten and deliberated as to what I am going to do.

I have always made it clear that if I lock a thread I am quite prepared to listen to reasoned argument as to why I should not have done so. On several occasions - and this thread is a good case in point - the thread has indeed been reopened. But I will only reopen a thread if the OP can convince me that there is good reason to do so. In the thread to which you are referring you made it quite clear that the script was to launch a game - which is quite clearly prohibited under the Forum Rules. As I pointed out in the thread, it does not matter: if you wrote the game; if it is single player; if it is for your use only - the rules are quite clear:

"Do not discuss any of the following:

Automating games or game servers. This rule is zero tolerance. Any discussion of using AutoIt to launch or interact with a game or game server violates our rules"

As I stated in my earlier post, the script in this thread does not interact with the game while your script does - hence the difference in moderation. :mellow:

But you, instead of arguing reasonably, decide on an imflammatory post suggesting that there is favouritism and corruption with in the ranks of the Moderators. While I was quite prepared to let your initial thread pass by without imposing sanctions, I am not prepared to stand by while you attack the honour and integrity of those volunteers who give up their time to keep this forum the sort of place the majority of members wish it to be. If you cannot abide by the rules as set out by the forum owner and argue against those who enforce them - in as just a manner as they can - then you obviously forfeit your right to use the forum. :mad:

You will be unable to post for a month. When and if you return, either abide by the rules and show respect for those whose task it is to apply them or you will find yourself permanently removed. You have used up any shred of flexibility that I may have been prepared to show you - any attempt to PM me about this will result in an immediate block. :naughty:

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  
Followers 0

  • Similar Content

    • Miliardsto
      By Miliardsto
      Hello.
      Drag option works only on parent window but as we can see on the parent gui is showed up child gui (on the right side with the color).
      Desired action is when we want to drag whole program we can also drag child gui and child gui will drag with parent gui.
      How to do this?
       
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> GUIRegisterMsg($WM_NCHITTEST, "_NCHITTEST") $hGUI = GUICreate("Test", 500, 500, -1, -1) $cButton_0 = GUICtrlCreateButton("Child 0", 10, 10, 80, 30) $cButton_1 = GUICtrlCreateButton("Child 1", 10, 50, 80, 30) $cButton_2 = GUICtrlCreateButton("Child 2", 10, 90, 80, 30) GUISetState(@SW_SHOW, $hGUI) ; guis Global $hChild_[3] Global $countGUI = UBound($hChild_) - 1 ;MsgBox("","",$countGUI) ; licznik dla GUI Global $gui = 0 $hChild_[0] = GUICreate("Child 0", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0xFF0000) GUISetState(@SW_SHOW, $hChild_[0]) $hChild_[1] = GUICreate("Child 1", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0x00FF00) GUISetState(@SW_HIDE, $hChild_[1]) $hChild_[2] = GUICreate("Child 2", 350, 300, 150, 0, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) GUISetBkColor(0x0000FF) GUISetState(@SW_HIDE, $hChild_[2]) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton_0 _All_Hide() GUISetState(@SW_SHOW, $hChild_[0]) $gui = 0 Case $cButton_1 _All_Hide() GUISetState(@SW_SHOW, $hChild_[1]) $gui = 1 Case $cButton_2 _All_Hide() GUISetState(@SW_SHOW, $hChild_[2]) $gui = 2 EndSwitch WEnd Func _All_Hide() GUISetState(@SW_HIDE, $hChild_[0]) GUISetState(@SW_HIDE, $hChild_[1]) GUISetState(@SW_HIDE, $hChild_[2]) EndFunc Func _NCHITTEST($hWnd, $uMsg, $wParam, $lParam) If $hWnd = $hGUI Then Local $aPos = WinGetPos($hWnd) If Abs(BitAND(BitShift($lParam, 16),0xFFFF)- $aPos[1]) < 500 Then Return $HTCAPTION EndIf Return $GUI_RUNDEFMSG EndFunc  
    • IAMK
      By IAMK
      Hello,
       
      I have a script which uses a GUI with two buttons. It gets shown and hidden., and pressing the buttons (including their hotkeys) highlights the button, making you able to press enter the next time.
      However, I don't want that.
       
      I've tried using WinActivate() to make enter do things on another program, but the enter is still tied to the AutoIT GUI (which still has the button highlighted).
       
      Here's the important part of my code:
      $MY_GUI = GUICreate("Check.exe", 400, 300, ((@DesktopWidth / 2) - 200), -500) WinSetOnTop($MY_GUI, "", 1) ;Keeps the window on the top. $Button1 = GUICtrlCreateButton("Pass (Ctrl+P)", 40, 250, 120, 40, $WS_GROUP) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Fail (Ctrl+F)", 240, 250, 120, 40, $WS_GROUP) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $GUIText = GUICtrlCreateLabel("", 20, 10, 360, 230) GUICtrlSetFont(-1, 13, 400, 0, "MS Sans Serif") GUICtrlSetData($GUIText, Execute($stepMessage[$step])) $showGUI = "True" GUISetState(@SW_SHOW) While($showGUI = "True") $buttonPressed = GUIGetMsg() Switch $buttonPressed Case $Button1 ;Pass $pass = "True" $buttonPressed = 0 $showGUI = "False" GUISetState(@SW_HIDE) Case $Button2 ;Fail $buttonPressed = 0 $showGUI = "False" GUISetState(@SW_HIDE) While($message = "") $message = InputBox("Check.exe", "Please enter the reason the step failed." & @CRLF, "", "", 300, 200, ((@DesktopWidth / 2) - 150), -400) WEnd Return $message EndSwitch WEnd Local $pass = "False" ;Whether "Pass" or "Fail" was pressed. Local $failLog = xxxfunc($pass) ;Returns a message to log if the step failed. ##THIS CALLS THE CODE SNIPPET ABOVE## FileWrite($file, _Now() & ": Step " & $step & getStatus($pass) & "and took " & Ceiling(TimerDiff($timer) / 1000) & " seconds." & @CRLF) If($failLog <> "") Then FileWrite($file, "Logged comment: " & $failLog & @CRLF) EndIf WinActivate("[TITLE:ProgramName]") ;Hotkeys: HotKeySet("^{p}", "pressPass") HotKeySet("^{f}", "pressFail") Func pressPass() $buttonPressed = $Button1 EndFunc Func pressFail() $buttonPressed = $Button2 EndFunc  
      The GUI's button/hotkey pressing works correctly.
      The same WinActivate code works in another script of mine.
      Together, WinActivate is not take "Active" away from the GUI's last-pressed button. How do I fix this?
       
      Thank you in advance.
    • fatpig
      By fatpig
      Dear AutoIT Community.
      I am currently working on a program that will display lots of images in a scroll down GUI.
      I create the GUI based on the number of images, which works fine.
      But all images I place using GuiCtrlCreatePic above a threshold of around 32000 pixels (cant say exactly) are placed at negative locations and finally will reach 0 again
      and will then populate on top of the images placed there before.
      For $i = 1 To $Images[0] ; Get picture dimensions $hImage = _GDIPlus_ImageLoadFromFile($ImgRep & $Images[$i]) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) _GDIPlus_ImageDispose($hImage) ; Resize & place images in GUI $Pic[$i] = GUICtrlCreatePic($ImgRep & $Images[$i], $Spacer, Round($yPos, 0), $MaxImgWidth, $MaxImgWidth * ($iY / $iX)) $yPos = $yPos + $MaxImgWidth * ($iY / $iX) + $Spacer $log = $log & "|" & $yPos $currentlut = $Images[1] Next I have found a limit at 32767 pixels for some GUI elements when googling around.
      Can someone tell me how to circumvent that?
      thanks!
      cheers
      Felix
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Guys this is my gui and i need the numeric value typed in the highlighted  inputbox. if this value is greater than 1 i need to perform some operations
      \
       
      Here is the summary about that field which i got from wininfo tool

      i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it... 

      here i am using the valu present in the field

      can you guys tell me what's wrong??? or how can i get that value?
       
      My_GUI.au3

    • Neonovaz
      By Neonovaz
      Hello
       
      Is there anyway to store word documents in Autoit GUI? For example I have a instruction sheet that I want to bundle up with the exe.

      So a user simply clicks the icon and the stored document will launch  (Something like how you can add objects like excel sheets in word documents )

      (I Know we can launch word files from script directory)