Alternate Console
Alternate Console
PureBasic Interface to OpenCV
PureBasic Interface to WinDivert
PureBasic Interface to WinRAR
PureBasic Interface to 7-Zip
PureBasic Interface to ImDisk
Windows Services & Other Stuff
Invading Space Aliens
Death Star vs Asteroids
GIF Toolkit
LSB Image Steganography
Spider Web Drawing
Deform Image: MLS
Video Snipping Tool
Chromium WebGadget
IAccessible Interface
Stitch Images: SIFT
OldSkool Fire Effect
Image Waves: LUT
YouTube Player & Downloader
MP4 Player & Downloader
Large Image Viewer
Barcode Generator
Google Translate Service
Embed JS into PureBasic
Geolocation: Google Maps
Book & Viewer & Magnify
Video for Windows: VfW
Alternate Console
Network Share Management
PureBasic Interface to WinDivert
PureBasic Interface to WinRAR
PureBasic Interface to 7-Zip
PureBasic Interface to ImDisk
Windows Services & Other Stuff
Invading Space Aliens
Death Star vs Asteroids
GIF Toolkit
LSB Image Steganography
Spider Web Drawing
Deform Image: MLS
Video Snipping Tool
Chromium WebGadget
IAccessible Interface
Stitch Images: SIFT
OldSkool Fire Effect
Image Waves: LUT
YouTube Player & Downloader
MP4 Player & Downloader
Large Image Viewer
Barcode Generator
Google Translate Service
Embed JS into PureBasic
Geolocation: Google Maps
Book & Viewer & Magnify
Video for Windows: VfW
Alternate Console
Network Share Management
Last edited by JHPJHP on Thu Jun 22, 2023 5:41 pm, edited 93 times in total.
Re: Alternate Console
Many thanks for the recent "parcel out" of your codes, this really brings some fresh air to the forum!
Re: Alternate Console
Hi ostapas,
You're most welcome. It was cathartic to "clean out my script closet", and hopefully provide something useful in the process.
Cheers!
You're most welcome. It was cathartic to "clean out my script closet", and hopefully provide something useful in the process.
Cheers!
- Kwai chang caine
- Always Here
- Posts: 5357
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Alternate Console
Splendid !!! Works very well...
Impressive the man work and panther
Thanks for sharing
Impressive the man work and panther
Thanks for sharing
Last edited by Kwai chang caine on Wed Mar 16, 2022 5:38 pm, edited 1 time in total.
The happiness is a road...
Not a destination
Not a destination
Re: Alternate Console
Hi Kwai chang caine,
Thank you for your comments.
--------------------------------------------------
Updated to support Windows 10, including various bug fixes.
If the animations show in full-screen:
- delete the Registry key: HKEY_CURRENT_USER\Console
-- the Console key will be recreated when changes are made to a console's properties
- set cmd.exe (Command Console) to legacy mode from properties
-- don't set this option from the console created by the program
-- this option may not be available in earlier versions of Windows
Thank you for your comments.
--------------------------------------------------
Updated to support Windows 10, including various bug fixes.
If the animations show in full-screen:
- delete the Registry key: HKEY_CURRENT_USER\Console
-- the Console key will be recreated when changes are made to a console's properties
- set cmd.exe (Command Console) to legacy mode from properties
-- don't set this option from the console created by the program
-- this option may not be available in earlier versions of Windows
Last edited by JHPJHP on Tue May 08, 2018 9:15 pm, edited 3 times in total.
Re: Alternate Console
Updated:
- added 1 example
-- alt_animation_gif.pb
- added 5 images
-- countdown.gif, fishing.gif, flipping.gif, running.gif, troll.gif
Previously only Sprite sheets were used to generate Console animations, but thanks to the PureBasic team adding GIF support, animated GIF's can also be used.
If your interest is only Console animations, download the Standalone version of Console Animation from the first post, I'm not sure the Alternate Console download has a use outside of curiosity; this was one of the first things I wrote while learning PureBasic, and maybe can assist someone travelling a similar road.
- added 1 example
-- alt_animation_gif.pb
- added 5 images
-- countdown.gif, fishing.gif, flipping.gif, running.gif, troll.gif
Previously only Sprite sheets were used to generate Console animations, but thanks to the PureBasic team adding GIF support, animated GIF's can also be used.
If your interest is only Console animations, download the Standalone version of Console Animation from the first post, I'm not sure the Alternate Console download has a use outside of curiosity; this was one of the first things I wrote while learning PureBasic, and maybe can assist someone travelling a similar road.
- Kwai chang caine
- Always Here
- Posts: 5357
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Alternate Console
Hello JHPJHP
I use your splendid alternate console since several month ago , and i don't know why, only sometime not always, i have an IMA at this linein the procedure
Then i stop the code, and run another time and all is good after
I have noticed the variable "BufferSize" is empty, have you an idea what is the reason why ?
I use your splendid alternate console since several month ago , and i don't know why, only sometime not always, i have an IMA at this line
Code: Select all
Dim lpBuffer.CHAR_INFO(BufferSize, nRight - 1)
Code: Select all
ReadCmdConsole(nLeft.i = 0, nTop.i = 0, nRight.i = 0, nBottom.i = 0)
I have noticed the variable "BufferSize" is empty, have you an idea what is the reason why ?
The happiness is a road...
Not a destination
Not a destination
Re: Alternate Console
Hi Kwai chang caine,
I can see a couple problems...
1. The version you are using is out of date: Download links in the first post have been updated.
2. The Function GetConsoleScreenBufferInfo can fail, but I wasn't trapping for it; this has been updated.
-- you may want to include a notification if the call fails
I can see a couple problems...
1. The version you are using is out of date: Download links in the first post have been updated.
2. The Function GetConsoleScreenBufferInfo can fail, but I wasn't trapping for it; this has been updated.
-- you may want to include a notification if the call fails
Last edited by JHPJHP on Tue Jun 20, 2017 12:01 am, edited 3 times in total.
- Kwai chang caine
- Always Here
- Posts: 5357
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Alternate Console
Thanks a lot for your answer, i try your tips
Have a good night
Have a good night
The happiness is a road...
Not a destination
Not a destination
Re: Alternate Console
Some good stuff in there.
I spotted a couple of (minor) errors.
Added a small macro to be the companion to altOpenConsole()
Any idea how to tell which window/console has input/focus?
great work!
-j
I spotted a couple of (minor) errors.
- in cmdRunBatch(), (OpenFileRequester()) "StandardFile$" is not defined as local or global variable... shouldn't it be "FileName"?
- * In cmdReadConsole(), there is a variable that is added to others. "Increment" but this is not defined, so it has no effect.
- I also found that altPrint() doesn't work if the app is compiled as a console app.
Code: Select all
Procedure altOpenConsole(State = 1, Title.s = "Alternative Console", xColumn = 80, yRow = 300)
Protected GetConsoleWindow.protoGetConsoleWindow
Result = #False
CompilerIf #PB_Compiler_ExecutableFormat = #PB_Compiler_Console
If #True ; hackish, I know.
CompilerElse
If AllocConsole_()
CompilerEndIf
Added a small macro to be the companion to altOpenConsole()
Code: Select all
Macro AltCloseConsole() : FreeConsole_() : EndMacro
great work!
-j
Re: Alternate Console
Hi jassing,
Thank you for your generous contribution, and for your previous post outlining some potential problems with Alternate Console.
Alternate Console was probably my first attempt at creating something "useful" with PureBasic; looking over the code...
- in cmdRunBatch(), (OpenFileRequester()) "StandardFile$" is not defined as local or global variable
-- fixed, package updated
- in cmdReadConsole(), there is a variable that is added to others. "Increment" but this is not defined
-- Increment is used for scrolling/copying the console contents to the debug window/variable; updated the example cmd_show_console.pb to better demonstrate its use
- I also found that altPrint() doesn't work if the app is compiled as a console app
-- I compiled/tested some of the examples (Windows 10) without a problem, please be more specific; small change made to the Procedures altPrint, altPrintN
- Added a small macro to be the companion to altOpenConsole()
-- Shouldn't be needed, see the Procedure/Callback HandlerRoutine, it will free the console on a close event
- Any idea how to tell which window/console has input/focus?
-- Try using the API GetActiveWindow and GetFocus, matched against data derived from an enumeration of opened Window handles; let me know if you need any help
Thank you for your generous contribution, and for your previous post outlining some potential problems with Alternate Console.
Alternate Console was probably my first attempt at creating something "useful" with PureBasic; looking over the code...
- in cmdRunBatch(), (OpenFileRequester()) "StandardFile$" is not defined as local or global variable
-- fixed, package updated
- in cmdReadConsole(), there is a variable that is added to others. "Increment" but this is not defined
-- Increment is used for scrolling/copying the console contents to the debug window/variable; updated the example cmd_show_console.pb to better demonstrate its use
- I also found that altPrint() doesn't work if the app is compiled as a console app
-- I compiled/tested some of the examples (Windows 10) without a problem, please be more specific; small change made to the Procedures altPrint, altPrintN
- Added a small macro to be the companion to altOpenConsole()
-- Shouldn't be needed, see the Procedure/Callback HandlerRoutine, it will free the console on a close event
- Any idea how to tell which window/console has input/focus?
-- Try using the API GetActiveWindow and GetFocus, matched against data derived from an enumeration of opened Window handles; let me know if you need any help
Re: Alternate Console
... unless you want to close the console before program end ...JHPJHP wrote: - Added a small macro to be the companion to altOpenConsole()
-- Shouldn't be needed, see the Procedure/Callback HandlerRoutine, it will free the console on a close event
as for the compiled as a console issue (and maybe I'm missing something...)
Code: Select all
IncludeFile "Alt_Console.pbi"
CompilerIf #PB_Compiler_ExecutableFormat = #PB_Compiler_Console
If altOpenConsole(1,"Test print",100,500)
altPrintN("This is a test")
altInput()
Else
MessageRequester("Ooops","Console Open Failed")
EndIf
CompilerElse : CompilerError("Compile as a console")
CompilerEndIf
Re: Alternate Console
Hi jassing,
- fixed, package updated
Cheers.
You're correct, I overlooked your code snippet about the Compiler Format, and only focused on compiling an executable; allocating a console in Console Mode is redundant.jassing wrote:as for the compiled as a console issue (and maybe I'm missing something...)
- fixed, package updated
Can you provide an example where the CloseConsole Macro is needed; the existing Event Handler should be sufficient.jassing wrote:... unless you want to close the console before program end ...
Cheers.
Re: Alternate Console
Updated:
- added a clear console registry option
- applied a couple minor improvements
Clear Console: Registry
This option only applies to the animated examples executed in Windows 10+.
- added a clear console registry option
- applied a couple minor improvements
Clear Console: Registry
This option only applies to the animated examples executed in Windows 10+.
Re: Alternate Console
Hey,
I just wanted to test your code. Sadly you offer it only on your website for a payment.
I just wanted to test your code. Sadly you offer it only on your website for a payment.