Procedure OpenWin()
If OpenWindow(0,0,0,320,240,"",#PB_Window_Minimize | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
WebGadget(1,0,0,320,240,"")
EndIf
EndProcedure
Procedure max(a)
Delay(2000) ; <------------------- Use this time to click the IDE window bar to set focus
PostMessage_(WindowID(0),#WM_SYSCOMMAND, #SC_RESTORE, 0)
SetForegroundWindow_(WindowID(0))
EndProcedure
OpenWin()
CreateThread(@max(),0)
Repeat
Until WaitWindowEvent()=#WM_CLOSE
I tested your code and it still gives the same results as before but if you comment out the webgadget and set the focus in the IDE it works , what's the problem there? I'm on Windows
Global tid
Procedure OpenWin()
If OpenWindow(0,0,0,320,240,"",#PB_Window_Minimize | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
WebGadget(1,0,0,320,240,"")
EndIf
EndProcedure
Procedure max(a)
Delay(2000) ; <------------------- Use this time to click the IDE window bar to set focus
AttachThreadInput_(GetCurrentThreadId_(), tid, #True)
SendMessage_(WindowID(0),#WM_SYSCOMMAND, #SC_RESTORE, 0)
SetForegroundWindow_(WindowID(0))
SetFocus_(WindowID(0))
EndProcedure
OpenWin()
tid = GetCurrentThreadId_()
CreateThread(@max(),0)
Repeat
Until WaitWindowEvent()=#WM_CLOSE
Global tid
Procedure OpenWin()
If OpenWindow(0,0,0,320,240,"",#PB_Window_Minimize | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
WebGadget(1,0,0,320,240,"")
EndIf
EndProcedure
Procedure max(a)
Delay(2000) ; <------------------- Use this time to click the IDE window bar to set focus
AttachThreadInput_(GetCurrentThreadId_(), tid, #True)
SendMessage_(WindowID(0),#WM_SYSCOMMAND, #SC_RESTORE, 0)
SetForegroundWindow_(WindowID(0))
SetFocus_(WindowID(0))
EndProcedure
OpenWin()
tid = GetCurrentThreadId_()
CreateThread(@max(),0)
Repeat
Until WaitWindowEvent()=#WM_CLOSE
Global tid, r
Procedure OpenWin()
If OpenWindow(0,0,0,320,240,"",#PB_Window_Minimize | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
WebGadget(1,0,0,320,240,"")
EndIf
EndProcedure
Procedure max(a)
Delay(2000) ; <------------------- Use this time to click the IDE window bar to set focus
AttachThreadInput_(GetCurrentThreadId_(), tid, #True)
SendMessage_(WindowID(0),#WM_SYSCOMMAND, #SC_RESTORE, 0)
SetForegroundWindow_(WindowID(0))
SetFocus_(WindowID(0))
ShowCursor_(0)
GetCursorPos_(cp.POINT)
SetCursorPos_(WindowX(0)+2, WindowY(0)+2)
keybd_event_(#VK_LBUTTON,0,0,0)
keybd_event_(#VK_LBUTTON,0,#KEYEVENTF_KEYUP,0)
SetCursorPos_(cp\x, cp\y)
ShowCursor_(1)
r=1
EndProcedure
OpenWin()
tid = GetCurrentThreadId_()
CreateThread(@max(),0)
Repeat
If r
r=0
If GetFocus_() = WindowID(0)
Debug "Success"
Else
Debug "No success"
EndIf
EndIf
Until WaitWindowEvent()=#WM_CLOSE
Global tid, r
Procedure OpenWin()
If OpenWindow(0,0,0,320,240,"",#PB_Window_Minimize | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
WebGadget(1,0,0,320,240,"")
EndIf
EndProcedure
Procedure max(a)
Delay(2000) ; <------------------- Use this time to click the IDE window bar to set focus
AttachThreadInput_(GetCurrentThreadId_(), tid, #True)
SendMessage_(WindowID(0),#WM_SYSCOMMAND, #SC_RESTORE, 0)
SetForegroundWindow_(WindowID(0))
SetFocus_(WindowID(0))
ShowCursor_(0)
GetCursorPos_(cp.POINT)
SetCursorPos_(WindowX(0)+2, WindowY(0)+2)
keybd_event_(#VK_LBUTTON,0,0,0)
keybd_event_(#VK_LBUTTON,0,#KEYEVENTF_KEYUP,0)
SetCursorPos_(cp\x, cp\y)
ShowCursor_(1)
r=1
EndProcedure
OpenWin()
tid = GetCurrentThreadId_()
CreateThread(@max(),0)
Repeat
If r
r=0
If GetFocus_() = WindowID(0)
Debug "Success"
Else
Debug "No success"
EndIf
EndIf
Until WaitWindowEvent()=#WM_CLOSE
Success for both (when not in ide and when in ide) however when in the ide only SetForeGroundWindow() works ; the window flashes in the taskbar but is not brought up over the other windows like before.
Procedure OpenWin()
If OpenWindow(0,0,0,320,240,"",#PB_Window_Minimize | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
WebGadget(1,0,0,320,240,"")
EndIf
EndProcedure
Procedure max(a)
Delay(2000) ; <------------------- Use this time to click the IDE window bar to set focus
SendMessage_(#HWND_BROADCAST, #WM_SYSCOMMAND, #SC_HOTKEY, WindowID(0))
EndProcedure
OpenWin()
CreateThread(@max(),0)
Repeat
Until WaitWindowEvent()=#WM_CLOSE
Procedure OpenWin()
If OpenWindow(0,0,0,320,240,"",#PB_Window_Minimize | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
WebGadget(1,0,0,320,240,"")
EndIf
EndProcedure
Procedure max(a)
Delay(2000) ; <------------------- Use this time to click the IDE window bar to set focus
SendMessage_(#HWND_BROADCAST, #WM_SYSCOMMAND, #SC_HOTKEY, WindowID(0))
EndProcedure
OpenWin()
CreateThread(@max(),0)
Repeat
Until WaitWindowEvent()=#WM_CLOSE