SkellySoul Posted September 23, 2009 Share Posted September 23, 2009 I am trying to figure out a way to have a GUI that is always on top but yet I can click through it I am stumped. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted September 23, 2009 Share Posted September 23, 2009 Well unless you are holding out facts on us they wouldn't be able to see what they are clicking on so what would be the point? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
SkellySoul Posted September 24, 2009 Author Share Posted September 24, 2009 Well unless you are holding out facts on us they wouldn't be able to see what they are clicking on so what would be the point?well it's for personal use really, question have you ever woke up in the morning roughly 3-5 AM because you couldn't sleep and happen to go to turn on your computer and it is bright enough to blind you?So what I plan to do is create a shadow effect that will overlap my desktop to dim the brightness or even if I can get some dll calls for monitor brightness that would be super. Link to comment Share on other sites More sharing options...
smashly Posted September 24, 2009 Share Posted September 24, 2009 Hi, expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <Misc.au3> Opt('MustDeclareVars', 1) Example1() ; example 1 Func Example1() Local $hGui, $iW = 400, $iH = 300, $iPic, $msg $hGui = GUICreate("My GUI", $iW, $iH, -1, -1, $WS_POPUP, BitOr($WS_EX_TOPMOST, $WS_EX_LAYERED, $WS_EX_TRANSPARENT)) $iPic = GUICtrlCreatePic("", 0, 0, $iW, $iH) _CreateColorPic($iPic, $iW, $iH, 0xFF00FFAA) WinSetTrans($hGui, "", 120) GUISetState(@SW_SHOWNA, $hGui) Do Until _IsPressed("1B") ;Esc to exit EndFunc ;==>Example1 Func _CreateColorPic($iCID, $iW, $iH, $iARGB = 0xFFFFFFFF) Local Const $STM_SETIMAGE = 0x0172 Local Const $IMAGE_BITMAP = 0 Local $hBmp, $hBitmap, $hGraphic, $hOldBmp _GDIPlus_Startup() $hBmp = _WinAPI_CreateBitmap($iW, $iW, 1, 32) $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) _WinAPI_DeleteObject($hBmp) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsClear($hGraphic, $iARGB) _GDIPlus_GraphicsDispose($hGraphic) $hBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) $hOldBmp = GUICtrlSendMsg($iCID, $STM_SETIMAGE, $IMAGE_BITMAP, $hBmp) If $hOldBmp Then _WinAPI_DeleteObject($hOldBmp) _GDIPlus_Shutdown() EndFunc Cheers Link to comment Share on other sites More sharing options...
SkellySoul Posted September 24, 2009 Author Share Posted September 24, 2009 (edited) Hi, expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <Misc.au3> Opt('MustDeclareVars', 1) Example1() ; example 1 Func Example1() Local $hGui, $iW = 400, $iH = 300, $iPic, $msg $hGui = GUICreate("My GUI", $iW, $iH, -1, -1, $WS_POPUP, BitOr($WS_EX_TOPMOST, $WS_EX_LAYERED, $WS_EX_TRANSPARENT)) $iPic = GUICtrlCreatePic("", 0, 0, $iW, $iH) _CreateColorPic($iPic, $iW, $iH, 0xFF00FFAA) WinSetTrans($hGui, "", 120) GUISetState(@SW_SHOWNA, $hGui) Do Until _IsPressed("1B") ;Esc to exit EndFunc ;==>Example1 Func _CreateColorPic($iCID, $iW, $iH, $iARGB = 0xFFFFFFFF) Local Const $STM_SETIMAGE = 0x0172 Local Const $IMAGE_BITMAP = 0 Local $hBmp, $hBitmap, $hGraphic, $hOldBmp _GDIPlus_Startup() $hBmp = _WinAPI_CreateBitmap($iW, $iW, 1, 32) $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) _WinAPI_DeleteObject($hBmp) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsClear($hGraphic, $iARGB) _GDIPlus_GraphicsDispose($hGraphic) $hBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) $hOldBmp = GUICtrlSendMsg($iCID, $STM_SETIMAGE, $IMAGE_BITMAP, $hBmp) If $hOldBmp Then _WinAPI_DeleteObject($hOldBmp) _GDIPlus_Shutdown() EndFunc Cheers Excellent I would of never thought about GDI because I know nothing about it Thanks Very Much Edited September 24, 2009 by SkellySoul Link to comment Share on other sites More sharing options...
SkellySoul Posted September 24, 2009 Author Share Posted September 24, 2009 I got one more question please I went and stripped a lot of code to try and find out what allows me to click through the GUI but I don't see what is allowing me to do so. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI = GUICreate("My GUI", @DesktopWidth, @DesktopHeight, Default, Default, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_LAYERED + $WS_EX_TRANSPARENT) $iPic = GUICtrlCreatePic("c:\test.jpg", 0, 0, @DesktopWidth, @DesktopHeight) WinSetTrans($GUI, "", 120) GUISetState(@SW_SHOWNA, $GUI) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I am guessing it is $WS_EX_LAYERED? Link to comment Share on other sites More sharing options...
smashly Posted September 24, 2009 Share Posted September 24, 2009 (edited) Excellent I would of never thought about GDI because I know nothing about it Thanks Very Much Hi,You don't need to use GDI+, I only used it because I didn't feel like guessing if you had a picture on your pc I could load..Without a picture the gui is not visible..You can use any picture and get rid of the GDI+ function alltogether.eg; $iPic = GUICtrlCreatePic("C:\PathToMy\pic.jpg", 0, 0, $iW, $iH)Then just remove the _CreateColorPic($iPic, $iW, $iH, 0xFF00FFAA) and _CreateColorPic() function completely.CheersEdit: $WS_EX_TRANSPARENT is what allows you to click through the gui... Edited September 24, 2009 by smashly Link to comment Share on other sites More sharing options...
CodyBarrett Posted September 24, 2009 Share Posted September 24, 2009 #include <GUICONSTANTS.AU3> #include <WINDOWSCONSTANTS.AU3> Opt ('GUIoneventmode', 1) $GUIStyle = BitOR($WS_DLGFRAME,$WS_POPUP, $WS_VISIBLE) $GUIStyleEx = BitOR ($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE,$WS_EX_TRANSPARENT ) $W = 0xFFFFFF $B = 0x0 $Titleb = 0x7F7F7F $GUI = GUICreate (@ScriptName, 300, 300, -1, -1,$GUIStyle ,$GUIStyleEx) GUISetBkColor ($B, $GUI) GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit', $GUI) GUISetState (@SW_MAXIMIZE, $GUI) WinSetTrans ($GUI,'',100) While 1 Sleep (100) WEnd Func _Exit () Exit EndFunc this works for me... $WS_VISIBLE and Winsettrans () shows the GUI... having a Pic doesn't really matter [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...
smashly Posted September 24, 2009 Share Posted September 24, 2009 (edited) Hi, $WS_VISIBLE isn't needed either..#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Misc.au3> Opt("MustDeclareVars", 1) Example1() ; example 1 Func Example1() Local $hGui $hGui = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOr($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_TRANSPARENT)) GUISetBkColor(0x010101, $hGui) WinSetTrans($hGui, "", 120) GUISetState(@SW_SHOWNA, $hGui) Do Sleep(10) Until _IsPressed("1B") ;Esc to exit EndFunc ;==>Example1 Cheers Edited September 24, 2009 by smashly Link to comment Share on other sites More sharing options...
CodyBarrett Posted September 24, 2009 Share Posted September 24, 2009 i guess it isn't :\ .... well i always couple Popup with Visible... but you ARE right [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