hi guys. i cound't found an answer in the forum so i create a new topic.
My questioin is quite simple : I wante to create a TopMost Windows that doesn't take focus.
In fact, i create an application which runs in background and displays answer like a notification, ie 'Windows Live Messenger', as shown below:
http://usb-online.fr/file-download-c30MTA0Mg.html (Direct link image)
The fast is i want this window to be 'Always on top', but i don't want her to take the focus.
If would be quite simple if i had no controls in my GUI.
Using this code : If i add GUISetState(@SW_SHOW) , then i can use my controls but the GUI take the focus when created.
If i delete this line, then it's perfect, GUI is shown 'top most', doesn't take the focus, but I CAN't INTERACT with my controls.
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", WinGetHandle($gui), "int", 600+4*$h, "long", 0x00040008);Slide In Bottom
GUISetState(@SW_SHOW)
$t = TimerInit()
While (TimerDiff($t) <= $duration*1000) ANd (Not $ExitGui)
Sleep(10)
WEnd
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", WinGetHandle($gui), "int", 1000, "long", 0x00050004);Slide Out Bottom
GUIDelete($gui)
Is someone has an idea?
Thx a lot for help,
Tim
There is the full function :
Func Tip($title,$msg,$duration = 8,$icone = 1) ;duration in seconds
Global $total_width,$total_height,$ExitGui = FALSE
Local $h = 70, $w = 400 ;Hauteur et Largeur
;Maintenant on trouve la hauteur de la barre des taches
$hMonitor = GetMonitorFromPoint(0, 0)
If $hMonitor <> 0 Then
GetMonitorInfos($hMonitor)
EndIf
$Nb = StringSplit($msg,@CRLF)
$h = $h+$Nb[0]*8
;On demarre notre fonction
$gui=GUICreate("",$w,$h,$total_width-$w-4,$total_height-$h+4,0x80880000,$WS_EX_TOPMOST)
$n2 = GUICtrlCreateIcon("shell32.dll", -28, $w-18, 2, 16, 16)
GUICtrlSetCursor(-1,3)
GUICtrlSetOnEvent(-1,"ExitGui")
If $icone = 3 Then
$icon = GUICtrlCreateIcon("ieframe.dll", -88, 10, 6)
Else
$icon = GUICtrlCreateIcon("ieframe.dll", -89, 10, 6)
EndIf
GUICtrlCreateLabel($title,50,10,$w-70,20)
GUICtrlSetFont(-1, 14, -1, -1, "Trebuchet MS")
;$label = _GuiCtrlTexte_Create(50,40,$w-50,$h-40-20,"white","black","Arial",8)
;_GuiCtrlTexte_Write($label,$msg)
$label=GUICtrlCreateLabel($msg,50,40,$w-50,$h-40-20)
GUICtrlSetFont(-1, 8, -1, -1, "Arial")
Global $link=GUICtrlCreateLabel("Cliquez ici pour plus de détails",50,$h-20,$w-50,20)
GUICtrlSetOnEvent($link,"PlusDeDetails")
GUICtrlSetCursor($link,5)
GUICtrlSetColor($link, 0x0000FF)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", WinGetHandle($gui), "int", 600+4*$h, "long", 0x00040008);Slide In Bottom
GUISetState(@SW_SHOW)
$t = TimerInit()
While (TimerDiff($t) <= $duration*1000) ANd (Not $ExitGui)
Sleep(10)
WEnd
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", WinGetHandle($gui), "int", 1000, "long", 0x00050004);Slide Out Bottom
GUIDelete($gui)
EndFunc