|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 241 楼』:
使用 LLM 解释/回答一下
如果godai 兄对“文件打开框”感兴趣的话,可以将您的邮箱告诉我,我会将对应模块源代码发给您,您修改后可以代替“sail.lib”编程库文件里面的“filedlg.obj”模块
If Brother godai is interested in the "file open box", you can tell me your email, and I will send you the corresponding module source code. After you modify it, you can replace the "filedlg.obj" module in the "sail.lib" programming library file.
|
|
2008-3-6 20:48 |
|
|
godai
初级用户
 
积分 28
发帖 13
注册 2008-2-18
状态 离线
|
『第 242 楼』:
使用 LLM 解释/回答一下
那非常感谢! 我的邮箱是 bingxizhao@tom.com
希望能进一步与您探讨sail软件的完备与应用!
关于windows与dos的问题兼容版本的问题, 我也还没想到更好的办法。 明天再到单位机器上试验一下看看。
另: 您写的这么好的dos下实用程序竟然没有诸如软驱类的设备吗? 真的不容易了! 呵呵。 如果需要的话我这里有,可以给您寄个过去做试验。
That's very thanks! My email is bingxizhao@tom.com
Hope to further discuss with you the completeness and application of the sail software!
Regarding the problem of compatibility versions between Windows and DOS, I haven't thought of a better way yet. I'll test it on the unit's machine tomorrow and see.
Another thing: The practical DOS utilities you wrote don't have devices like floppy drives? It's really not easy! Hehe. If needed, I have some here and can send one to you for testing.
|
|
2008-3-7 01:45 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
|
2008-3-7 13:35 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 244 楼』:
找到一个判断“程序是否是在纯DOS下运行”的可行办法
使用 LLM 解释/回答一下
找到一个判断“程序是否是在纯DOS下运行”的可行办法,基本思路如下:
80386寄存器MSW可在实模式或任何特权级中读取到,而控制寄存器CR0只能在实模式或特权级0下才能读到,而CR0的低16位就是MSW,根据这个原理,如果它门的值相等,则认为在纯DOS下运行,否则是在Window下的DOS虚拟机运行。
BOOL IsWindowVM()
{
DWORD dwCr0;
WORD wMsw;
//读机器状态字MSW
asm smsw ax;
asm mov wMsw, ax
//读控制寄存器cr0,在VM下可能引起异常
asm mov eax, cr0
asm mov dwCr0, eax
//判断是否相等,相等时表示纯DOS,否则VM
if (wMsw == (WORD)(dwCr0 & 0xFFFFlu))
{
return (FALSE);
}
return (TRUE);
}
虽然纯DOS加载了“Emm386.Exe”后,纯DOS将从“实模式”进入到“保护模式”,但此时纯DOS是在“特权级0”的保护模式下运行,代码不受影响!
由于上面的代码用到了32位指令,特修改16位代码为:
BOOL IsWindowVM()
{
DWORD dwCr0;
WORD wMsw;
//read MSW
__emit__(0x0F, 0x01, 0xE0);//asm mov smsw ax
asm mov wMsw, ax
//Read cr0
asm mov ax, wMsw
asm inc ax
__emit__(0x0F, 0x20, 0xC0); //asm mov eax, cr0
//eax to dwCr0
__emit__(0x66, 0x50); //asm push eax
asm pop ax
asm pop dx
asm mov word ptr dwCr0 + 0, ax
asm mov word ptr dwCr0 + 2, dx
//judge
return ((wMsw == (WORD)(dwCr0 & 0xFFFFlu)) ? FALSE : TRUE);
}
Last edited by firstsail on 2008-3-14 at 08:21 PM ]
Find a feasible way to judge whether "the program is running under pure DOS". The basic idea is as follows:
The MSW (Machine Status Word) of the 80386 register can be read in real mode or any privilege level, while the control register CR0 can only be read in real mode or privilege level 0. And the lower 16 bits of CR0 are the MSW. According to this principle, if their values are equal, it is considered to be running under pure DOS; otherwise, it is running under the DOS virtual machine in Windows.
BOOL IsWindowVM()
{
DWORD dwCr0;
WORD wMsw;
// Read machine status word MSW
asm smsw ax;
asm mov wMsw, ax
// Read control register cr0, which may cause an exception under VM
asm mov eax, cr0
asm mov dwCr0, eax
// Judge whether they are equal. When equal, it means pure DOS; otherwise, VM
if (wMsw == (WORD)(dwCr0 & 0xFFFFlu))
{
return (FALSE);
}
return (TRUE);
}
Although after pure DOS loads "Emm386.Exe", pure DOS will enter "protected mode" from "real mode", but at this time pure DOS is running in "protected mode" of privilege level 0, and the code is not affected!
Since the above code uses 32-bit instructions, modify the 16-bit code as:
BOOL IsWindowVM()
{
DWORD dwCr0;
WORD wMsw;
// read MSW
__emit__(0x0F, 0x01, 0xE0);//asm mov smsw ax
asm mov wMsw, ax
// Read cr0
asm mov ax, wMsw
asm inc ax
__emit__(0x0F, 0x20, 0xC0); //asm mov eax, cr0
// eax to dwCr0
__emit__(0x66, 0x50); //asm push eax
asm pop ax
asm pop dx
asm mov word ptr dwCr0 + 0, ax
asm mov word ptr dwCr0 + 2, dx
// judge
return ((wMsw == (WORD)(dwCr0 & 0xFFFFlu)) ? FALSE : TRUE);
}
Last edited by firstsail on 2008-3-14 at 08:21 PM ]
|
|
2008-3-7 19:47 |
|
|
fgckfl
初级用户
 
