Date: 02-16-2022
Return to Index
created by gbSnippets
'This shows how to adjust the # of lines in a console.
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "win32api.inc"
Declare Function WinMsg Lib "WINMSG.DLL" Alias "WindowMessageA" (ByVal MsgNum As Long) As String
Global hConsole, hDlg As Dword
Function PBMain () As Long
Dialog New Pixels, 0, "Test",500,550,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 200, "Print", 10,10,45,25
Control Add Button, hDlg, 300, "Clear", 60,10,45,25
cPrint "Startingpoint"
Local D As Dword
D = Mak(Dword, 80, 600)
SetConsoleScreenBufferSize hConsole,D
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Static iCount As Long
If Cb.Msg = %WM_SetCursor Then Incr iCount : Cprint Str$(iCount)
End Function
Sub CPrint (SOut As String)
Static cWritten, iCount As Long
Incr iCount
SOut = Format$(iCount,"000000") + " " + SOut
If hConsole = 0 Then AllocConsole: hConsole = GetStdHandle(-11&)
WriteConsole hConsole, ByCopy sOut + $CrLf, Len(sOut) + 2, cWritten, ByVal 0&
End Sub
'gbs_00829
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm