Questions tagged [getsystemmetrics]

17 questions
7
votes
2 answers

GetSystemMetrics() returns different results for .NET 4.5 & .NET 4.0

During a .NET 4.0 -> .NET 4.5 application migration process I've discovered an extremely strange behavior. I've been able to track this issue down to this short code snippet: class Program { …
max
  • 33,369
  • 7
  • 73
  • 84
4
votes
2 answers

Get drop shadow dimensions of window

I need to know the drop shadow dimensions of a window. I tried receiving values via the GetSystemMetrics WinAPI function, but I could not find the parameter to pass over. Any idea on how I can get this value globally (or for a single window handle)?…
nikeee
  • 10,248
  • 7
  • 40
  • 66
3
votes
1 answer

GetSystemMetrics and TScreen returns wrong value

I am using Delphi XE5. I think i have a problem with my laptop. After a while, it returns wrong value to Screen.Width and GetSystemMetrics(SM_CXSCREEN) (same for Height). My OS is Windows 7 64-bit. My laptop's screen res is 1920x1080 (1080p) however…
blacksun
  • 733
  • 7
  • 24
2
votes
1 answer

find size of external monitor in excel vba

To find the size of the monitor, I've been using: Declare Function GetSystemMetrics32 Lib "user32" Alias "GetSystemMetrics" (ByVal Index As Long) As Long and then: Function getMonitorSize() monitorHeight = GetSystemMetrics32(1) monitorWidth =…
Roy
  • 653
  • 2
  • 11
  • 20
2
votes
3 answers

How to resolve linking error for GetSystemMetrics()?

I'm attempting to use the following to get the height & width of the main display: #include size_t width = (size_t)GetSystemMetrics(SM_CXBORDER); size_t height = (size_t)GetSystemMetrics(SM_CYBORDER); However, it's failing on an…
Sam
  • 810
  • 2
  • 11
  • 20
1
vote
0 answers

Is there a system metric for listview text padding?

In Explorer, when viewing items in details view, there's a little bit of left padding before the text in any given column. I was wondering if there's a way to obtain that padding value. I was checking out GetSystemMetrics, but I'm not sure if any…
user12381459
1
vote
1 answer

How to get the real height of title bar with c++

Actually I find there is a same demand post here. But I find some problem still, so I have to post another question here. If I use snipaste to capture the toolbar. I can know the real title bar is 28 like this But if I use the method in that post…
Make
  • 49
  • 2
  • 9
1
vote
1 answer

How to notify Windows about changes in Desktop settings?

How to notify Windows system that some appearance settings has been changed by my program? I'm working with: HKEY_CURRENT_USER\Control Panel\Desktop -> FontSmoothing + FontSmoothingType What is a standard way? Maybe there is some message. Where…
KARPOLAN
  • 2,507
  • 1
  • 19
  • 10
1
vote
1 answer

GetSystemMetrics vs. SystemParametersInfo

I needed to find out the height of the screen in order to resize a dialog. I am calling GetSystemMetrics with SM_CYFULLSCREEN and I am getting a certain number (1028 in my case). Per MSDN: To get the coordinates of the portion of the screen not…
CiciS
  • 11
  • 3
1
vote
1 answer

How do I prevent GetSystemMetrics() in Python using a Windows PC from returning different/wrong values?

I'm using this bit of code to get a print out of the monitor resolution from a Surface Pro 1st Gen Win 8.1 PC using Python 2.7: import ctypes from ctypes import windll user32 = ctypes.windll.user32 screensize =…
Benji A.
  • 142
  • 1
  • 14
1
vote
1 answer

Getting Desktop Resolution in MFC C++

I have inherited some partially developed 10 year old code that was written in MFC C++. I've been tasked with updating and finishing the app. In the CDialogChild class, it looks like this in the .h file: private: static const int…
Moe45673
  • 854
  • 10
  • 20
0
votes
1 answer

calculating minimum size needed to contain dialog

I want to compute the minimum size both vertical and horizontal that will contain a dialog. I used GetClientRect to determine the width and height. Then for the width when a vertical scroll bar is needed I added GetSystemMetrics (SM_CXVSCROLL) +…
Mike D
  • 2,753
  • 8
  • 44
  • 77
0
votes
0 answers

Tkinter The buttons gets misplaced in a pc with a higher resolution

I made a tkinter application in my pc which has 1366 x 768 resolution then converted to exe and sent to another pc with 1920 x 1080 resolution. There, buttons were misplaced, got inside the labelframe - image in the center while i made an effort to…
user13112566
0
votes
0 answers

Obtaining the height of Explorer's items view header

I was wondering if there's a system metric for the height of Explorer's items view header, or if there's a simple way of obtaining that value. My current approach is to obtain the header's IUIAutomationElement. Then I get the element's bounding…
user13366655
0
votes
1 answer

SystemParametersInfoA with SPI_GETMOUSE returns 0's

Go to the answer of the question I'm trying to get my mouse speed, but when I call the function SystemParametersInfoA with parameter SPI_GETMOUSE it sets the target array to {0,0,0} which I think its not supposed to happen. Example code: int…
xXTurner
  • 61
  • 9
1
2