积分 46
发帖 22
注册 2006-11-13
状态 离线
|
『第 245 楼』:
winsail 能支持usb读取吗?
使用 LLM 解释/回答一下
winsail 能支持usb读取吗?
Does winsail support USB reading?
|
|
2008-3-7 21:07 |
|
|
godai
初级用户
 
积分 28
发帖 13
注册 2008-2-18
状态 离线
|
『第 246 楼』:
使用 LLM 解释/回答一下
文件已收到。 非常感谢郭兄!
The file has been received. Thanks a lot, Brother Guo!
|
|
2008-3-8 00:55 |
|
|
fgckfl
初级用户
 
积分 46
发帖 22
注册 2006-11-13
状态 离线
|
|
2008-3-14 12:38 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 248 楼』:
文件打开框完善了对软驱的访问
使用 LLM 解释/回答一下
文件打开框完善了对软驱的访问,在这里特别感谢“godai”兄寄来的软驱和软盘!
The file open dialog has improved access to floppy drives. Here, I would like to especially thank brother "godai" for sending the floppy drive and floppy disks!
|
|
2008-3-14 20:17 |
|
|
fgckfl
初级用户
 
积分 46
发帖 22
注册 2006-11-13
状态 离线
|
『第 249 楼』:
表格控件的问题
使用 LLM 解释/回答一下
请问郭兄,如何处理能设置表格每单元格的背景色或字体颜色。
另加载doslen后,在bc下可以打开,保存长文件名文件,但是您的文件框不支持
长文件名显示,可以解决吗?
希望对完善和加强winsail有点意义。
May I ask Brother Guo, how to handle setting the background color or font color of each cell in a table.
Also, after loading doslen, it can be opened under bc and long filename files can be saved, but your file box does not support long filename display. Can it be solved?
Hope it is meaningful for improving and strengthening winsail.
|
|
2008-3-21 10:25 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 250 楼』:
设置表格每单元格的背景色或字体颜色
使用 LLM 解释/回答一下
控件的基类CObject里面有两个函数,一个是设置控件的背景色,一个是设置控件的前景色,
设置控件的背景色:CObject::SetBackColor(int nColor);
设置控件的前景色:CObject::SetForeColor(int nColor);
假设您的表格控件pGrid1,则这样
pGrid1->SetBackColor(YELLOW);//将表格背景设置为“黄色”
pGrid1->SetForeColor(RED);//将表格的文字前景色设置为“红色”
Last edited by firstsail on 2008-3-21 at 12:57 PM ]
There are two functions in the base class CObject of the control. One is to set the background color of the control, and the other is to set the foreground color of the control.
Set the background color of the control: CObject::SetBackColor(int nColor);
Set the foreground color of the control: CObject::SetForeColor(int nColor);
Suppose your table control is pGrid1, then like this
pGrid1->SetBackColor(YELLOW); // Set the table background to "yellow"
pGrid1->SetForeColor(RED); // Set the text foreground color of the table to "red"
Last edited by firstsail on 2008-3-21 at 12:57 PM ]
|
|
2008-3-21 12:54 |
|
|
fgckfl
初级用户
 
