06-12-2025, 10:58 AM
Sorry, I don't know much about programming in this area.
The following code still doesn't work. After running the exe, executing it again does not display the OSDÂ text
Macro Macro8
The following code still doesn't work. After running the exe, executing it again does not display the OSDÂ text
Macro Macro8
;at the beginning of exe main function:
SetLastError 0
__Handle m=CreateMutex(0 1 "mutex_my_exe")
if(!m) mes- "Error"
if(GetLastError=ERROR_ALREADY_EXISTS) ;;another instance of your exe is running
,;possibly execute some code here
,sub.osdTip
,ret ;;exit exe
sub.osdTip
AddTrayIcon "cut.ico" "test_TcpSocket_server[]Ctrl+click to end."
#compile "__TcpSocket"
TcpSocket x.ServerStart(5032 &sub.OnClientConnected)
#sub OnClientConnected
function TcpSocket&client $clientIp param !*reserved
client.Receive(_s 1000)
out F"SERVER: client request: {_s}"
client.Send("response 1")
#sub osdTip
OsdHide "o1"
OnScreenDisplay "TcpSocket_server is Running!" 10 0 0 "" 36 0x33331F 4|8 "o1" 0xFFFFFF