The Forms you want to use require the Windows Framework libraries.
If you want to create a program that uses the windows graphical interface and consequently the windows API itself you must include windows.bi
While if you want to use forms as in Visual BASIC you must necessarily use the Framework and Framework.NET libraries
Even though I have already done it, I don't have an example to show you, I currently work under Linux and I don't have a Windows PC where I can create a working example for you.
Code: Select all
#include "windows.bi"
dim as MSG msg
dim as HWND MainWindow, BClose, BStart, TCommand, TTime, BFirefox, BGeany, BMSYS64, BPromptDOS
dim as HWND LCommand, LTime
dim as integer Time_Value
MainWindow = CreateWindowEx(0,"#32770", "Hello", WS_OVERLAPPEDWINDOW Or WS_VISIBLE, 100, 100, 500, 320, 0,0,0,0 )
'Buttons
BClose = CreateWindowEx(0, "Button", "Close", WS_VISIBLE Or WS_CHILD, 20, 10, 100, 30, MainWindow, 0, 0, 0)
BStart = CreateWindowEx(0, "Button", "Run", WS_VISIBLE Or WS_CHILD, 130, 10, 100, 30, MainWindow, 0, 0, 0)
BGeany = CreateWindowEx(0, "Button", "Load Geany", WS_VISIBLE Or WS_CHILD, 20, 200, 110, 30, MainWindow, 0, 0, 0)
BFirefox = CreateWindowEx(0, "Button", "Load Firefox", WS_VISIBLE Or WS_CHILD, 135, 200, 110, 30, MainWindow, 0, 0, 0)
BMSYS64 = CreateWindowEx(0, "Button", "Load Msys2", WS_VISIBLE Or WS_CHILD, 250, 200, 110, 30, MainWindow, 0, 0, 0)
BPromptDOS = CreateWindowEx(0, "Button", "Open Prompt", WS_VISIBLE Or WS_CHILD, 20, 235, 110, 30, MainWindow, 0, 0, 0)
'Label
LCommand = CreateWindowEx(0, "Static", "Command :" , WS_VISIBLE Or WS_CHILD , 10, 50, 99, 20, MainWindow, 0, 0, 0 )
LTime = CreateWindowEx(0, "Static", "Time in Sec. :" , WS_VISIBLE Or WS_CHILD , 10, 73, 99, 20, MainWindow, 0, 0, 0 )
'TextBox
TCommand = CreateWindowEx(0, "Edit", "" , WS_BORDER Or WS_VISIBLE Or WS_CHILD Or ES_AUTOHSCROLL, 120, 50, 200, 20, MainWindow, 0, 0, 0 )
TTime = CreateWindowEx(0, "Edit", "" , WS_BORDER Or WS_VISIBLE Or WS_CHILD Or ES_AUTOHSCROLL, 120, 73, 50, 20, MainWindow, 0, 0, 0 )
dim as ZString*1024 Command_text
dim as ZString*512 Time_text
While GetMessage(@msg, 0, 0, 0)
TranslateMessage( @msg )
DispatchMessage( @msg )
Select Case msg.hwnd
case MainWindow
Select Case msg.message
Case 273
End
Case Else
End Select
Case BClose
Select Case msg.message
Case WM_LBUTTONDOWN
end
End Select
Case BStart
Select Case msg.message
Case WM_LBUTTONDOWN
GetWindowText(TCommand, Command_text, sizeof(Command_text))
GetWindowText(TTime, Time_text, sizeof(Time_text))
Time_Value = val(Time_text)
MessageBox( MainWindow, "Start timed." & Comando_text, "Start Timed", MB_OK Or MB_ICONINFORMATION )
End Select
Case BGeany
Select Case msg.message
Case WM_LBUTTONDOWN
shell "geany.cmd"
End Select
Case BFirefox
Select Case msg.message
Case WM_LBUTTONDOWN
shell "firefox.cmd"
End Select
Case BMSYS64
Select Case msg.message
Case WM_LBUTTONDOWN
shell "msys2.cmd"
End Select
Case BPromptDOS
Select Case msg.message
Case WM_LBUTTONDOWN
shell "shell.cmd"
End Select
End Select
Wend