Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Overlay image on program


  • Please log in to reply
16 replies to this topic
Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
Hi bs2,

I think maybe you need parental supervision with your project. "Set_parent" that is :wink:

I found this code in the forum and tweaked it so that the 'cover' object can't be move by the user and I changed the background color.

You can remove the text line and change the color as desired.
You can size and position the window as desired. If the window that you want to obscure is moved this will follow.
If the window size is changed, you'll have to deal with that.

;http://www.autohotkey.com/forum/topic8906.html

title1=Welcome to Tabbed Browsing

; e.g. run an internet explorer window and go to the page: "about:blank" so that is the start of the title text
;   then run this script and it adds a gui window onto the internet explorer window.
; Some programs, such as notepad and calculator, don't seem to work properly with this technique.

Gui, 7: Margin, 0, 0 

Gui, 7: Color, red

Gui, 7: +Disabled +NoActivate +NA -SysMenu +border -Caption 
Gui, 7: +ToolWindow ; -Caption ; no title, no taskbar icon
Gui, 7: Add, Text,, This gui is stuck to the parent... `nbut I haven't programmed it to do anything `;-)



Set_Parent_by_title(title1, 7) ; can be done before or after showing the gui
;Set_Parent_by_title("about:Tabs", 7) ; can be done before or after showing the gui
Gui, 7: Show, x100 y100 w100 h100
Return



/*
or to use the window id of the parent instead of the title:

Set_Parent_by_id(Window_ID, Gui_Number) ; title text is the start of the title of the window, gui number is e.g. 99
{
  Gui, %Gui_Number%: +LastFound
  Return DllCall("SetParent", "uint", WinExist(), "uint", Window_ID) ; success = handle to previous parent, failure =null
}
*/



Set_Parent_by_title(Window_Title_Text, Gui_Number) ; title text is the start of the title of the window, gui number is e.g. 99
{
  WinGetTitle, Window_Title_Text_Complete, %Window_Title_Text%
  Parent_Handle := DllCall( "FindWindowEx", "uint",0, "uint",0, "uint",0, "str", Window_Title_Text_Complete)
  Gui, %Gui_Number%: +LastFound
  Return DllCall( "SetParent", "uint", WinExist(), "uint", Parent_Handle ) ; success = handle to previous parent, failure =null
}



/*
or to use the class instead of the title:

Set_Parent_by_class(Window_Class, Gui_Number) ; class e.g. Shell_TrayWnd, gui number is e.g. 99
{
  Parent_Handle := DllCall( "FindWindowEx", "uint",0, "uint",0, "str", Window_Class, "uint",0)
  Gui, %Gui_Number%: +LastFound
  Return DllCall( "SetParent", "uint", WinExist(), "uint", Parent_Handle ) ; success = handle to previous parent, failure =null
}
*/


bs2
  • Members
  • 9 posts
  • Last active: May 10 2010 04:43 PM
  • Joined: 22 Mar 2010
Hi Leef_me,

thanks for the interesting example. Works beautifully on most apps I tried. But not on this app. On this one, it just flickers on for maybe 0.1 seconds, then disappears. Tried with title and id example.

BitBlt example however works, but I'll need to implement some hooks I guess, which I'm still studying. Any pointers appreciated.