Screen Resolution: PC to PC issue

New to FreeBASIC? Post your questions here.
Post Reply
bethell
Posts: 44
Joined: Sep 26, 2009 22:02

Screen Resolution: PC to PC issue

Post by bethell »

Hi all,
I have a GUI program that starts thus:

Code: Select all

mode = ScreenList(32) 
While (mode)
    hres = HiWord(mode)
    vres = LoWord(mode)
    mode = ScreenList
Wend
'-------------------------------------------
ScreenRes hres,vres, 32, ,&h04
This worked fine on my PC screen (19" monitor), giving a hres & vres value of 1280, and 1024 respectively, (and on my Laptop (1200x800)), which is what I have set in my desktop-> properties-> settings

But when I run the program on another PC (15" monitor), it reads a screen resolution of 1600 x 1280, whereas the PC has been set to 1024 x 768 resolution. So my program does not display properly (very tiny font etc)

So I changed my code to force hres & vres to be 1024 x 768, rather than use the code above to find the best available screen size.

1. How can I correctly read the screen setting as set by the user (800x600, or 1024 x 768, etc)

2. The mouse pointer is constantly flickering while inside my program window (on the other PC). This does not happen on my PC.

3. I have a few buttons (coded in FB) inside my window. The buttons in the upper half work properly when I click on them. But the buttons near the window bottom - I have to click slightly below them for them to work (getmouse() not reporting correctly ?). Again this problem is not there on my PC, but on the other PC.

I noted that the other PC was of a poorer configuration than mine (512kb RAM, 15" monitor etc) than mine (2GB RAM, 19" monitor) .

How may I solve these issues ?

--Thanks !!
Last edited by bethell on Dec 15, 2009 4:57, edited 1 time in total.
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Post by MichaelW »

For 1, I think the solution is probably:

http://www.freebasic.net/wiki/wikka.php ... Screeninfo

For 2, I solve the problem by using an inverting mouse cursor, e.g. Windows Inverted (large) (system scheme).
bethell
Posts: 44
Joined: Sep 26, 2009 22:02

Post by bethell »

Thanks Michael,

for 2, when you wrote "I solve", I assume you also faced this problem.

Do you mean changing the cursor from outside the program (desktop properties) ?

Can I change the cursor from within my program (and restore it back on exit) ?

I'm not using any Windows specific components. My program is simply coded in pure FB.

Also, any pointers for point 3 ?

Thanks !
bethell
Posts: 44
Joined: Sep 26, 2009 22:02

Post by bethell »

Hi,

After browsing the forums, I understand that point 3 is due to a bug in FB.
This happens when the screen res. is set to more than the desktop size.
Then the mouse position at the bottom is not reported properly.

See this topic - it leads to other links on this issue

http://www.freebasic.net/forum/viewtopic.php?t=14815

I'm still curious about the mouse flickering inside my window...it's irritating, nothing more - but what could be the possible cause of this ?

Regards.[/url]
Post Reply