The Doszip Commander version 2.50 available (Announce)
>
> To find out the current screen dimensions, you have to call
> GetConsoleScreenBufferInfo(). Actually, this should be done in both
> full-screen text mode and windowed GUI mode.
Yes, that is what I'm currently using to get the metrics of the screen:
consinit proc
local ci:CONSOLE_SCREEN_BUFFER_INFO
invoke GetConsoleScreenBufferInfo,hStdOutput,addr ci
test eax,eax
jz toend
mov eax,ci.dwSize
movzx ecx,ax
mov _scrcol,ecx
shr eax,16
dec eax
mov _scrrow,eax
invoke cursorget,addr console_cu
invoke free,console_dl.dl_wp
mov eax,_scrrow ; save init screen
mov ah,byte ptr _scrcol
inc al
invoke rcpush,eax
mov console_dl.dl_wp,eax
mov console_dl.dl_flag,_D_DOPEN
mov eax,_scrrow
inc eax
mov console_dl.dl_rect.rc_row,al
mov eax,_scrcol
mov console_dl.dl_rect.rc_col,al
toend:
ret
consinit endp
However, setting the screen metrics is a different matter (I think), and it seems to involve some graphical functions of getting/setting the client window using pixels as measure. I assume you then have to calculate the size of the desktop by measure the font size currently used.
The current approach for doing this is rather simplistic:
.data
mode db 'MODE CON LINES=%d',0
.code
conssetl proc l:dword ; line: 0..max
local cmd[64]:byte
local ci:CONSOLE_SCREEN_BUFFER_INFO
mov edx,l
.if edx != _scrrow
inc edx
invoke sprintf,addr cmd,addr mode,edx
invoke command,addr cmd
.if GetConsoleScreenBufferInfo(hStdOutput,addr ci)
mov eax,ci.dwSize
shr eax,16
dec eax
mov _scrrow,eax
.endif
.endif
ret
conssetl endp
This only assume vertical changes where the width is static (80), so I need to add the a line with COLS=%d to get back to the "good old" 80x25 mode.
I extended the buffering for the functions that handle text in/out-put from 80 to 256. But this is the limit on "graphics" used since the definition of a RECT is BYTE sized. By doing so the program is able to adapt to larger screen metrics, but the panels and text viewer is still (v3.03) using 80. However, the editor is able to adapt to a larger line width.
Now I have changed the width of the panels and text viewer as well, so the program is now capable of adapting but still not able to set and move the client window. The current solution to this is to do this manually by having a short-cut (.LNK) to DZ on the desktop. You may then set the metric there to fill the whole desktop, and remove the "Startup: [x] Restore Screen Mode" in the system option dialog. DZ will then adapt to this metrics, and also adapt to the metrics if executed from FM, but flipping from a window to text mode (Alt-Enter) will be a problem.
A single (large) panel:
Complete thread:
- The Doszip Commander version 2.50 available - nidud, 28.09.2013, 13:40 (Announce)
- The Doszip Commander version 2.50 available - Japheth, 28.09.2013, 20:56
- The Doszip Commander version 2.50 available - nidud, 28.09.2013, 21:36
- The Doszip Commander version 2.50 available - nidud, 28.09.2013, 22:09
- The Doszip Commander version 2.50 available - Japheth, 29.09.2013, 11:36
- The Doszip Commander version 2.50 available - nidud, 29.09.2013, 13:08
- The Doszip Commander version 2.50 available - Japheth, 29.09.2013, 19:51
- The Doszip Commander version 2.50 available - nidud, 29.09.2013, 21:07
- The Doszip Commander version 2.50 available - Japheth, 30.09.2013, 15:48
- The Doszip Commander version 2.50 available - nidud, 01.10.2013, 11:21
- The Doszip Commander version 2.50 available - Japheth, 02.10.2013, 08:26
- The Doszip Commander version 2.50 available - nidud, 02.10.2013, 09:44
- The Doszip Commander version 2.50 available - nidud, 02.10.2013, 10:33
- The Doszip Commander version 3.04 available - nidud, 02.10.2013, 20:44
- The Doszip Commander version 3.04 available - Japheth, 03.10.2013, 03:58
- The Doszip Commander version 3.04 available - nidud, 03.10.2013, 11:26
- The Doszip Commander version 3.05 available - nidud, 03.10.2013, 18:18
- The Doszip Commander version 3.05 available - Japheth, 04.10.2013, 06:46
- The Doszip Commander version 3.05 available - nidud, 04.10.2013, 09:15
- The Doszip Commander version 3.06 available - nidud, 04.10.2013, 22:26
- The Doszip Commander version 3.08 available - nidud, 09.10.2013, 12:39
- The Doszip Commander version 3.08 available - Rugxulo, 10.10.2013, 00:26
- The Doszip Commander version 3.08 available - nidud, 11.10.2013, 00:40
- The Doszip Commander version 3.08 available - Rugxulo, 10.10.2013, 00:26
- The Doszip Commander version 3.05 available - Japheth, 04.10.2013, 06:46
- The Doszip Commander version 3.04 available - Japheth, 03.10.2013, 03:58
- The Doszip Commander version 2.50 available - Japheth, 02.10.2013, 08:26
- The Doszip Commander version 2.50 available - nidud, 01.10.2013, 11:21
- The Doszip Commander version 2.50 available - Japheth, 30.09.2013, 15:48
- The Doszip Commander version 2.50 available - nidud, 29.09.2013, 21:07
- The Doszip Commander version 2.50 available - Japheth, 29.09.2013, 19:51
- The Doszip Commander version 2.50 available - nidud, 29.09.2013, 13:31
- The Doszip Commander version 2.50 available - nidud, 29.09.2013, 13:08
- The Doszip Commander version 2.50 available - nidud, 28.09.2013, 21:36
- The Doszip Commander version 2.50 available - Japheth, 28.09.2013, 20:56