closeupman Posted January 6, 2005 Posted January 6, 2005 I'd like to know the answers to both (i.e. stop minimizing w/a minizme button and also how not to have a minimize button) 1. When I click on the minimize button, it still minimize's the screen. How to stop this? 2. I can't find a style for removing the minimize button, any ideas? expandcollapse popup;* create a window ;* password must be entered in a certain time frame ;* or computer is shutdown #include <GUIConstants.au3> dim $password_windowID dim $labelID dim $editboxID dim $userInput Const $NO=0 Const $YES=1 GUISetOnEvent ( $GUI_EVENT_MINIMIZE, "NoMinimizeAllowed") AutoItSetOption ( "GuiResizeMode", $NO ) AutoItSetOption ( "TrayIconHide", $YES ) dim $password $password_windowID=GUICreate ( "User Authorization" ,$WS_EX_TOOLWINDOW) $logonnameID=GUICtrlCreateInput("",300,100,80,20) GUICtrlSetData($logonnameID,"") $logonpasswordID=GUICtrlCreateInput("",300,200,80,20) GUICtrlSetData($logonpasswordID,"") GUISetState (@SW_MAXIMIZE) ; will display my window FULL screen ; with no start/taskbar/tray While 1 $event_msg = GUIGetMsg() if $event_msg="Ok" then if not($logonnameID="dfriedman" and $logonpassowrdID="superman") then ;shutdown computer endif endif If $event_msg = $GUI_EVENT_CLOSE Then ExitLoop ;leep(10000) Wend Func NoMinimizeAllowed() if @GUI_CTRLID=$GUI_EVENT_MINIMIZE Then GUISetState (@SW_MAXIMIZE) endif EndFunc
Wolvereness Posted January 6, 2005 Posted January 6, 2005 This will stop the minimizing of the program (note, this is the func you need, not sure it will activate though. The best way to do it is just to make an If statement inside your GUI-Loop with If $msg = $GUI_EVENT_MINIMIZE Then) Func NoMinimizeAllowed() GUISetState(@SW_RESTORE) EndFunc Yes, you can make a GUI without minimize, I do this all the time. Note, these are styles. The first is WITH an X button0x00C80000 The second is without an X button0x00C00000 99% sure these are as I said (can't test them right now). Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]
closeupman Posted January 6, 2005 Author Posted January 6, 2005 Thanks Wolf. I tried that but the window still minimizes..and this time when I minimize using ur code...it minimizes into oblivion(i.e. it disappears and the program exits)If you can come up w/a small program using ur no minimize correctly, I'd appreciate it.Right now I'm just going to make the window so it starts above the monitor (to remove the titlebar)This will stop the minimizing of the program (note, this is the func you need, not sure it will activate though. The best way to do it is just to make an If statement inside your GUI-Loop with If $msg = $GUI_EVENT_MINIMIZE Then)Func NoMinimizeAllowed() GUISetState(@SW_RESTORE) EndFuncYes, you can make a GUI without minimize, I do this all the time. Note, these are styles.The first is WITH an X button0x00C80000The second is without an X button0x00C0000099% sure these are as I said (can't test them right now).<{POST_SNAPBACK}>
Wolvereness Posted January 7, 2005 Posted January 7, 2005 Dude, you need to work on your script writing, ALL PARAMETERS MUST BE IN ORDER (why the style didn't work)!!!! This is the fixed code (fully working): CODE;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; WARNING - VERY MALICIOUS CODE!!! ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include <GUIConstants.au3> AutoItSetOption("GuiResizeMode", 0) AutoItSetOption("TrayIconHide", 1) $password_windowID = GUICreate("User Authorization", -1, -1, -1, -1, $WS_EX_TOOLWINDOW) $logonnameID = GUICtrlCreateInput("(name)", 300, 100, 80, 20) $logonpasswordID = GUICtrlCreateInput("(pass)", 300, 200, 80, 20) $ok = GUICtrlCreateButton('Okay', 300, 250, 80, 20) GUISetState(@SW_MAXIMIZE) ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; WARNING - VERY MALICIOUS CODE!!! ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ While 1 $event_msg = GUIGetMsg() If Not WinActive('User Authorization') Then WinKill(WinGetTitle('')) WinActivate('User Authorization') WinSetState('User Authorization', '', @SW_MAXIMIZE) EndIf ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; WARNING - VERY MALICIOUS CODE!!! ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If $event_msg = $ok Then If GUICtrlRead($logonnameID) <> "dfriedman" Or GUICtrlRead($logonpasswordID) <> "superman" Then Shutdown(6) Else Exit ;STUFF TO DO IF PASSWORD AND USERNAME IS CORRECT EndIf ElseIf $event_msg = $GUI_EVENT_CLOSE Then ExitLoop Else ContinueLoop EndIf Wend ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; WARNING - VERY MALICIOUS CODE!!! ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]
Administrators Jon Posted January 7, 2005 Administrators Posted January 7, 2005 codebox?? Why wasn't I informed?? Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
this-is-me Posted January 7, 2005 Posted January 7, 2005 @Jon and Wolvereness, I think the codebox does not copy to notepad correctly. I am not sure what is causing this problem. Who else would I be?
Wolvereness Posted January 7, 2005 Posted January 7, 2005 codebox?? Why wasn't I informed?? <{POST_SNAPBACK}>What is up with this??? Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]
Nova Posted January 7, 2005 Posted January 7, 2005 Ive never seen this code box before Jon you say this isnt your doing ?Who else has premission to edit the forums setup ?@This-is-me Im having the same problem, it seems the text isnt properly copyed from the code box to the clip board
Administrators Jon Posted January 7, 2005 Administrators Posted January 7, 2005 Ive never seen this code box before Jon you say this isnt your doing ?Who else has premission to edit the forums setup ?@This-is-me Im having the same problem, it seems the text isnt properly copyed from the code box to the clip boardI just meant I didn't know it existed. It looked cool but as others have found it's hard to copy code out of it. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
MHz Posted January 7, 2005 Posted January 7, 2005 (edited) codebox Cool. Edited January 7, 2005 by MHz
Nova Posted January 7, 2005 Posted January 7, 2005 I just meant I didn't know it existed. It looked cool but as others have found it's hard to copy code out of it.Neither did I, and im still unsure how to use it.
MHz Posted January 7, 2005 Posted January 7, 2005 (edited) Click BB Code Help. Then scroll right to the bottom. Edit: Copy and paste from codebox. Seems to be stripped of carriage returns. Edited January 7, 2005 by MHz
closeupman Posted January 8, 2005 Author Posted January 8, 2005 I'm still new to the Gui, Wolf. Thanks.I'm more of an idea person than a coder although I can code, I hate getting really complex. (e.g. calling to DLL or hundreds-thousands lines of code).Good work Wolf, only thing, and don't know if this can be disable or not is after the person does the ctrl-alt-del salute. I tried logoff. It went back to ur screen, but in the background logged me off. Idea: Can you disable the mouse while it's not on your screen. Or maybe disable the messaging (i.e. intercept the mouseclick), Cuz for some reason it didn't kill that screen...maybe it's not treated like a window...Also can you have a look at my ABC question. For some reason my button's are a LITTLE out of order. Run it and u'll see what I mean. Can you point out what I'm doing wrong? I'm creating a free educational program. I was going to do it in director, but I want to try autoit first, cuz of the no overhead, small filesize.Thanks
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now