中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-31 09:14
47,815 topics / 349,930 posts / today 0 new / 48,290 members
DOS开发编程 & 发展交流 (开发室) » The Terminator of DOS Interface Development
Printable Version  100,822 / 290
Floor241 firstsail Posted 2008-03-06 20:48
高级用户 Posts 295 Credits 668 From 广东深圳
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.
Floor242 godai Posted 2008-03-07 01:45
初级用户 Posts 13 Credits 28
That's very thanks! My email is [email protected]
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.
Floor243 firstsail Posted 2008-03-07 13:35
高级用户 Posts 295 Credits 668 From 广东深圳
The email has been sent to [email protected]
Floor244 firstsail Posted 2008-03-07 19:47
高级用户 Posts 295 Credits 668 From 广东深圳
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 ]
Floor245 fgckfl Posted 2008-03-07 21:07
初级用户 Posts 22 Credits 46
Does winsail support USB reading?
Floor246 godai Posted 2008-03-08 00:55
初级用户 Posts 13 Credits 28
The file has been received. Thanks a lot, Brother Guo!
Floor247 fgckfl Posted 2008-03-14 12:38
初级用户 Posts 22 Credits 46
Give it a thumbs up
Floor248 firstsail Posted 2008-03-14 20:17
高级用户 Posts 295 Credits 668 From 广东深圳
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!
Floor249 fgckfl Posted 2008-03-21 10:25
初级用户 Posts 22 Credits 46
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.
Floor250 firstsail Posted 2008-03-21 12:54
高级用户 Posts 295 Credits 668 From 广东深圳
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 ]
Floor251 fgckfl Posted 2008-03-21 13:14
初级用户 Posts 22 Credits 46
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?
Floor252 firstsail Posted 2008-03-21 14:20
高级用户 Posts 295 Credits 668 From 广东深圳
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 ]
Floor253 fgckfl Posted 2008-03-23 17:16
初级用户 Posts 22 Credits 46
How to handle internal messages of a control by oneself? Can you give a complete example of control code?
Floor254 fgckfl Posted 2008-04-04 11:26
初级用户 Posts 22 Credits 46
Encapsulated new table and list controls, how to draw a blinking cursor?
Floor255 stronger Posted 2008-04-07 14:42
新手上路 Posts 5 Credits 10
Where to download it from?
Prev  1 … 14 15 16 17 18 19 20  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023