You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
#Compile Exe
#Register None
#Dim All
#Include "Win32Api.inc"
Global hDlg As Long
Function MyThread (ByVal x As Long) As Long
Shell "Notepad.Exe"
Control Set Text hDlg, 101, "Finished"
End Function
Function PbMain () As Long
Local x As Long, idThread As Long
Thread Create MyThread(x) To idThread
Thread Close idThread To idThread
Dialog New 0, "Hello",,, 200, 25, %WS_SYSMENU Or %WS_CAPTION, %WS_EX_TOPMOST To hDlg
Control Add TextBox, hDlg, 101, "", 10, 5, 180, 15
Dialog Show Modal hDlg
End Function
#Compile Exe
#Register None
#Dim All
#Include "Win32Api.inc"
Function pShellExecute (Program As String, Arguments As String, nShow As Long) As Dword
Local ShellInfo As SHELLEXECUTEINFO
ShellInfo.cbSize = SizeOf(ShellInfo)
ShellInfo.fMask = %SEE_MASK_FLAG_NO_UI Or %SEE_MASK_NOCLOSEPROCESS
ShellInfo.lpFile = StrPtr(Program)
ShellInfo.lpParameters = StrPtr(Arguments)
ShellInfo.nShow = nShow
If ShellExecuteEx(ShellInfo) Then Function = ShellInfo.hProcess
End Function
Function PbMain
Local hProcess As Dword
hProcess = pShellExecute ("Notepad.Exe","", %SW_MAXIMIZE)
WaitForSingleObject hProcess, %INFINITE
CloseHandle hProcess
MsgBox "Ok"
End Function
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment