Quote from: Johan Klassen on November 30, 2026, 08:27:10 PMMarc Giao
running your program from tkedit will launch a terminal even with #cmdline "-s gui"
but if you compile your program with tkedit using #cmdline "-s gui" and then launch your program by double-clicking then you should see no terminal

' ########################################################################################
' Microsoft Windows
' Contents: Windows controls - Button with a tooltip
' Compiler: tiko-lang
' Copyright (c) 2026 José Roca. Freeware. Use at your own risk.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#import "sys/win"
#import "sys/win/gui"
using win, gui
' // Forward declaration
DECLARE FUNCTION DlgProc (BYVAL hDlg AS HWND, BYVAL uMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LPARAM) AS INT_PTR
CONST IDC_OK = 1001
' ========================================================================================
' Main
' ========================================================================================
FUNCTION main (BYVAL nCmdShow AS LONG = SW_SHOW) AS LONG
' // Set process DPI aware
SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
' // Enable visual styles without including a manifest file
EnableVisualStyles
' // Create a new dialog using dialog units
DIM pDlg AS CDialog
pDlg.DialogNew(0, "Cialog with a button and tooltip", 50, 50, 175, 65, WS_OVERLAPPEDWINDOW OR DS_CENTER)
' // Add a button to the dialog
DIM hButton AS HWND = pDlg.ControlAdd("Button", IDC_OK, "&Hover me", 105, 40, 50, 12, BS_DEFPUSHBUTTON)
' // Add a tooltip to the button
DIM hTooltip AS HWND = ToolTip.AddTooltip(hButton, "This is a button with a tooltip", TRUE, TRUE)
' // Add a caption and an icon to the tooltip
ToolTip.SetTitle(hTooltip, TTI_INFO, "Caption")
' // Anchor the button to the bottom and the right side of the dialog
pDlg.ControlAnchor(IDC_OK, ANCHOR_BOTTOM_RIGHT)
' // Display and activate the dialog as modal
pDlg.DialogShowModal(@DlgProc)
RETURN pDlg.DialogEndResult
END FUNCTION
' ========================================================================================
' ========================================================================================
' Dialog callback procedure
' ========================================================================================
FUNCTION DlgProc (BYVAL hDlg AS HWND, BYVAL uMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LPARAM) AS INT_PTR
' // Pointer to the dialog class
STATIC pDlg AS CDialog PTR
SELECT CASE uMsg
CASE WM_INITDIALOG
' // Get a pointer to the CDialog class
pDlg = cast(CDialog PTR, lParam)
RETURN TRUE
CASE WM_COMMAND
SELECT CASE CBCTL(wParam, lParam)
CASE IDCANCEL
' // If ESC key pressed, close the application by sending an WM_CLOSE message
IF CBCTLMSG(wParam, lParam) = BN_CLICKED THEN
pDlg->DialogSend(WM_CLOSE, 0, 0)
END IF
CASE IDC_OK
MessageBoxW(hDlg, "OK button pressed", "Message", MB_OK)
END SELECT
CASE WM_CLOSE
' // End the application
pDlg->DialogEnd(0)
END SELECT
RETURN FALSE
END FUNCTION
' ========================================================================================
' ========================================================================================
' // Call main() and return the error code to the OS
' ========================================================================================
END main()
' ========================================================================================
' ########################################################################################
' Microsoft Windows
' Contents: ListBox control
' Compiler: tiko-lang
' Copyright (c) 2026 José Roca. Freeware. Use at your own risk.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#import "sys/win"
#import "sys/win/gui"
using win, gui
' // Forward declaration
DECLARE FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
#define IDC_LISTBOX 1001
' ========================================================================================
' Main
' ========================================================================================
FUNCTION main (BYVAL nCmdShow AS LONG = SW_NORMAL) AS LONG
' // Set process DPI aware
SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
' // Enable visual styles without including a manifest file
EnableVisualStyles
' // Create the main window
DIM pWindow AS CWindow = "MyClassName" ' Use the name you wish
DIM hWin AS HWND = pWindow.Create(NULL, "CWindow - ListBox control", @WndProc)
' // Size it by setting the wanted width and height of its client area
pWindow.SetClientSize(318, 380)
' // Center the window
pWindow.Center
' // Adds a listbox
DIM hListBox AS HWND = pWindow.AddControl("ListBox", hWin, IDC_LISTBOX)
pWindow.SetWindowPos hListBox, NULL, 8, 8, 300, 320, SWP_NOZORDER
' // Anchor the ListBox
pWindow.AnchorControl(hListBox, ANCHOR_HEIGHT_WIDTH)
' // Fill the list box
DIM ustrText AS USTRING
FOR i AS LONG = 1 TO 50
ustrText = "Item " & RIGHT("00" & WSTR(i), 2)
ListBox.AddString(hListBox, ustrText)
NEXT
' // Select the first item
ListBox.SetCursel(hListBox, 0)
' // Add a cancel button
pWindow.AddControl("Button", hWin, IDCANCEL, "&Cancel", 233, 340, 75, 23)
' // Anchor the button
pWindow.AnchorControl(IDCANCEL, ANCHOR_BOTTOM_RIGHT)
' // Displays the window and dispatches the Windows messages
FUNCTION = pWindow.DoEvents(nCmdShow)
END FUNCTION
' ========================================================================================
' ========================================================================================
' Main window procedure
' ========================================================================================
FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
SELECT CASE uMsg
' // If an application processes this message, it should return zero to continue
' // creation of the window. If the application returns –1, the window is destroyed
' // and the CreateWindowExW function returns a NULL handle.
CASE WM_CREATE
EnableDarkModeForWindow(hwnd)
RETURN 0
' // Theme has changed
CASE WM_THEMECHANGED
EnableDarkModeForWindow(hwnd)
RETURN 0
' // Sent when the user selects a command item from a menu, when a control sends a
' // notification message to its parent window, or when an accelerator keystroke is translated.
CASE WM_COMMAND
SELECT CASE CBCTL(wParam, lParam)
CASE IDCANCEL
' // If ESC key pressed, close the application by sending an WM_CLOSE message
IF CBCTLMSG(wParam, lParam) = BN_CLICKED THEN SendMessageW(hwnd, WM_CLOSE, 0, 0)
CASE IDC_LISTBOX
SELECT CASE CBCTLMSG(wParam, lParam)
CASE LBN_DBLCLK
' // Get the handle of the Listbox
DIM hListBox AS HWND = GetDlgItem(hwnd, IDC_LISTBOX)
' // Get the current selection
DIM curSel AS LONG = ListBox.GetCursel(hListBox)
DIM ustrText AS USTRING = ListBox.GetText(hListBox, curSel)
MessageBoxW(hwnd, ustrText, "ListBox test", MB_OK)
END SELECT
END SELECT
RETURN 0
CASE WM_DESTROY
' // End the application by sending an WM_QUIT message
PostQuitMessage(0)
RETURN 0
END SELECT
' // Default processing of Windows messages
FUNCTION = DefWindowProcW(hwnd, uMsg, wParam, lParam)
END FUNCTION
' ========================================================================================
' ========================================================================================
' // Call main() and return the error code to the OS
' ========================================================================================
END main()
' ========================================================================================

QuoteI have just posted a query about getting rid of the Console Window, before finding this post. Where do I find the Win64 GUI Configuration?Which application are you using? The older Tiko Editor that was built for traditional FreeBASIC, or the new tkEdit Editor included in the Tiko Programming Language?