|
Post by Stefan Pendl on Apr 27, 2021 10:39:01 GMT -5
sample program works on Windows 10 x86, but does not work on Windows 10 x64.
|
|
|
Post by Stefan Pendl on Apr 28, 2021 1:00:00 GMT -5
Restarting LB5 fixed the problem, so for testing LB5 alpha it seems that a new instance of LB5 should be used for each new sample.
|
|
|
Post by Carl Gundel on Apr 28, 2021 7:45:09 GMT -5
Restarting LB5 fixed the problem, so for testing LB5 alpha it seems that a new instance of LB5 should be used for each new sample. Well, that might not help us to figure out how the bug (apparently some sort of general problem with timers?) begins to manifest. BTW my suspicion is that it is not specific to the 64 bit version.
|
|
|
Post by Stefan Pendl on Apr 29, 2021 4:00:07 GMT -5
So I will try to automate my testing and report back with my findings.
|
|
|
Post by Stefan Pendl on May 3, 2021 12:32:01 GMT -5
If I test LB5 alpha using the program listed below started in LB4.5.1 the first sample not working is the red cube. I reuse the initially started LB5 session. BTW, I do not have an ODBC driver installed, so the ODBC sample fails. If I restart LB5 and recheck the failing samples they work correctly.
Point the variable Lb5InstallDir$ to the folder containing the LB5 executable.
'LB5 test suite.bas 'Author: Stefan Pendl 'Date: 03.05.21
nomainwin
global hWndLB5
dim info$(1, 1)
Lb5InstallDir$ = "C:\VistaIncompatibel\lb5-352" Lb5DataDir$ = Lb5InstallDir$; "\bas_files"
files Lb5DataDir$, "*.bas", info$()
button #win.default, "Next", [next], ul, 10, 10 statictext #win.st, "", 10, 50, 290, 30 texteditor #win.te, 10, 80, 290, 100
open "LB5 alpha test" for window as #win #win "trapclose [quit]"
callback lpEnumFunc, EnumWindowsProc(ulong, ulong), long
calldll #user32, "EnumWindows", _ lpEnumFunc as ulong, _ lParam as ulong, _ result as long
[next] i = i + 1 if i > val( info$(0, 0)) then i = 1
#win.st i; " ... "; info$(i, 0) #win.te info$(0, 2); info$(0, 3); info$(i, 0) #win.te "!selectall" #win.te "!cut"
dummy = BringWindowToTop(hWndLB5)
gosub [delay]
if i > 1 then ' sending Ctrl+W call keybdEvent _VK_CONTROL, 1 call keybdEvent asc("W"), 1 call keybdEvent asc("W"), 0 call keybdEvent _VK_CONTROL, 0 end if
' sending Ctrl+O call keybdEvent _VK_CONTROL, 1 call keybdEvent asc("O"), 1 call keybdEvent asc("O"), 0 call keybdEvent _VK_CONTROL, 0
gosub [delay]
' sending Ctrl+V call keybdEvent _VK_CONTROL, 1 call keybdEvent asc("V"), 1 call keybdEvent asc("V"), 0 call keybdEvent _VK_CONTROL, 0
gosub [delay]
' sending Return call keybdEvent _VK_RETURN, 1 call keybdEvent _VK_RETURN, 0
gosub [delay]
' sending Shift+F5 call keybdEvent _VK_SHIFT, 1 call keybdEvent _VK_F5, 1 call keybdEvent _VK_F5, 0 call keybdEvent _VK_SHIFT, 0
wait
[quit] close #win end
[delay] timer 1000, [continue] wait
[continue] timer 0 return
function EnumWindowsProc(hwnd, lParam) nMaxCount = 1024 lpString$ = space$(nMaxCount)
calldll #user32, "GetWindowTextA", _ hwnd as ulong, _ lpString$ as ptr, _ nMaxCount as ulong, _ result as ulong
if instr(lpString$, "BASIC v5") > 0 then hWndLB5 = hwnd end if
EnumWindowsProc = 1 end function
Function BringWindowToTop( hWnd ) CallDLL #user32, "BringWindowToTop", _ hWnd As ULong, _ BringWindowToTop As ULong End Function
sub keybdEvent bVk, depressed 'bVk ......... Virtual Key Code of the key 'depressed ... 0 = released, 1 = depressed if depressed = 0 then dwFlags = _KEYEVENTF_KEYUP
calldll #user32, "keybd_event",_ bVk as ushort,_ bScan as ushort,_ dwFlags as ulong,_ dwExtraInfo as ulong,_ result as void end sub
|
|
|
Post by Stefan Pendl on May 3, 2021 13:49:25 GMT -5
Restarting LB5 before testing a sample results in the samples working without any issues, even all sprite examples find all support images.
Point the variable Lb5InstallDir$ to the folder containing the LB5 executable.
'LB5 test suite.bas 'Author: Stefan Pendl 'Date: 03.05.21
nomainwin
global hWndLB5
dim info$(1, 1)
Lb5InstallDir$ = "C:\VistaIncompatibel\lb5-352" Lb5DataDir$ = Lb5InstallDir$; "\bas_files"
files Lb5DataDir$, "*.bas", info$()
button #win.default, "Next", [next], ul, 10, 10 statictext #win.st, "", 10, 50, 290, 30 texteditor #win.te, 10, 80, 290, 100
open "LB5 alpha test" for window as #win #win "trapclose [quit]"
[next] i = i + 1 if i > val( info$(0, 0)) then i = 1
#win.st i; " ... "; info$(i, 0) #win.te info$(0, 2); info$(0, 3); info$(i, 0) #win.te "!selectall" #win.te "!cut"
if i > 1 then dummy = BringWindowToTop(hWndLB5)
gosub [delay]
' sending Alt+F4 call keybdEvent _VK_MENU, 1 call keybdEvent _VK_F4, 1 call keybdEvent _VK_F4, 0 call keybdEvent _VK_MENU, 0 end if
gosub [RestartLb5]
dummy = BringWindowToTop(hWndLB5)
gosub [delay]
' sending Ctrl+O call keybdEvent _VK_CONTROL, 1 call keybdEvent asc("O"), 1 call keybdEvent asc("O"), 0 call keybdEvent _VK_CONTROL, 0
gosub [delay]
' sending Ctrl+V call keybdEvent _VK_CONTROL, 1 call keybdEvent asc("V"), 1 call keybdEvent asc("V"), 0 call keybdEvent _VK_CONTROL, 0
gosub [delay]
' sending Return call keybdEvent _VK_RETURN, 1 call keybdEvent _VK_RETURN, 0
gosub [delay]
if instr(lower$(info$(i, 0)), "fformj10_lb5_test") > 0 then gosub [delay] gosub [delay] gosub [delay] end if
' sending Shift+F5 call keybdEvent _VK_SHIFT, 1 call keybdEvent _VK_F5, 1 call keybdEvent _VK_F5, 0 call keybdEvent _VK_SHIFT, 0
wait
[quit] close #win end
[delay] timer 1000, [continue] wait
[continue] timer 0 return
[RestartLb5] open Lb5InstallDir$; "\lb5alpha64_test.cmd" for output as #cmd #cmd "cd /d "; Lb5InstallDir$ #cmd chr$(34); Lb5InstallDir$; "\lb5alpha64.exe"; chr$(34) close #cmd
run chr$(34);Lb5InstallDir$; "\lb5alpha64_test.cmd"; chr$(34), HIDE
gosub [delay] gosub [delay] gosub [delay]
callback lpEnumFunc, EnumWindowsProc(ulong, ulong), long
calldll #user32, "EnumWindows", _ lpEnumFunc as ulong, _ lParam as ulong, _ result as long return
function EnumWindowsProc(hwnd, lParam) nMaxCount = 1024 lpString$ = space$(nMaxCount)
calldll #user32, "GetWindowTextA", _ hwnd as ulong, _ lpString$ as ptr, _ nMaxCount as ulong, _ result as ulong
if instr(lpString$, "BASIC v5") > 0 then hWndLB5 = hwnd end if
EnumWindowsProc = 1 end function
Function BringWindowToTop( hWnd ) CallDLL #user32, "BringWindowToTop", _ hWnd As ULong, _ BringWindowToTop As ULong End Function
sub keybdEvent bVk, depressed 'bVk ......... Virtual Key Code of the key 'depressed ... 0 = released, 1 = depressed if depressed = 0 then dwFlags = _KEYEVENTF_KEYUP
calldll #user32, "keybd_event",_ bVk as ushort,_ bScan as ushort,_ dwFlags as ulong,_ dwExtraInfo as ulong,_ result as void end sub
|
|