Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - visionmercer

Pages: [1]
1
Maybe this will work for you:
Code: QB64: [Select]
  1. Print Chr$(27) + "[?25l"; 'Turn off cursor
  2. Print "No cursor?"
  3. Print Chr$(27) + "[?25h"; 'Turn on cursor
  4.  

Otherwise it can be done with the Windows API:
https://docs.microsoft.com/en-us/windows/console/setconsolecursorinfo
But that is out of my league.

2
If you are using Windows 8 or later you can use escape codes.
Code: QB64: [Select]
  1. Width 80, 25
  2. Width 80, 25, 80, 25
  3. Terminal.ScrollRegion 2, 22
  4.  
  5. Locate 1, 1
  6. Color 7, 4
  7. Print "Lets see if it works:"
  8.  
  9. Locate 23, 1
  10. Print "Testing Scroll Regions"
  11.  
  12. Locate 2, 1
  13. Color 7, 0
  14. Shell "dir /s"
  15.  
  16. Sub Terminal.ScrollRegion (Top As Integer, Buttom As Integer)
  17.     Print Chr$(27) + "[" + _Trim$(Str$(Top)) + ";" + _Trim$(Str$(Buttom)) + "r";
  18.  

Writing this i found that if there is not a CLS it will not work in cmd.exe.
it will work in windows terminal without CLS but the width command is not functioning there.

A list of escape codes that is supported in windows:
https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

3
InForm-based programs / Re: [InForm] Windows 7's run dialog clone
« on: March 13, 2020, 07:05:20 pm »
I have a program that stays 32 bit because of this problem.I have seen how to do it with VBA here: https://social.msdn.microsoft.com/Forums/en-US/1db77ef4-f363-4e60-b680-6cf1c44e22bd/office-32bit-vs-64bit-comdlg32dll?forum=accessdev
But how to Declare PtrSafe Function in qb64 I do not know.


4
QB64 Discussion / Re: INSTR and LEN Question
« on: March 11, 2020, 04:23:27 am »
STR$ returns the number with a leading space or minus
The LEN function returns the number of bytes used by a variable value and the number of characters in a STRING.

5
QB64 Discussion / Re: Finding available COM port numbers
« on: December 17, 2019, 07:22:33 am »
Hi
This example code in the wiki might help you:
https://www.qb64.org/wiki/Windows_Libraries#Windows_Ports

6
QB64 Discussion / Re: Persistence won't work more than once.
« on: May 22, 2019, 03:49:00 am »

7
I use this:
Code: QB64: [Select]
  1. cmd$ = ">nul 2>&1 " + CHR$(34) + "%SYSTEMROOT%\system32\cacls.exe" + CHR$(34) + " " + CHR$(34) + "%SYSTEMROOT%\system32\config\system" + CHR$(34)
  2. errorlevel = _SHELLHIDE(cmd$)
  3. IF errorlevel <> 0 THEN
  4.     PRINT "not elevated."
  5.     PRINT "please run as administrator."
  6.     END
  7.     PRINT "elevated."
  8.  

8
The times I have needed to know if a host is up or down i have used the _shellhide function, so i didn't need an output to file.

a = _SHELLHIDE("ping " + Networkaddress$ + " -n 1 -w 100")

if a is 0 then the host is up
if a is 1 the host is down

Pages: [1]