Jump to content
Sign in to follow this  
Normonator

Controls created on the wrong gui?

Recommended Posts

Normonator

Okay so i am planning on making an alternate start menu, but when i create the second gui through a function it makes the labels on the original window and i don't know what i did wrong.

If you can help me out that wold be great and if you can, could you explain what i did wrong or forgot?

k thx :mellow:

Here is my script:

Opt('guioneventmode', 1)

#include <winapi.au3>

#include <guiconstants.au3>

#include <buttonconstants.au3>

#include <editconstants.au3>

#include <windowsconstants.au3>

#include <file.au3>

#include <misc.au3>

#include <string.au3>

#include <staticconstants.au3>

$StartHeight = _WinAPI_GetWindowHeight(WinGetHandle('[CLASS:Shell_TrayWnd]', ''))-2

$height=@DesktopHeight-$StartHeight-2

$style = BitOR ($ss_center,$ss_centerimage)

$maingui=GUICreate('Titanium',100,$StartHeight,0,$height,$ws_popupwindow,-1,WinGetHandle('[CLASS:Shell_TrayWnd]'))

GUISetOnEvent($gui_event_secondarydown,'_win')

GUISetState(@SW_SHOW)

GUISetOnEvent($gui_event_close,'_exit',$maingui)

GUICtrlCreateLabel('',0,0,100,$StartHeight)

GUICtrlSetState(-1,$gui_disable)

GUICtrlSetBkColor(-1,0x3A3A3A)

GUICtrlCreateLabel('Start',0,0,100,$StartHeight,$style,$gui_ws_ex_parentdrag) ; yop banananana

GUICtrlSetOnEvent(-1,'_menu')

GUICtrlSetBkColor(-1,$gui_bkcolor_transparent)

GUICtrlSetColor(-1,0xC59E18)

$menu=1

$win=255

While 1

WinSetOnTop('Titanium','',1)

Sleep(10)

WEnd

Func _menu()

If WinExists('Menu') Then

_exitmenu()

Else

$menu=GUICreate('Menu',500,500,-1,-1,$ws_popupwindow,-1,$maingui)

GUISetState(@SW_SHOW)

GUISetOnEvent($gui_event_close,'_exit',$maingui)

$menu1=GUICtrlCreateLabel('',0,0,500,25)

GUICtrlSetState($menu1,$gui_disable)

GUICtrlSetBkColor($menu1,0x3A3A3A)

$menu2=GUICtrlCreateLabel('',450,2,20,20)

GUICtrlSetBkColor($menu2,0xC59E18)

GUICtrlSetState($menu2,$gui_disable)

$menu3=GUICtrlCreateLabel('',475,2,20,20)

GUICtrlSetBkColor($menu3,0xC59E18)

GUICtrlSetState($menu3,$gui_disable)

$menu4=GUICtrlCreateLabel('Menu Test',0,0,450,25,$style,$gui_ws_ex_parentdrag)

GUICtrlSetBkColor($menu4,$gui_bkcolor_transparent)

GUICtrlSetColor($menu4,0xC59E18)

$minimize=GUICtrlCreateLabel('_',450,2,20,20,BitOR($style,$ss_sunken),$gui_ws_ex_parentdrag)

GUICtrlSetOnEvent($minimize,'_minimize')

GUICtrlSetBkColor($minimize,$gui_bkcolor_transparent)

$close=GUICtrlCreateLabel('x',475,2,20,20,BitOR($style,$ss_sunken),$gui_ws_ex_parentdrag)

GUICtrlSetOnEvent($close,'_exit')

GUICtrlSetBkColor($close,$gui_bkcolor_transparent)

EndIf

EndFunc

Func _minimize ()

GUISetState(@SW_MINIMIZE,$maingui)

EndFunc

Func _minimizemenu ()

GUISetState(@SW_MINIMIZE,$menu)

EndFunc

Func _exit ()

For $trans = $win To 0 Step -.5

WinSetTrans('Titanium','',$trans)

Next

Exit

EndFunc

Func _exitmenu ()

GUIDelete(WinGetHandle('Menu'))

EndFunc

Func _win()

Send('{lwin}')

EndFunc


[member='That Guy']~~Normonator~~

Share this post


Link to post
Share on other sites
Yoriz

You need to use this before the controls that are going to the wrong window

GUISwitch 
--------------------------------------------------------------------------------

Switches the current window used for GUI functions.


GUISwitch ( winhandle [, tabitemID] )

Many of the GUI specific functions work on the "current" window - this is usually the last window created with GUICreate. This function allows you to make another window "current".

GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites
Normonator

Wow thanks I think I had tried something like that before but I don't think I did it right well I obviously did it wrong but oh well. Thanks for the help now I can finish my start bar hopefully.


[member='That Guy']~~Normonator~~

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  

×