LB Booster
« Taskbar position and size? »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 05:02am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Taskbar position and size?  (Read 846 times)
Monkfish
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx Taskbar position and size?
« Thread started on: Aug 5th, 2015, 12:55pm »

My forms display in various sizes. Some are small, some short but wider than the screen, some thin but longer than the screen, some are twice the size of the screen. I have worked out how to display them correctly with scrollbars etc, but accounting for the taskbar is a real pain.

Is there an easy way to find out the size and position of the taskbar? Or just the size would help as few people have the taskbar anywhere other than the bottom.

I don't really want to work with maximised windows if I can help it.

Thank you smiley
User IP Logged

Monkfish
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx Re: Taskbar position and size?
« Reply #1 on: Aug 5th, 2015, 2:26pm »

I found some code by Stefan Pendl. Just the job smiley

http://libertybasic.conforums.com/index.cgi?board=novice&action=display&num=1269956995
« Last Edit: Aug 5th, 2015, 2:52pm by Monkfish » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Taskbar position and size?
« Reply #2 on: Aug 5th, 2015, 4:36pm »

on Aug 5th, 2015, 2:26pm, Monkfish wrote:
I found some code by Stefan Pendl. Just the job smiley

http://libertybasic.conforums.com/index.cgi?board=novice&action=display&num=1269956995

I am pleased that you have found a solution, but if I click on that link I simply receive a message that I have been banned from the forum. cry

Richard.
User IP Logged

RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 91
xx Re: Taskbar position and size?
« Reply #3 on: Aug 5th, 2015, 6:05pm »

The code Stephan posted uses SystemParametersInfoA to find the usable area of the desktop.

Quote:
Below find an example of detecting the size of the area not occupied by any task or side bars.



Code:
    nomainwin

' get the size of the desktop area
' not occupied by the task bar
' or any application side bar
    struct RECT, _
        left   as long, _
        top    as long, _
        right  as long, _
        bottom as long

    uiAction = _SPI_GETWORKAREA

    calldll #user32, "SystemParametersInfoA", _
        uiAction as ulong, _
        uiParam  as ulong, _
        RECT     as struct, _
        fWinIni  as ulong, _
        result   as long

' get the coordinates of the rectangle
    PosLeft   = RECT.left.struct
    PosTop    = RECT.top.struct
    PosRight  = RECT.right.struct
    PosBottom = RECT.bottom.struct

' calculate the maximum window size
    MaxWindowWidth = PosRight - PosLeft
    MaxWindowHeight = PosBottom - PosTop

' set the window size
    WindowWidth = MaxWindowWidth
    WindowHeight = MaxWindowHeight

' set the window position
    UpperLeftX = PosLeft + 1
    UpperLeftY = PosTop + 1

' display the window
    open "Full Screen Window with Task Bar showing" for window as #m
    #m "trapclose [quit]"
    wait

[quit]
    close #m
    end
 
« Last Edit: Aug 5th, 2015, 6:07pm by RobM » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Taskbar position and size?
« Reply #4 on: Aug 5th, 2015, 8:38pm »

on Aug 5th, 2015, 6:05pm, RobM wrote:
The code Stephan posted uses SystemParametersInfoA to find the usable area of the desktop.

Excellent. Using _SPI_GETWORKAREA is what I would have suggested too.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »


This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls