Problem with screen resolution

Moderator: Rathinagiri

User avatar
mol
Posts: 3069
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 179 times
Been thanked: 96 times
Contact:

Problem with screen resolution

Post by mol » Sat Nov 15, 2014 11:33 am

Hi guys!
I want to ask you if sb. knows solution for changing font size of controls when the size of screen elements are increased to 125%.
This function is present at screen settings:
Image

When size of elements is set to 100%, everything looks OK:
Image

When size is increased to 125% it looks in this way:
Image

Is it the way to block font size changing by Windows?

User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Post by Agil Abdullah » Sat Nov 15, 2014 1:39 pm

Hi Marek,

How I see your problem was:

You exercised with enlarging screen size to 125%.

At the same time you didn't expect the font size to also enlarge to 125%. How to do this, right?

I am following. No experience in that matter.

Regards.
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender

User avatar
gfilatov
Posts: 578
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 16 times
Been thanked: 145 times
Contact:

Post by gfilatov » Sat Nov 15, 2014 1:45 pm

Hi Mol,

It is a known problem with the large fonts since Win98.

My humble suggestion is below.

1) you should detect the using of the large fonts with some function similar to

Code: Select all

#define LOGPIXELSX 88 

FUNCTION LargeFonts() 

local hDC, nPixelX 

hDC := CreateDC("DISPLAY", "", "") 
nPixelX := GetDeviceCaps(hDC, LOGPIXELSX) 

DeleteDC(hDc) 

return (nPixelX == 120) 
It is a function prototype only...

2) then to adjust your fonts size or button size as similar
nFontSize := IIF(LargeFonts(),9,12)
or
nButtonSize := IIF(LargeFonts(),30,26)

In hope that give you an idea :idea:
Last edited by gfilatov on Tue Nov 25, 2014 11:48 am, edited 1 time in total.
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
mol
Posts: 3069
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 179 times
Been thanked: 96 times
Contact:

Post by mol » Sat Nov 15, 2014 1:51 pm

Many thx Grigory. I'll test it tomorrow.

User avatar
gfilatov
Posts: 578
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 16 times
Been thanked: 145 times
Contact:

Post by gfilatov » Tue Nov 25, 2014 10:24 am

Hi Mol,

How are you?

I've prepared a working sample below for your convenience. :arrow:

Code: Select all

/*
 * MINIGUI - Harbour Win32 GUI library Demo
*/

#include "minigui.ch"


Function Main


	Define Window Test ;
		At 0,0 ;
		Width 400 ;
		Height 180 ;
		Title "Test" ;
		Main ;
		Nomaximize ;

		Define Button Button_1
			Row	10
			Col	40
			Caption	'Test'
			Height iif( LargeFonts(), 32, 28 )
			Action MsgInfo ( LargeFonts(), "Is Used The Large Fonts?" )
		End Button

		On Key ESCAPE Action ThisWindow.Release

	End Window

	Test.Center

	Activate Window Test

Return Nil


FUNCTION LargeFonts() 
LOCAL hDC, nPixelX 

hDC := CreateDC( "DISPLAY", "", "" )

nPixelX := GetDevCaps( hDC )

DeleteDC( hDc )

RETURN (nPixelX == 120)


#pragma BEGINDUMP

#include <windows.h>

#include "hbapi.h"

HB_FUNC( CREATEDC )
{
   hb_retnl( ( LONG ) CreateDC( hb_parc( 1 ), hb_parc( 2 ), hb_parc( 3 ), 0 ) );
}

HB_FUNC( DELETEDC )
{
   hb_retl( DeleteDC( ( HDC ) hb_parnl( 1 ) ) );
}

HB_FUNC ( GETDEVCAPS )
{
	INT      ix;
	HDC      hdc;

	hdc = ( HDC ) hb_parnl( 1 );
    
	ix  = GetDeviceCaps( hdc, LOGPIXELSX );	
   
	hb_retni( (UINT) ix );
}

#pragma ENDDUMP
In hope that useful 8-)
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
mol
Posts: 3069
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 179 times
Been thanked: 96 times
Contact:

Post by mol » Tue Nov 25, 2014 11:37 am

