deleted
you might try GetConsoleScreenBufferInfoEx to fill a CONSOLE_SCREEN_BUFFER_INFOEX structure
then modify it and use SetConsoleScreenBufferInfoEx
srWindow.Right and srWindow.Bottom returned by the Get function are inclusive
so, increment them before you use the Set function
not sure how well that will work - it may only affect the buffer size
if all else fails, you can use GetConsoleWindow to get the window handle,
then MoveWindow to set the size
this involves calculating the size of the titlebar, borders, and scrollbars before you know what you want
deleted
try this out...
it uses 2 functions that require XP or newer to get the font cell height
if you need win2000 support, there are other ways to get the character cell height
one way would be to use the (current client height pixels) / (current client height chars)
this one should work under win 2000....
deleted
well - the console is buggish, no matter what you do - lol
if you can, try to write your app as a gui app :t
as for sull-screen, you may not have any control over the layout in full-screen
either way, the display buffer has to be large enough to accomodate the screen layout
deleted
:P
deleted
have to ask Japheth about that one :shock:
deleted
i believe windows looks for the first suitable icon in the resource
not sure what the issue is with JwLink, but it would seem that windows isn't finding it
see if you can export the resources with ResHack
deleted
you can combine sections with ms link, as well
it takes a couple extra command-line switches
/OPT:NOREF /MERGE:.data=.text
at any rate, Andreas (Japheth) will probably want to address the issue and update JwLink, when he has time
that's assuming that it is an issue :P
deleted
doesn't do much good without the source :P
deleted
Quote from: nidud on September 22, 2013, 12:04:46 AM
the program: the flag is set in a window,
but if you do Ctrl-Enter to full screen nothing happens
the rest of the functions works...
maybe Alt-Enter ?
sorry - i guess i don't understand what you are trying to do
deleted
i never tried using the mouse wheel in a console, before
in a GUI app, you handle WM_MOUSEWHEEL and possibly WM_MOUSEHWHEEL messages
it would seem that the console event trap doesn't do that - no surprise, there
i guess you could subclass the window and handle the messages, passing all other messages to the original window proc
deleted
it is indeed a GUI app
and - the "standard" behaviour of the console mouse is very buggish
one might do well to subclass and disable the console mouse code, anyways - lol
if you want to see one of the bugs i'm talking about....
use the right-click context menu of the console to copy/paste text
the console window will lose track of the current X and Y position of the cursor
deleted
Quote from: nidud on October 04, 2013, 04:56:06 PMis there a simple way to test if the window is active or lurking in the background?
GetForegroundWindow
deleted
Quote from: nidud on October 04, 2013, 06:43:33 PMIn the case of not being active I need to call the GetForegroundWindow() function repeatedly, so how should this be handled?
Should I "sleep" for a while and then call it again?
WM_TIMER is a option. Another one is to check for WM_MOUSEMOVE messages, they are being sent even if the window is not active. But no such messages if you hover over an edit control.
The standard option, though, is monitoring WM_ACTIVATE.
even GetForegroundWindow doesn't always work the way you think it should
it's a problem i have fought with in the past
so far, i haven't found a perfect solution
deleted
i do it a little differently
i store the HWND of my window
and compare the GetForegroundWindow result against that
INVOKE GetForegroundWindow
.if eax==hwndMain
deleted
Just curious: How did you implement .if GetForegroundWindow() - a macro??
deleted
So it's your own JWasm build. Interesting ;)
rv(GetForegroundWindow)
will do the same
i don't use it much, but qWord seems to like it :P
Quote from: dedndave on October 05, 2013, 01:32:05 AM
i don't use it much, but qWord seems to like it :P
Me too, it condenses the code a little bit:
mov hMenu, rv(CreateMenu) ; create the main menu
mov hM1, rv(CreateMenu) ; plus three
mov hM2, rv(CreateMenu) ; sub menus
mov ghM3, rv(CreateMenu)
i find it a little easier to follow the code by not using it
especially if you are following along in a debugger
but - i have become more accustomed to it through reading qWord's code - lol
deleted
the ones that have the IBM graphics characters in the upper range use the OEM_CHARSET
for the console it's normally a "Terminal" font
here are some links....
http://masm32.com/board/index.php?topic=1108 (http://masm32.com/board/index.php?topic=1108)
this one was posted by Vortex...
http://blogs.microsoft.co.il/blogs/pavely/archive/2009/07/23/changing-console-fonts.aspx (http://blogs.microsoft.co.il/blogs/pavely/archive/2009/07/23/changing-console-fonts.aspx)
and, attached is a little program to enumerate fonts
you can modify it to filter out different requirements
for example, if you just want monospaced fonts, you can look for those that use FIXED_PITCH
unfortunately, it's a little difficult to filter out all the monospace fonts
because a true-type font may be monospaced, without using the FIXED_PITCH flag
here is an image of using terminal fonts in a GUI app
kind of "reverse" of what you want to do, i think - lol
(http://imageshack.us/a/img811/8154/kinput.png)
i use the following routine to create the fonts
oddly enough - it doesn't always get the font i want, unless i enumerate terminal fonts, first :redface:
MakeTerminalFont PROC wParam:WPARAM
;valid WxH: 4x6, 5x12, 6x8, 7x12, 8x8, 8x12, 10x18, 12x16, 16x8, 16x12
;--------------------------------
LOCAL _lf :LOGFONT
;_lf LOGFONT <height,width,,,,,,,OEM_CHARSET,,,,FF_MODERN or FIXED_PITCH,"Terminal">
; lfHeight DWORD height
; lfWidth DWORD width
; lfEscapement DWORD ?
; lfOrientation DWORD ?
; lfWeight DWORD ?
; lfItalic BYTE ?
; lfUnderline BYTE ?
; lfStrikeOut BYTE ?
; lfCharSet BYTE OEM_CHARSET
; lfOutPrecision BYTE ?
; lfClipPrecision BYTE ?
; lfQuality BYTE ?
; lfPitchAndFamily BYTE FF_MODERN or FIXED_PITCH
; lfFaceName BYTE LF_FACESIZE dup(?) ;"Terminal",0
;--------------------------------
INVOKE GetStockObject,OEM_FIXED_FONT
lea edx,_lf
INVOKE GetObject,eax,sizeof LOGFONT,edx
movzx edx,byte ptr wParam[2] ;EDX = wParam high word = height
movzx ecx,byte ptr wParam ;ECX = wParam low word = width
mov _lf.lfCharSet,OEM_CHARSET
mov _lf.lfPitchAndFamily,FF_MODERN or FIXED_PITCH
mov _lf.lfHeight,edx
mov _lf.lfWidth,ecx
INVOKE CreateFontIndirect,addr _lf
ret
MakeTerminalFont ENDP
deleted
as far as i know - a font used in the console must be monospaced
so - if you want to "carry" a font in resource or something, it may be do-able
that particular Lucida font is a monospaced font
Jochen has a lot more experience, here, as he has played with many foreign UNICODE fonts in the console
another possibility is to draw your own line graphics in the console client area
at that point, you may as well write a GUI app - lol
i forgot to mention....
you might have some luck with special "programming" fonts, which are typically monospaced
i use inconsolata-dz in NotePad and NotePad++, for example
another one is Proggy Square Slash Zero
there are numerous 3rd party programming fonts out there
some may do what you want
i haven't tried to find one that supported IBM graphics chars, though
deleted
nice info, nidud
maybe someday i will experiment with creating a TrueType console font :P
deleted
looks like fun - nice letters :t
in my viewer, i didn't see the IBM line-graphic chars
is that my viewer, or is that the font ?
by the way...
i wouldn't use a REG file to install a font
let the windows font manager do it for you (control panel)
EDIT: another question...
did you generate the font with an asm-written program ?
deleted
Hi nidud,
Quote from: nidud on October 17, 2013, 06:04:45 AM
http://fontforge.sf.net
Excellent link. Thank you. :t
Gunther
deleted
deleted
deleted
nidud, your SetConsoleSize procedure works very well for the Window Size, but how is it possible to also set the Screen Buffer Size of the Console? Do I have to shell to the MODE command, or can this be done programmatically?
nidud, I downloaded your two small windows console applications, and I see they do set both the Console Window Size, and the Console Buffer Size correctly... so it is possible after all. Oddly it did not change the Buffer Size of my Console when I used your SetConsoleSize proc.
Where can I find the following includes?
include conio.inc
include keyb.inc
include clip.inc
include stdio.inc
I see your Ascii.asm program calls SetConsoleSize, calls dlmodal, then calls SetConsoleSize a second time. I assume dlmodal must be in one of the missing includes.
It occurred to me the include files would be part of DOSZip itself.
Now I'm stuck here:
C:\console\src\Ascii>\asmc\asmc ascii.asm
Doszip Macro Assembler Version 2.19
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Assembling: ascii.asm
C:\console\src\Ascii>\masm32\bin\polink /SUBSYSTEM:CONSOLE /ALIGN:4096 /MERGE:.data=.text /MERGE:.rdata=.text ascii.obj
POLINK: fatal error: Invalid machine type in object 'ascii.obj'.
Mike,
Its probably the wrong OBJ format, 32 bit PE code normally uses a 32 bit PE version, there used to be a 32 bit OMF object module but the assembler you are using may be producing a 16 bit OMF module that a 32 bit linker will not allow.
deleted
Thanks Hutch and nidud,
After pulling some hair, I got it working.