CodyBarrett Posted May 11, 2009 Share Posted May 11, 2009 hi lol im making a CPU usage Gui... and taking the easy way out im afraid.. but the GUI doesn't let me interact with other programs... it always has the Focus... BUT it won't let me stick it on top.. Winsetontop doesn't work... Guiseststate ($GUI,$WS_EX_TOPMOST ) doesn't work.. im looking to have it always on top.. but unfocused expandcollapse popup#include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #NoTrayIcon HotKeySet ('{ESC}', '_Exit_') Opt ('GUIoneventmode',1) $Gui = GUICreate (@ScriptName, 200,100, -1 ,-1, $WS_POPUPWINDOW) GUISetBkColor (0xFFFFA2, $Gui) $lStatus = GUICtrlCreateLabel ('', 1, 1, 198,98, $SS_CENTER) GUICtrlSetBkColor (-1, 0x000000) GUICtrlSetFont (-1, 60, '', '', 'Fixedsys') GUICtrlSetColor (-1, 0xFFFFA2) GUICtrlSetOnEvent (-1, '_Win_Move_') GUISetOnEvent ($GUI_EVENT_CLOSE,'_exit_',$Gui) GUISetState() WinSetTrans ($Gui, '', 100) While 1 If Not ProcessExists ('Taskmrg.exe') Then Run(@SystemDir & '\taskmgr.exe', '', @SW_HIDE) $iStatus = StatusbarGetText ('Windows Task Manager', '', 2) GUICtrlSetData ($lStatus, StringTrimLeft ($iStatus, 10)) Sleep (300) WEnd Func _Win_Move_ () $MouseXY = MouseGetPos () $WinXY = WinGetPos ($Gui) $xOff = $MouseXY[0] - $WinXY[0] $yOFF = $MouseXY[1] - $WinXY[1] While _IsPressed ('01') WinMove ($Gui, '',MouseGetPos (0) - $xOff ,MouseGetPos (1) - $yOFF) Sleep (100) WEnd EndFunc Func _Exit_ () Exit EndFunc [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
torels Posted May 11, 2009 Share Posted May 11, 2009 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $hGui = GUICreate("Click-through topmost GUI", -1, -1, -1, -1, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TRANSPARENT, $WS_EX_LAYERED)) ; you can omit WS_EX_LAYERED WinSetTrans($hGui, 0, 170) GUISetState() While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop ; yeah right WEnd ;by trancexxhttp://www.autoitscript.com/forum/index.ph...mp;#entry672609guys really... it takes 5 saconds to make a search... it's the 3 time the question is beeing asked in a week! Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 11, 2009 Author Share Posted May 11, 2009 (edited) thats not what i was looking for.. you have to click the GUI to move it... i've never encountered this problem... and i've been using popups for a month or so now so i have no idea whats wrong... Edited May 11, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
lordicast Posted May 11, 2009 Share Posted May 11, 2009 (edited) edit: nevermind i get it Edited May 11, 2009 by lordicast [Cheeky]Comment[/Cheeky] Link to comment Share on other sites More sharing options...
Skruge Posted May 11, 2009 Share Posted May 11, 2009 While 1 If Not ProcessExists ('Taskmrg.exe') Then Run(@SystemDir & '\taskmgr.exe', '', @SW_HIDE) $iStatus = StatusbarGetText ('Windows Task Manager', '', 2) GUICtrlSetData ($lStatus, StringTrimLeft ($iStatus, 10)) Sleep (300)WEndUnless you have some other process you didn't mention, 'Taskmrg.exe' will never be running, so you keep re-launching 'taskmgr.exe'.Since it only allows one instance, it activates itself when you relaunch the exe.If it were some other process, you'd have a million stray processes and run out of memory fast. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Authenticity Posted May 11, 2009 Share Posted May 11, 2009 Haha good eyes. Use this to reduce flickering and to force window the never gain focus: Const $WS_EX_NOACTIVATE = 0x08000000 Const $WS_EX_COMPOSITED = 0x02000000 $hDll = DllOpen('user32.dll') ; For _IsPressed $Gui = GUICreate (@ScriptName, 200,100, -1 ,-1, $WS_POPUPWINDOW, BitOR($WS_EX_NOACTIVATE, $WS_EX_COMPOSITED, $WS_EX_TOPMOST)) GUISetBkColor (0xFFFFA2, $Gui) $lStatus = GUICtrlCreateLabel ('', 1, 1, 198,98, $SS_CENTER, BitOR($WS_EX_NOACTIVATE, $WS_EX_COMPOSITED)) Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 12, 2009 Author Share Posted May 12, 2009 (edited) well.. i want it to gain focus for the user to move the window around the screen but thanks ill test it out and get back to you EDIT... flicker is gone.. but it still focuses itself.. i can't type on another window Edited May 12, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Authenticity Posted May 12, 2009 Share Posted May 12, 2009 (edited) Don't know why but it's working perfectly for me. I've changed the transparency and disabled $WS_POPUPWINDOW so you can see the title bar becomes blue, noting it's taking the focus but nop, 909090. expandcollapse popup#include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #NoTrayIcon HotKeySet ('{ESC}', '_Exit_') Opt ('GUIoneventmode',1) Const $WS_EX_NOACTIVATE = 0x08000000 Const $WS_EX_COMPOSITED = 0x02000000 $hDll = DllOpen('user32.dll') ; For _IsPressed $Gui = GUICreate (@ScriptName, 200,100, -1 ,-1, -1, BitOR($WS_EX_NOACTIVATE, $WS_EX_COMPOSITED, $WS_EX_TOPMOST)) GUISetBkColor (0xFFFFA2, $Gui) $lStatus = GUICtrlCreateLabel ('', 1, 1, 198,98, $SS_CENTER, BitOR($WS_EX_NOACTIVATE, $WS_EX_COMPOSITED)) GUICtrlSetBkColor (-1, 0x000000) GUICtrlSetFont (-1, 60, '', '', 'Fixedsys') GUICtrlSetColor (-1, 0xFFFFA2) GUICtrlSetOnEvent (-1, '_Win_Move_') GUISetOnEvent ($GUI_EVENT_CLOSE,'_exit_',$Gui) GUISetState() WinSetTrans ($Gui, '', 200) While 1 If Not ProcessExists ('taskmgr.exe') Then Run('taskmgr.exe', '', @SW_HIDE) $iStatus = StatusbarGetText ('Windows Task Manager', '', 2) GUICtrlSetData ($lStatus, StringTrimLeft ($iStatus, 10)) Sleep (100) WEnd Func _Win_Move_ () $MouseXY = MouseGetPos () $WinXY = WinGetPos ($Gui) $xOff = $MouseXY[0] - $WinXY[0] $yOFF = $MouseXY[1] - $WinXY[1] While _IsPressed ('01', $hDll) WinMove ($Gui, '',MouseGetPos (0) - $xOff ,MouseGetPos (1) - $yOFF) Sleep (100) WEnd EndFunc Func _Exit_ () GUIDelete() ProcessClose('taskmgr.exe') DllClose($hDll) Exit EndFunc Edited May 12, 2009 by Authenticity Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 12, 2009 Author Share Posted May 12, 2009 could it be the POPup type? [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now