WhiteAvenger Posted March 26, 2009 Share Posted March 26, 2009 Hi, I'm using the following code to display information on my screen: Func SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc ;==>SetWindowRgn Func CreateTextRgn(ByRef $CTR_hwnd, $CTR_Text, $CTR_height, $CTR_font = "Microsoft Sans Serif", $CTR_weight = 1000) Local Const $ANSI_CHARSET = 0 Local Const $OUT_CHARACTER_PRECIS = 2 Local Const $CLIP_DEFAULT_PRECIS = 0 Local Const $PROOF_QUALITY = 2 Local Const $FIXED_PITCH = 1 Local Const $RGN_XOR = 3 If $CTR_font = "" Then $CTR_font = "Microsoft Sans Serif" If $CTR_weight = -1 Then $CTR_weight = 1000 Local $gdi_dll = DllOpen("gdi32.dll") Local $CTR_hDC = DllCall("user32.dll", "int", "GetDC", "hwnd", $CTR_hwnd) Local $CTR_hMyFont = DllCall($gdi_dll, "hwnd", "CreateFont", "int", $CTR_height, "int", 0, "int", 0, "int", 0, _ "int", $CTR_weight, "int", 0, "int", 0, "int", 0, "int", $ANSI_CHARSET, "int", $OUT_CHARACTER_PRECIS, _ "int", $CLIP_DEFAULT_PRECIS, "int", $PROOF_QUALITY, "int", $FIXED_PITCH, "str", $CTR_font) Local $CTR_hOldFont = DllCall($gdi_dll, "hwnd", "SelectObject", "int", $CTR_hDC[0], "hwnd", $CTR_hMyFont[0]) DllCall($gdi_dll, "int", "BeginPath", "int", $CTR_hDC[0]) DllCall($gdi_dll, "int", "TextOut", "int", $CTR_hDC[0], "int", 0, "int", 0, "str", $CTR_Text, "int", StringLen($CTR_Text)) DllCall($gdi_dll, "int", "EndPath", "int", $CTR_hDC[0]) Local $CTR_hRgn1 = DllCall($gdi_dll, "hwnd", "PathToRegion", "int", $CTR_hDC[0]) Local $CTR_rc = DllStructCreate("int;int;int;int") DllCall($gdi_dll, "int", "GetRgnBox", "hwnd", $CTR_hRgn1[0], "ptr", DllStructGetPtr($CTR_rc)) Local $CTR_hRgn2 = DllCall($gdi_dll, "hwnd", "CreateRectRgnIndirect", "ptr", DllStructGetPtr($CTR_rc)) DllCall($gdi_dll, "int", "CombineRgn", "hwnd", $CTR_hRgn2[0], "hwnd", $CTR_hRgn2[0], "hwnd", $CTR_hRgn1[0], "int", $RGN_XOR) DllCall($gdi_dll, "int", "DeleteObject", "hwnd", $CTR_hRgn1[0]) DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $CTR_hwnd, "int", $CTR_hDC[0]) DllCall($gdi_dll, "int", "SelectObject", "int", $CTR_hDC[0], "hwnd", $CTR_hOldFont[0]) DllClose($gdi_dll) Return $CTR_hRgn2[0] EndFunc ;==>CreateTextRgnoÝ÷ ØazwV®¶sduT7&VFRgV÷C´æfòfVÆBgV÷C²ÂcÂÂFW6·F÷vGFò"Ò33ÂFW6·F÷VvBÒSÂb33cµu5õõUÂ&Dõ"b33cµu5ôUõDõÔõ5BÂb33cµu5ôUõDôôÅtäDõr¤uT6WD&´6öÆ÷"dc¤uT6WE7FFR5uõ4õr¢b33c·&vâÒ7&VFUFWE&vâb33c¶væBÂb33c·7G"ÂÂgV÷C´&ÂgV÷C²Â¥6WEvæF÷u&vâb33c¶væBÂb33c·&vâ to display the information in $str. This works fine in prinicple, the information is displayed correctly, but the overlay steals focus when it appears, i.e. it makes itself the active window. This is very irritating when watching fullscreen movies or playing games, as these then leave fullscreen. Is it somehow possible to show this GUI on top of all other windows without it being active, i.e. without it stealing focus? Thanks, --WhiteAvenger Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 26, 2009 Moderators Share Posted March 26, 2009 WhiteAvenger,Try using GUISetState(@SW_SHOWNOACTIVATE). It stops the GUI grabbing the focus and might work, although I have never tried it over full-screen movies/games. I have a horrible feeling that it is not going to do the trick - but give it try and let us all know how it works.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
WhiteAvenger Posted March 26, 2009 Author Share Posted March 26, 2009 Tried it. When I'm not in a Full Screen App, it works fine and is on top, but in Full Screen, it just doesn't show. I guess that's a slight improvement, although I'd like it to be on top of Full Screen Stuff... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 26, 2009 Moderators Share Posted March 26, 2009 WhiteAvenger, I am not an expert in these matters by any means, but I am fairly certian that when an application is shown full screen it is impossible to get any other GUI on the screen at the same time (unless the running app puts it there of course). That is why I was pretty pessimistic about the chances of success earlier. Sorry I cannot help more. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
WhiteAvenger Posted March 26, 2009 Author Share Posted March 26, 2009 It's impossible only when it's a DirectX application in the foreground, afaik. For example, the GUI goes on top of VLC Media Player, but it's not shown when the BBC iPlayer is full screen. 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