Jump to content

Dektop question


Recommended Posts

Hey gang,

Just wondering :idea: , I have been working with @DesktopHeight and @DesktopWidth ,

Question is, Can I set it to only allow for part of the screen. Something like

$dh1 = (@DesktopHeight-100)
$dw1 = (@DesktopWidth-100)

GUICreate("test", $dh1, $dw1, 10, 10)

hope it makes sense lol. Just trying to make it so it takes up only part of the scree, no matter the res settings.

As Usual

Thanks in advance

Cue

Link to comment
Share on other sites

  • Moderators

cueclub,

Have you tried? :idea:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

ok another problem

main()
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>


func Main()

$dh1 = (@DesktopHeight-100)
$dw1 = (@DesktopWidth-100)
$dh2 = (@DesktopHeight-300)
$dw2 = (@DesktopWidth-110)

GUICreate("test", $dh1, $dw1, 10, 10)
_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded ()
GUICreate("autoit.com", $dw1, $dh1, 10, 10)

$GUIActiveX = GUICtrlCreateObj($oIE, 5, 30, $dw2, $dh2)

GUISetState()       ;Show GUI

_IENavigate ($oIE, "autoit.com")

; Waiting for user to close the window
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop

    EndSelect
WEnd

GUIDelete()

Exit
endfunc

When I run it i get an "include" error in the output window.

C:\Program Files\AutoIt3\Include\IE.au3 (3104) : ==> Variable used without being declared.:

Return SetError($_IEStatus_Success, 0, 1)

Return SetError(^ ERROR

->16:20:09 AutoIT3.exe ended.rc:1

Am I missing somthing in the script, or have I added somthing I shouldnt have?

edit: finished question

Edited by cueclub
Link to comment
Share on other sites

The code in the include files is inserted where the #include statement is located. You called Main() before the variable declarations in the include files got executed.

:idea:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

ah that would explain why it works with the function removed. But not as I had written it :idea:

See that's why I like coming here, Much better to have more then 1 brain. Oh and the occasional sarcasm is nice too.

Thx PsaltyDS

Link to comment
Share on other sites

As the salty one pointed out it's because of where you #included your files so maybe it's time for a statement about the general layout I use when creating a script. It's always better to stay with a consistant structure even if you don't use this one.

Starting from the top of the script

Comment Block if required

Global Constants ;; This is where I will have things like $Title and $Version. Just things I know are not in some constants file that I will #Include later

#Include lines

Opt()s ;; AutoIt options

Global / Local variables

Calls to functions that can be made before the GUI (if there is a GUI)

GUI Creation code

The GUI Loop

Functions

Edit Spelling and change code block to quote

Edit 2 Added the last item and modified the one above it to read properly

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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...