|
alionlian
新手上路

积分 8
发帖 2
注册 2006-4-7
状态 离线
|
『楼 主』:
dos软件关闭显示器
使用 LLM 解释/回答一下
windows有省电模式,长时间不用可以自动关闭显示器。那么dos行不行呢?最好能用tc实现。
我找到一个dpmsave.exe,一运行行它就会关闭显示器,按任意键打开显示器。不知如何实现。
Windows has power-saving mode, and the display can be automatically turned off when not in use for a long time. Then, can DOS do that? It's best to implement it with TC.
I found a dpmsave.exe. As soon as I run it, it turns off the display, and pressing any key turns it on. I don't know how to implement it.
|
|
2006-4-7 22:18 |
|
|
alionlian
新手上路

积分 8
发帖 2
注册 2006-4-7
状态 离线
|
|
2006-4-9 16:50 |
|
|
yk141
初级用户
 
积分 46
发帖 21
注册 2006-3-8 来自 中华人民共和国
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
大不大,你反江编看下不就知道了?
好象是调用INT 10H实现的,具体我忘了!
Is it big or not? Can't you just take a look at the anti-Jiang compilation? It seems to be implemented by calling INT 10H. Specifically, I forgot!
|
|
2006-4-10 23:35 |
|
|
JonePeng
金牌会员
      D◎$ Fαп
积分 4562
发帖 1883
注册 2004-1-19 来自 广东广州
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
6年前我就编过这样的程序,调用 INT 10H 的 4F10H 子中断。
#include <dos.h>
main()
{
union REGS in,out;
/* Close monitor*/
in.x.ax=0x4f10;
in.x.bl=0x01;
in.x.bh=0x02;
int86(0x10,&in,&out);
/* Press any key to continue*/
getch();
/* Turn on monitor */
in.x.ax=0x4f10;
in.x.bl=0x01;
in.x.bh=0x0;
int86(0x10,&in,&out);
return;
}
Last edited by JonePeng on 2006-4-11 at 22:39 ]
I wrote such a program 6 years ago, calling the 4F10H sub-interrupt of INT 10H.
#include <dos.h>
main()
{
union REGS in,out;
/* Close monitor*/
in.x.ax=0x4f10;
in.x.bl=0x01;
in.x.bh=0x02;
int86(0x10,&in,&out);
/* Press any key to continue*/
getch();
/* Turn on monitor */
in.x.ax=0x4f10;
in.x.bl=0x01;
in.x.bh=0x0;
int86(0x10,&in,&out);
return;
}
Last edited by JonePeng on 2006-4-11 at 22:39 ]
|

----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
|
|
2006-4-11 22:37 |
|
|
xuantian
高级用户
   
积分 587
发帖 282
注册 2006-4-10
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
多事
用手按还少敲两下键盘....
Meddlesome
Press with hand and also tap the keyboard twice...
|
|
2006-4-16 23:43 |
|
|
asbai
高级用户
   
积分 653
发帖 252
注册 2006-4-16
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Originally posted by xuantian at 2006-4-16 23:43:
多事
用手按还少敲两下键盘....
有点道理,反正要每次手动执行这个程序,不如直接按显示器电源钮,呵呵
Originally posted by xuantian at 2006-4-16 23:43:
Meddlesome
It's two keystrokes less to press with the hand....
Makes sense. Anyway, since I have to execute this program manually every time, it's better to just press the monitor power button, heh
|
|
2006-4-17 00:17 |
|
|
JonePeng
金牌会员
      D◎$ Fαп
积分 4562
发帖 1883
注册 2004-1-19 来自 广东广州
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Re xuantian &asbai:
你们的想法比较片面。
要是碰到显示器的按钮失灵或坏掉的情况怎么办?
我编的这个小程序就是为了解决我以前用的二手显示器按钮的问题。
另外,在Windows下还可以创建该程序的快捷方式,放在任务栏的快速启动栏上,这样点击一下这个图标就免得去按显示器开关了。
Re xuantian & asbai:
Your ideas are relatively one-sided.
What if the monitor's buttons fail or break?
The small program I made is to solve the problem of the second-hand monitor buttons I used before.
In addition, you can also create a shortcut of this program under Windows and place it in the quick launch bar of the taskbar, so that you can click this icon to avoid pressing the monitor switch.
|

----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
|
|
2006-4-21 00:07 |
|
|
qingfen
初级用户
 
积分 70
发帖 22
注册 2006-4-22
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
能否用端口读写的方式来编写呢????
Can we write it in a way of port reading and writing????
|
|
2006-4-23 14:47 |
|
|
waynebeat
初级用户
 
积分 84
发帖 28
注册 2006-5-3
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
能不能让显示器
开机时就直接开呀
我的显示器按扭坏了
关了就开不开了
Can the monitor be directly turned on when booting? My monitor button is broken. It can't be turned on after being turned off.
|
|
2006-5-17 14:51 |
|
|
JonePeng
金牌会员
      D◎$ Fαп