积分 46
发帖 22
注册 2006-11-13
状态 离线
|
『第 251 楼』:
设置表格每单元格的背景色或字体颜色
使用 LLM 解释/回答一下
恐怕这样不行吧,您封装的函数无法单独控制每个单元格的显示设置。
提一点建议,在表格控件中,增加设置每个单元格前景色和背景色的属性,在内部显示函数中,每显示表格内容中,单独调用前景色背景色。
这样做是有实际意义的,因为有的时候工程中需要直观显示3维4维数据。颜色可以作为一维数据,我曾经做过这样的表格,不过我不会控制xms内存,所以数据量大不了。
您觉得这样怎么样?
或则能给我点资料,我来帮您完善表格控件?
I'm afraid this might not work. The function you encapsulated can't control the display settings of each cell individually.
Here's a suggestion: in the table control, add properties to set the foreground color and background color of each cell. In the internal display function, when displaying the table content, call the foreground color and background color separately.
This is practically meaningful because sometimes in projects, it's necessary to visually display 3D and 4D data. Color can be used as a one-dimensional data. I once made such a table, but I don't know how to control XMS memory, so the data volume can't be large. What do you think of this? Or can you give me some materials and I'll help you improve the table control?
|
|
2008-3-21 13:14 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 252 楼』:
使用 LLM 解释/回答一下
每一个单元格单独设置文字颜色和背景颜色占用的内存较大,实用性不大,不过对于每一列的颜色可单独设置我觉得意义较大。
如果需要编写非标准控件,建议从基类继承开发属于自己的新控件,例如电流表、旋钮、指示灯、温度表......
Last edited by firstsail on 2008-3-21 at 02:23 PM ]
Setting the text color and background color for each cell individually takes up a large amount of memory and is not very practical. However, I think it is of great significance to be able to set the color for each column separately.
If you need to write non-standard controls, it is recommended to develop your own new controls by inheriting from the base class, such as ammeters, knobs, indicator lights, thermometers...
Last edited by firstsail on 2008-3-21 at 02:23 PM ]
|
|
2008-3-21 14:20 |
|
|
fgckfl
初级用户
 
积分 46
发帖 22
注册 2006-11-13
状态 离线
|
『第 253 楼』:
自己写控件的问题
使用 LLM 解释/回答一下
自己写控件内部消息如何处理呢?能给个控件代码的完整例子吗?
How to handle internal messages of a control by oneself? Can you give a complete example of control code?
|
|
2008-3-23 17:16 |
|
|
fgckfl
初级用户
 
积分 46
发帖 22
注册 2006-11-13
状态 离线
|
『第 254 楼』:
使用 LLM 解释/回答一下
封装了新表格和列表控件,如何画一闪一闪的光标呢?
Encapsulated new table and list controls, how to draw a blinking cursor?
|
|
2008-4-4 11:26 |
|
|
stronger
新手上路

积分 10
发帖 5
注册 2008-4-7
状态 离线
|
|
2008-4-7 14:42 |
|