Obtain the size and position of the taskbar.

Source: Internet
Author: User

The taskbar can be dragged to any position on the screen (one of the top, bottom, and left), and the size of the taskbar varies with the screen resolution.

The followingCodeUsed to obtain the size and position of the taskbar:

''' <Summary> <br/> ''' taskbar <br/> ''' </Summary> <br/> ''' <remarks> </remarks> <br/> Public structure taskbar </P> <p> Public bounds as rectangle </P> <p> Public directionf as direction </P> <p> Public Enum direction <br /> bottom = 0 <br/> left = 1 <br/> Top = 2 <br/> right = 3 <br/> end Enum </P> <p> end structure </P> <p> Public Function gettaskbarrect () as taskbar </P> <p> dim tadkbararea as new taskbar 'taskbar area <br/> dim workingarea as rectangle = screen. getworkingarea (new point (0, 0) 'working area <br/> dim screenarea as rectangle = screen. getbounds (new point (0, 0) 'main screen area </P> <p> 'determines the position in the upper left corner to determine the direction of the taskbar <br/> with workingarea. location <br/> If. X = 0 andalso. y = 0 andalso workingarea. width = screenarea. width then <br/> tadkbararea. directionf = taskbar. direction. bottom </P> <p> tadkbararea. bounds. X = 0 <br/> tadkbararea. bounds. y = workingarea. height <br/> tadkbararea. bounds. width = workingarea. width <br/> tadkbararea. bounds. height = screenarea. height-workingarea. height <br/> elseif. x> 0 then <br/> tadkbararea. directionf = taskbar. direction. left </P> <p> tadkbararea. bounds. X = 0 <br/> tadkbararea. bounds. y = 0 <br/> tadkbararea. bounds. width = screenarea. width-workingarea. width <br/> tadkbararea. bounds. height = workingarea. height <br/> elseif. X = 0 andalso. y> 0 then <br/> tadkbararea. directionf = taskbar. direction. top </P> <p> tadkbararea. bounds. X = 0 <br/> tadkbararea. bounds. y = 0 <br/> tadkbararea. bounds. width = workingarea. width <br/> tadkbararea. bounds. height = screenarea. height-workingarea. height <br/> elseif. X = 0 andalso. y = 0 andalso workingarea. height = screenarea. height then <br/> tadkbararea. directionf = taskbar. direction. right </P> <p> tadkbararea. bounds. X = workingarea. right <br/> tadkbararea. bounds. y = 0 <br/> tadkbararea. bounds. width = workingarea. width <br/> tadkbararea. bounds. height = workingarea. height <br/> end if <br/> end with </P> <p> return tadkbararea </P> <p> end function <br/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.