Jump to content

Error In Expression


Recommended Posts

Why do I get the error for this $password_windowID=GUICreate ( "User Authorization" , 800 , 600 , 0 , 0 , ,$WS_EX_TOOLWINDOW)

?

I cut n copied the GuiCreate from the help file and substituted exactly.

;* 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

dim $password



$password_windowID=GUICreate ( "User Authorization" , 800 , 600 , 0 , 0 , ,$WS_EX_TOOLWINDOW)
GUISetState (@SW_SHOW)    ; will display an empty dialog box

 sleep(10000)
Edited by closeupman
Link to comment
Share on other sites

You have a blank parameter in GUICreate

;* 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

dim $password



$password_windowID=GUICreate ( "User Authorization" , 800 , 600 , 0 , 0, $WS_EX_TOOLWINDOW)
GUISetState (@SW_SHOW)   ; will display an empty dialog box

sleep(10000)
Link to comment
Share on other sites

Oh ok, I thought u had to have the , , there for exstyle parameter. I didn't specify.

Btw, do you know how to get rid of the start button and taskbar.

I want my GUI to cover the whole screen and if possible not allow alt+tab

Thanks

:">

You have a blank parameter in GUICreate

;* 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

dim $password
$password_windowID=GUICreate ( "User Authorization" , 800 , 600 , 0 , 0, $WS_EX_TOOLWINDOW)
GUISetState (@SW_SHOW)  ; will display an empty dialog box

sleep(10000)

<{POST_SNAPBACK}>

Link to comment
Share on other sites

You guys skipped a parameter and used an "extended style" for the "normal style" paramater.

It's better to use variables with clear names if you use a function with many parameters.

;* 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

dim $password


$GUI_WIDTH = 800
$GUI_HEIGHT = 600

;To center the dialog on the screen, use -1 instead of 0 for the next 2 params.
$GUI_LEFT = 0
$GUI_TOP = 0

;To use more than 1 style, use BitOR. eg: BitOR($DTS_TIMEFORMAT, $DTS_RIGHTALIGN)
$GUI_STYLE = 0x0
$GUI_EXSTYLE = $WS_EX_TOOLWINDOW

$password_windowID=GUICreate ( "User Authorization" , $GUI_WIDTH, $GUI_HEIGHT, $GUI_LEFT, $GUI_TOP, $GUI_STYLE, $GUI_EXSTYLE)
GUISetState (@SW_SHOW)    ; will display the dialog box

sleep(5 * 1000)
Edited by SlimShady
Link to comment
Share on other sites

Thanks. I did the no no of just typing as creating instead of designing properly.

Thanks for the better version.

Edit:

Though for some reason your version won't let me hide the start and/task bar on the bottom of the screen, even when i've changed it below as specified by the other user (i.e. SW_MAXIMIZE).

It works though with MY code...strange.

Also if i do maximize, I would guess I don't need to specify any coordinate settings?

Slim can u take a look at my Abc post and give me a critique and/or a rewrite?

Thanks

:idiot:

You guys skipped a parameter and used an "extended style" for the "normal style" paramater.

It's better to use variables with clear names if you use a function with many parameters.

;* 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

dim $password
$GUI_WIDTH = 800
$GUI_HEIGHT = 600

;To center the dialog on the screen, use -1 instead of 0 for the next 2 params.
$GUI_LEFT = 0
$GUI_TOP = 0

;To use more than 1 style, use BitOR. eg: BitOR($DTS_TIMEFORMAT, $DTS_RIGHTALIGN)
$GUI_STYLE = 0x0
$GUI_EXSTYLE = $WS_EX_TOOLWINDOW

$password_windowID=GUICreate ( "User Authorization" , $GUI_WIDTH, $GUI_HEIGHT, $GUI_LEFT, $GUI_TOP, $GUI_STYLE, $GUI_EXSTYLE)
GUISetState ([B]@SW_MAXIMIZE[/B])  ; will display the dialog box

sleep(5 * 1000)

<{POST_SNAPBACK}>

Edited by closeupman
Link to comment
Share on other sites

Thanks, that did that, but the title bar is still there. I want my screen to cover the full monitor without showing the title bar. Should I just make it bigger than the screen rather than maximizing? (I would rather not do this...I just tried it and it worked)/

If not, How about removing the minimize button? and getting rid of the A icon in the upper left.

Please see my other post about Minizmize and ABC's

Also, do you know any way to disable alt+tab? and the right clicking?

I would like any advice you can give. Even if you can't answer all.

Thanks

:idiot:

The following will maximize your window, remove the title bar, and cover over your start menu.

$GUI_STYLE = $WS_MAXIMIZE+$WS_POPUP
$GUI_EXSTYLE = -1

<{POST_SNAPBACK}>

Edited by closeupman
Link to comment
Share on other sites

WS_POPUP works for me. Copy the below code and try it.

;* 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

dim $password


$GUI_WIDTH = 800
$GUI_HEIGHT = 600

;To center the dialog on the screen, use -1 instead of 0 for the next 2 params.
$GUI_LEFT = 0
$GUI_TOP = 0

;To use more than 1 style, use BitOR. eg: BitOR($DTS_TIMEFORMAT, $DTS_RIGHTALIGN)
$GUI_STYLE = $WS_MAXIMIZE+$WS_POPUP
$GUI_EXSTYLE = -1

$password_windowID=GUICreate ( "User Authorization" , $GUI_WIDTH, $GUI_HEIGHT, $GUI_LEFT, $GUI_TOP, $GUI_STYLE, $GUI_EXSTYLE)
GUISetState (@SW_SHOW)  ; will display the dialog box

sleep(5 * 1000)
Edited by Radsam
Link to comment
Share on other sites

Ya...weird...that does work, thanks....maybe I copied it wrong b4. Or maybe I switch the params in the GuiCreate. Does it matter if u have exstyle b4 style?

I was able to do a similar thing by just making the screen really huge and putting negative left and top parameters.

Btw, I was able to figure out how to disable ALT+TAB switching by myself....woohooo. :idiot:

Thanks for your help

:D

WS_POPUP works for me. Copy the below code and try it.

;* 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

dim $password
$GUI_WIDTH = 800
$GUI_HEIGHT = 600

;To center the dialog on the screen, use -1 instead of 0 for the next 2 params.
$GUI_LEFT = 0
$GUI_TOP = 0

;To use more than 1 style, use BitOR. eg: BitOR($DTS_TIMEFORMAT, $DTS_RIGHTALIGN)
$GUI_STYLE = $WS_MAXIMIZE+$WS_POPUP
$GUI_EXSTYLE = -1

$password_windowID=GUICreate ( "User Authorization" , $GUI_WIDTH, $GUI_HEIGHT, $GUI_LEFT, $GUI_TOP, $GUI_STYLE, $GUI_EXSTYLE)
GUISetState (@SW_SHOW) ; will display the dialog box

sleep(5 * 1000)

<{POST_SNAPBACK}>

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...