积分 4562
发帖 1883
注册 2004-1-19 来自 广东广州
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Originally posted by waynebeat at 2006-5-17 14:51:
能不能让显示器
开机时就直接开呀
我的显示器按扭坏了
关了就开不开了
呵呵,那就在关机后不要关显示器咯
Originally posted by waynebeat at 2006-5-17 14:51:
Can the monitor
be turned on directly when booting?
My monitor button is broken
and it can't be turned on after being turned off.
Hehe, then don't turn off the monitor after shutting down.
|

----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
|
|
2006-5-18 10:57 |
|
|
lqsoft
新手上路

积分 2
发帖 1
注册 2006-5-24
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
void crtoff()/*关闭显示器*/
{
int crtflag;/*显示器是否支持节能模式的标志*/
union REGS inregs,outregs;
inregs.x.ax=0x4f10;
inregs.x.bx=0;
int86(0x10,&inregs,&outregs);
if(outregs.h.al==0x4f)/*如果显示器支持节能模式则关闭显示器*/
{
inregs.x.ax=0x4f10;
inregs.x.bx=0x0201;
int86(0x10,&inregs,&outregs);
inregs.x.ax=0x4f10;
inregs.x.bx=0x0301;
int86(0x10,&inregs,&outregs);
crtflag=1;
}
else /*否则禁止显示器刷新*/
{
inregs.x.ax=0x1201;
inregs.h.bl=0x36;
int86(0x10,&inregs,&outregs);
crtflag=0;
}
while(bioskey(1)==0&&Minf==0) /*等待键盘或鼠标的信息来开启显示器*/
GetMouseState(&Minf);
if(crtflag)/*如果显示器支持节能模式则开启显示器*/
{
inregs.x.ax=0x4f10;
inregs.x.bx=0x1;
int86(0x10,&inregs,&outregs);
}
else/*否则允许显示器刷新*/
{
inregs.x.ax=0x1200;
inregs.h.bl=0x36;
int86(0x10,&inregs,&outregs);
}
}
```c
void crtoff()/*Turn off the display*/
{
int crtflag;/*Flag indicating whether the display supports power-saving mode*/
union REGS inregs,outregs;
inregs.x.ax=0x4f10;
inregs.x.bx=0;
int86(0x10,&inregs,&outregs);
if(outregs.h.al==0x4f)/*If the display supports power-saving mode, turn it off*/
{
inregs.x.ax=0x4f10;
inregs.x.bx=0x0201;
int86(0x10,&inregs,&outregs);
inregs.x.ax=0x4f10;
inregs.x.bx=0x0301;
int86(0x10,&inregs,&outregs);
crtflag=1;
}
else /*Otherwise, disable display refresh*/
{
inregs.x.ax=0x1201;
inregs.h.bl=0x36;
int86(0x10,&inregs,&outregs);
crtflag=0;
}
while(bioskey(1)==0&&Minf==0) /*Wait for keyboard or mouse information to turn on the display*/
GetMouseState(&Minf);
if(crtflag)/*If the display supports power-saving mode, turn it on*/
{
inregs.x.ax=0x4f10;
inregs.x.bx=0x1;
int86(0x10,&inregs,&outregs);
}
else/*Otherwise, allow display refresh*/
{
inregs.x.ax=0x1200;
inregs.h.bl=0x36;
int86(0x10,&inregs,&outregs);
}
}
```
|
|
2006-5-24 02:34 |
|
|
xiongwei2624
初级用户
 
积分 96
发帖 44
注册 2006-6-26 来自 深圳
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
汇编不怎么熟悉哦!
I'm not very familiar with assembly!
|
|
2006-6-30 14:47 |
|
|
scumyang
初级用户
 
积分 20
发帖 9
注册 2006-6-12
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
#define DPMS_ON 0
#define DPMS_WAIT 1
#define DPMS_SUSPEND 2
#define DPMS_OFF 4
//---------------------------------------------------------------------------
// Set DPMS status
//
// 设置显示器节能状态
//---------------------------------------------------------------------------
BYTE yana_SetDPMSStatus(BYTE Act)
{
union REGS r;
r.w.ax = 0x4F10;
r.h.bl = 1;
r.h.bh = Act;
int386(0x10, &r, &r);
return (r.h.al == 0x4F); // If AL != 4Fh, return FALSE
}
```c
#define DPMS_ON 0
#define DPMS_WAIT 1
#define DPMS_SUSPEND 2
#define DPMS_OFF 4
//---------------------------------------------------------------------------
// Set DPMS status
//
// Set the monitor energy-saving status
//---------------------------------------------------------------------------
BYTE yana_SetDPMSStatus(BYTE Act)
{
union REGS r;
r.w.ax = 0x4F10;
r.h.bl = 1;
r.h.bh = Act;
int386(0x10, &r, &r);
return (r.h.al == 0x4F); // If AL != 4Fh, return FALSE
}
```
|
|
2006-7-1 16:52 |
|
|
bd123456789
中级用户
  
积分 360
发帖 216
注册 2007-5-29
状态 离线
|
『第 14 楼』:
我怎么没办法测试呀!
使用 LLM 解释/回答一下
上述代码有什么办法测试一下?
抱歉实在是不太懂C语言编程,有了代码也不知道怎么测试!
Is there any way to test the above code?
Sorry, I really don't understand C language programming. Even if I have the code, I don't know how to test it!
|
|
2008-1-11 22:06 |
|