Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Form height adjusting to user resolution

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Jane
Expert Cheater
Reputation: 0

Joined: 21 Feb 2016
Posts: 110

PostPosted: Sun Apr 23, 2017 11:15 pm    Post subject: Form height adjusting to user resolution Reply with quote

I am using a borderless form and am worried about making the height too tall for users with smaller screens who won't be able to see everything, assuming there's no way to resize the window like with a regular form, is there a way to have the height adjust automatically so that the bottom is not going past the taskbar?
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 26

Joined: 01 Oct 2008
Posts: 659

PostPosted: Mon Apr 24, 2017 10:55 am    Post subject: This post has 1 review(s) Reply with quote

The width and height can be obtained from windows API GetSystemMetrics function with proper input parameter (nIndex).

The API function need 1 integer input parameter, which may be call by CE Lua function executeCodeLocal directly, eg
Code:

local function sysMetric(n)
  return executeCodeLocal("GetSystemMetrics",n)
end
for i,v in ipairs {0,1,16,17} do
  print(v,sysMetric(v))
end
-- print
0 1366  -- SM_CXSCREEN
1 768   -- SM_CYSCREEN
16 1366 -- SM_CXFULLSCREEN. excluding taskbar
17 715  -- SM_CYFULLSCREEN

It is not enough since the taskbar may be at top or left side, but should be ok for most user?

Your form should has an area that allow drag/move the form (the titlebar if not borderless), then make a timer function to check if the drag-area completely outside the desktop area, and adjust form position/size if need.

ADDED:
^I've misunderstood the problem ~_~
Anyway, may be a way to manually adjust height in borderless form (instead of automatic adjust by timer function) is more user friendly? I may temporary move a form almost outside the desktop and don't want to adjust the size again when moving it back.

_________________
- Retarded.
dropbox
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites