Code Monkey home page Code Monkey logo

Comments (6)

AGulev avatar AGulev commented on June 11, 2024

I can make almost the same things on macOS, but I think we have to get most important and frequency used things and implement them.

from defos.

AGulev avatar AGulev commented on June 11, 2024

something like function
defos.set_window_mode(param)
and constants
defos.SHOW_MAXIMIZED
defos.SHOW_FULLSCREEN
defos.SHOW_WINDOWED
or something like this.

I am not sure about the cases of using : : window get focus, making taskbar blink / light up,

from defos.

subsoap avatar subsoap commented on June 11, 2024

Note: Shortcut for macOS is option key + shift + green button to get same behavior as clicking Maximize button on Windows.

I agree about important features. It's still good to list out everything we want. We'll probably want to rename some features / merge them and then do a 1.0 release then people can use that version statically so the names don't change. Then for 2.0 release and so on we can continue to refine name and list of features to what is best.

from defos.

subsoap avatar subsoap commented on June 11, 2024

WIP version going to add it in properly later

local M = {}

local ffi = package.preload.ffi()


function M.maximize_window()
	if(ffi.os == "Windows") then

	  -- definitions
	  ffi.cdef([[
			typedef unsigned int LONG;
			typedef long long LONG_PTR;
			typedef void* PVOID;
			typedef PVOID HANDLE;
			typedef HANDLE HWND;
			typedef unsigned int UINT;
			typedef bool BOOL;

			HWND GetActiveWindow();
			BOOL ShowWindow(HWND hWnd, int nCmdShow);
			
		]])

		-- load User32.dll
		local user32 = ffi.load("User32")

		local SW_SHOWMAXIMIZED = 3
		
		
		local ptr = user32.GetActiveWindow()
		
		user32.ShowWindow(ptr, SW_SHOWMAXIMIZED)
		
	end	
end	

return M

from defos.

AGulev avatar AGulev commented on June 11, 2024

Fully agree with you about version 1.0 and 2.0 .
And thanks for the maximize option ( option key + shift + green button) I never known about it =)))

from defos.

AGulev avatar AGulev commented on June 11, 2024

As I undestand this issue is done?
new methods:
defos.toggle_maximize()
and
defos.is_maximize()
was added

from defos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.