c#为不同的应用程序创建Windows无边界应用程序 [英] c# Create a windows borderless application for different applications

查看:108
本文介绍了c#为不同的应用程序创建Windows无边界应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是代码项目的新手,但我在这里找不到任何内容.就是这样我想创建一个使窗口屏幕无边框和全屏的应用程序.我喜欢在窗口模式下播放,以方便进行制表键切换等操作.因此,我想了解我可以学到的方法.

我想知道的原因是因为我知道这是可能的:
这是在AHK中用于黑人行动的代码,但是我不想在AHK中进行,我想在自己的应用程序中使用自己的UI进行操作,并在此过程中进行一些学习. >

Hey guys, I''m new to code project but I couldn''t find anything on here. so here it is. I would like to create an application for making a windowed screen borderless and fullscreen. I like playing in windowed mode for easy alt tabbing etc. So I would like to find out what I can learn to achieve this.

The reason I would like to know is because I know it is possible:
this is the code to do it for black ops in AHK, But I don''t want to do it in AHK, I want to do it in my own application with my own UI and do some learning on the way.

width = 1680
height = 1010

ifexist %A_AppData%\BlackOps Windowed Borderless Mode\settings.ini
{
IniRead, width, %A_AppData%\BlackOps Windowed Borderless Mode\settings.ini,Settings,Width
IniRead, height, %A_AppData%\BlackOps Windowed Borderless Mode\settings.ini,Settings,Height
}

Start:
gui +alwaysontop
gui font, s10
gui add, text, section x15 y15, Width:
gui add, edit, ys-2 w50 vWIDTH, %width%
gui add, text, x+20 ys, Height:
gui add, edit, ys-2 w50 vHEIGHT, %height%
gui font, s12
gui add, button, xs y+15 h30 default, Set BlackOps to Borderless
gui font, s7
gui add, checkbox, y+15 vSave Checked, Save settings
gui font, s7 cGray
gui add, text,, writes to an ini file to:`n%A_AppData%\BlackOps Windowed Borderless Mode\
gui show, ,BlackOps Borderless Windowed Tool by piXelman, modified by Scarystuff
Return

ButtonSetBlackOpstoBorderless:
Gui Submit
Gui Destroy

if (width = "" or height = "") {
msgbox 48, BlackOps Borderless Windowed Mode, Width/Height must not be blank!
Goto Start
}

if (save = 1) {
ifnotexist %A_AppData%\BlackOps Windowed Borderless Mode
FileCreateDir %A_AppData%\BlackOps Windowed Borderless Mode

IniWrite, %width%, %A_AppData%\BlackOps Windowed Borderless Mode\settings.ini,Settings,Width
IniWrite, %height%, %A_AppData%\BlackOps Windowed Borderless Mode\settings.ini,Settings,Height
}


IfWinExist Call of Duty®: BlackOps ; find BlackOps if it is running
{
WinActivate Call of Duty®: BlackOps ;activate the window
WinMove,Call of Duty®: BlackOps,,0,0,1680,1010 ; resize it to 1600x1024 (modify to match resolution set in BlackOps config)
WinSet Style, -0x800000 ;fix border
WinSet Style, -0xC00000 ;noborder
ExitApp
} else {
MsgBox 5,BlackOps Borderless Windowed Mode, Call of Duty®: BlackOps is not running! Start it up and hit Retry
IfMsgBox Retry
Goto Start
ExitApp
} 



其中包括一个GUI和其他东西.

但是,是的,IDK如果该代码可以帮助解决任何问题,

要点:在窗口中时,没有人知道如何使应用程序(如黑色操作)进入全屏无边框模式.使用C#偏好.但是vb或c ++都可以(尽管我知道所有c ++都没有)

为任何帮助加油! :D



That includes a GUI and stuff.

But yeah, IDK if that code helps with anything but.

Main point:: Does anyone know how to make an application (like black ops) go to fullscreen borderless, when in windowed. using c# pref. but vb or c++ are fine (I know sh*t all c++ though)

Cheers for any help!! :D

推荐答案

在Codeproject上查看以下文章:

如何真正制作Windows Form应用程序C#中的全屏(和隐藏任务栏) [使用C#在全屏模式下显示WinForm [ ^ ]

写一个实际上有效的屏幕保护程序 [
Check these articles here on Codeproject:

How To Make a Windows Form App Truly Full Screen (and Hide Taskbar) in C#[^]

Show a WinForm in FullScreen mode using C#[^]

Write a Screensaver that Actually Works[^]


这篇关于c#为不同的应用程序创建Windows无边界应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