FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Type of computer/monitor
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Type of computer/monitor
Posted: Sat Aug 03, 2024 06:24 AM

Hi,

Is it possible to determine the type of computer on which my application is running - PC or laptop?

If it is a PC, then you can determine the tim of the monitor - sensor or not?

Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: Type of computer/monitor
Posted: Sat Aug 03, 2024 09:17 AM
hi,
Natter wrote:Is it possible to determine the type of computer on which my application is running - PC or laptop?
If it is a PC, then you can determine the tim of the monitor - sensor or not?
you can use WMI and Win32_DesktopMonitor/MonitorType to find out if MonitorType = LCD it is a Laptop

to find Tim of Monitor try https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-changedisplaysettingsa
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Type of computer/monitor
Posted: Sat Aug 03, 2024 09:35 AM
Some of the useful functions in FWH:
Code (fw): Select all Collapse
FW_IsTouchScreen()
FW_IsMousePresent()
FW_IsTabletMode()
ScreenSize( [lInches] ) --> Screen Diameter in MM or Inches
We may try:
Code (fw): Select all Collapse
if FW_IsTouchScreen() .and. !FW_IsMousePresent() .and. ;
   FW_IsTabletMode() .and. ScreenSize( .t. ) <= 10
? "tablet"
endif
Regards



G. N. Rao.

Hyderabad, India
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Type of computer/monitor
Posted: Sat Aug 03, 2024 09:42 AM

Rao, Jimmy, thank you for your help!

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Type of computer/monitor
Posted: Sat Aug 03, 2024 10:23 AM
Also try
Code (fw): Select all Collapse
GetSystemMetrics(SM_TABLETPC)
Right now, I don't have tablet PC with me to test.
You can provide your feedback.

Soon, we will try to add more functions about pen
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion