BBC BASIC for Windows
« Calling Michael Hutton »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:08pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Calling Michael Hutton  (Read 456 times)
KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Calling Michael Hutton
« Thread started on: Sep 6th, 2015, 4:58pm »

I've been playing around with your "SplashScreen" program - can't remember where I got it from and can't find it on the Wiki or here - and have managed to get rid of the annoying blank between effects by having two dialog boxes and switching between them.

However in the REMs in the program you mention that you have managed to get it to work on more than one monitor - but that's the bit I can't work out. Can you give me any pointers, please?
User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: Calling Michael Hutton
« Reply #1 on: Sep 11th, 2015, 10:02pm »

grin I've never been called by a topic in a forum before! Sorry, Ken I am a very infrequent visitor to this site.

I will take a look at it and see what I was saying. I think I do remember something about just pushing the position of the window beyond (left or right) the border of the screen but I may be wrong there. Let me check and I'll get back to you.

Michael
User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: Calling Michael Hutton
« Reply #2 on: Sep 11th, 2015, 10:35pm »

Ah Ken, I remember now.... you can't set it to work on a specific monitor but it will default to open up on the same monitor that you open the program up in. Sorry about that.... I presume you want to control it..

I also presume you will have to mess around with this bit of code...
Code:
      REM RECT and MONITORINFO Structures
      _MONITOR_DEFAULTTONEAREST = &2
      DIM rc{ Left%, Top%, Right%, Bottom% }
      DIM mi{cbSize%, rcMonitor{} = rc{}, rcWork{} = rc{}, \
      \ dwFlags%, szDevice&(31)}
      mi.cbSize%=DIM(mi{})
      
      REM WINDOWPLACEMENT structure for use with "GetWindowPlacement"
      DIM wp{length%, flags%, showcmd%, minpos{x%,y%}, \
      \      maxpos{x%,y%}, normal{l%,t%,r%,b%}}
      wp.length% = DIM(wp{})
      
      REM Get the monitor info
            REM Calculate where to place the picture in dialog box units
      REM Works with different DPI values
      SYS "GetWindowPlacement", @hwnd%, wp{}
      wxpos% = wp.normal.l%
      wypos% = wp.normal.t%
      
      $$device%=mi.szDevice&()
      monitor$=$$device%
      monitor%=VAL(RIGHT$(monitor$,1))
      
      REM Calculate the position of the dialog
      IF monitor%=1 THEN
        IF wxpos%<(mi.rcMonitor.Right%-mi.rcMonitor.Left%)/2 THEN
          dxpos%=(mi.rcMonitor.Right%-mi.rcMonitor.Left%)/2-(wxpos%+xsize%/2)
        ELSE
          dxpos%=-(wxpos%-((mi.rcMonitor.Right%-mi.rcMonitor.Left%)-xsize%)/2)
        ENDIF
        IF wypos%<(mi.rcMonitor.Bottom%-mi.rcMonitor.Top%)/2 THEN
          dypos%=(mi.rcMonitor.Bottom%-mi.rcMonitor.Top%)/2-(wypos%+ysize%/2)
        ELSE
          dypos%=-(wypos%-((mi.rcMonitor.Bottom%-mi.rcMonitor.Top%)-ysize%)/2)
        ENDIFSYS "MonitorFromWindow",@hwnd%,_MONITOR_DEFAULTTONEAREST \
      \ TO hMonitor%
      SYS "GetMonitorInfo", hMonitor%, mi{} TO ret%
      IF ret%=0 ERROR 100,"GetMonitorInfo failed"
      

      ELSE
        IF wxpos%<(mi.rcMonitor.Right%-mi.rcMonitor.Left%)/2+mi.rcMonitor.Left% THEN
          dxpos%=(mi.rcMonitor.Right%-mi.rcMonitor.Left%)/2+mi.rcMonitor.Left%-(wxpos%+xsize%/2)
        ELSE
          dxpos%=-(wxpos%-((mi.rcMonitor.Right%-mi.rcMonitor.Left%)+mi.rcMonitor.Left%-xsize%)/2)
        ENDIF
        IF wypos%<(mi.rcMonitor.Bottom%-mi.rcMonitor.Top%)/2 THEN
          dypos%=(mi.rcMonitor.Bottom%-mi.rcMonitor.Top%)/2-(wypos%+ysize%/2)
        ELSE
          dypos%=-(wypos%-((mi.rcMonitor.Bottom%-mi.rcMonitor.Top%)-ysize%)/2)
        ENDIF
      ENDIF
 


you could try messing with
Code:
SYS "MonitorFromWindow",@hwnd%,_MONITOR_DEFAULTTONEAREST \
      \ TO hMonitor%
      SYS "GetMonitorInfo", hMonitor%, mi{} TO ret%
      IF ret%=0 ERROR 100,"GetMonitorInfo failed"
      
 


I hope that helps a little bit. I hope I get what you are trying to do.

Michael
User IP Logged

KenDown
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 181
xx Re: Calling Michael Hutton
« Reply #3 on: Sep 12th, 2015, 06:49am »

Thanks, Michael. I'll investigate that code. Your reply is appreciated.
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