Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
single instance run
#7
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
Code:
Copy      Help
;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


Messages In This Thread
single instance run - by Davider - 06-12-2025, 01:39 AM
RE: single instance run - by Gintaras - 06-12-2025, 02:02 AM
RE: single instance run - by Davider - 06-12-2025, 02:34 AM
RE: single instance run - by Gintaras - 06-12-2025, 02:40 AM
RE: single instance run - by Davider - 06-12-2025, 06:41 AM
RE: single instance run - by Gintaras - 06-12-2025, 07:01 AM
RE: single instance run - by Davider - 06-12-2025, 10:58 AM
RE: single instance run - by Gintaras - 06-12-2025, 11:12 AM
RE: single instance run - by Gintaras - 06-12-2025, 11:20 AM
RE: single instance run - by Davider - 06-12-2025, 09:28 PM
RE: single instance run - by Gintaras - 06-13-2025, 02:03 AM
RE: single instance run - by Davider - 06-13-2025, 10:35 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)