Many thanks Grigory!
I'll test it.
But now, I have big problem with my clients, who complain about the slow action of my program.
I'm testing it on my machine, and I think everything is OK, but, when I arrived to them,the speed was really fatal.
I'm using browse control and dbfcdx in first way.
The second way I'm reading whole database to memory array and searching the array.
I'll try to test it on my 10 years old celeron 1.6 laptop.
It will point to their machine/windows problem, when results will be OK.

User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Post by Czarny_Pijar » Thu Nov 27, 2014 6:53 am

I suspect the responsibility for slowing down the programs created with HMG are:
1) Antivirus software - here you can exclude some files used in your application from continuous scanning;
2) Insufficient RAM - compare this size both your and clients computers, the time for swapping RAM to/from HDD are the common problems. Continuous activity of hdd are good indicator here.
3) A plethora of background programs. They easily can consume the precious resources of computers.
4) HDD fragmentation - you can try a) dump all dbd/cdx to a pendrive b) make the defragmentation c)restore dbf/cdx d)perform the defragmentation again.
Hope this helps

User avatar
mol
Posts: 3069
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 179 times
Been thanked: 96 times
Contact:

Post by mol » Thu Nov 27, 2014 8:29 am

I've tested my app on old laptop (Intel Celeron M 1.4GHz, 512MB, Win XP Prof.) and it works very fine. Visual speed (browse, grid on screen) is almost the same as on the big machine (Intel Core I5 3.2GHz 8GB RAM, Win 8.1).
IMO, the problem lays in client machine.

User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines
Been thanked: 2 times

Post by dhaine_adp » Thu Nov 27, 2014 6:51 pm

Hi Marek,
I've tested my app on old laptop (Intel Celeron M 1.4GHz, 512MB, Win XP Prof.) and it works very fine. Visual speed (browse, grid on screen) is almost the same as on the big machine (Intel Core I5 3.2GHz 8GB RAM, Win 8.1).
IMO, the problem lays in client machine.
You didn't mention how many computers are affected by slowness and if the application is stand alone or network/shared application. However I believed that you are 99% correct that the problem is on your client's machine.

Slowness in computer are caused by:
(1) Antivirus installed (How many Antivirus program are installed?)
(2) Defective HDD, hard disk with bad sectors, listen to HDD sound when it reads or when your program is running and processing something. Also observed the HDD led lights if its working normally.
(3) Fragmented files cause slowness too.
(4) Check for recently installed program from Control Panel-> Program and Features, sort it by date and checked for recent program they've installed. If you find one uninstall it and check or asked your client when was the last date and time that your application works fine and do a System Restore through msconfig (press windows logo + R, then type msconfig, click OK, select system restore and launch).
(5) Check BIOS settings, load factory default and then save the changes.
(6) If you can't resolved the problem from the above procedure, you would need another HDD and reload windows on that HDD and test your application again. Its time consuming but sometimes the only way to prove your point to hard headed clients. (I prefer to do it in this way to those picky clients and of course they would have to pay an additional fee and when the same situation arise they think twice).
(7) If that's a network application, slowness can cause by a failing network card, lose cable, defective patch cable and or high bandwidth utilization due to network traffic but that is highly unlikely and difficult to trace most especially if they are using hub instead of a switch that can be managed. However you can disconnect all workstations and connect them one by one to locate the workstation with failing network card. Or ping localhost or ping 127.0.0.1 you should get ping replies. If you get General failure, the NIC is faulty and needs to be replaced.
(8) Use WireShark to do packet sniffing so that you can see what's going on in the network.
Regards,

Danny
Manila, Philippines

User avatar
mol
Posts: 3069
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 179 times
Been thanked: 96 times
Contact:

Post by mol » Thu Nov 27, 2014 7:51 pm

I had no time to visit my client and test it. So, I've started to search in my app. She has Inter Core i-5 based computers, so they are strong machines. When everything workd ok on old celeron machine, it's machine problem, I think.
The proble occured last days, when I developed new version based on hmg 3.3.1 with patches. It's because I've searched problem in app....


Thanks all of us for helipng me and pointing leak sides ...

Post Reply