topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday March 18, 2024, 11:03 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: IDEA: WinCovers  (Read 55558 times)

Uncle John

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 38
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #25 on: August 25, 2006, 05:01 PM »
Yikes. It just occurred to me that I might be infringing copyright by implementing this WinCovers idea.

Anyone thought about this issue b4?

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
    • View Profile
    • Just Plain Super
    • Read more about this member.
    • Donate to Member
Re: IDEA: WinCovers
« Reply #26 on: September 11, 2006, 04:49 PM »
If you are wanting to temp disable the stuff (just that one use) then you can use a program called showin, it lets you disable, or remove tons of stuff, but just that one time, when you close than reopen the prog they are back
[Insert really cool signature here]

Uncle John

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 38
    • View Profile
    • Donate to Member
IDEA: WinCover
« Reply #27 on: September 15, 2006, 01:54 AM »
Are you refering to ShoWin? http://www.foundstone.com/index.htm?subnav=resources/navigation.htm&subcontent=/resources/proddesc/showin.htm

Haven't tried it but the description seems to indicate that in uncovers stuff rather than covering it.

Anyway I've had a bash at programing a solution. See attachments...

My solution uses the the TransColor command. Silver pixels in the "Trigonometry Calculator" window are transparant and reveal only the desired features in the Calculator below.

But there are a few problems.....
1. How do I ensure the Calculator starts Scientific mode?
2. How do ensure that the "Trigonometry Calculator" (TC) is always directly above the Calculator and when the TC is moved the Calculator is also moved and stays directly below.
3. How do I prevent users turning off the Calculator (ie. by right clicking it's icon on the task bar)?
4. How do I close the TC and the Calculator Simulataneously?

I'll have a go at tackling these issues over the next few days but I wouldn't mind some suggestions.

Uncle John

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 38
    • View Profile
    • Donate to Member
Re: IDEA: WinCover (was WinCovers)
« Reply #28 on: September 16, 2006, 06:30 AM »
Attached is the latest version.

Now there are three problems remaining to be solved.....
1. How do I ensure the Calculator starts Scientific mode?
2. How do I ensure that the "Trigonometry Calculator" (TC) is always directly above the Calculator and when the TC is moved the Calculator is also moved and stays directly below?
3. How do I prevent users turning off the Calculator (ie. by right clicking it's icon on the task bar)?

brett

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 125
  • Australia
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #29 on: September 16, 2006, 07:24 AM »
Hi John

I have not had a chance to read your latest script, will do so soon.

But after your post on the 15th , I thought I would have a stab.

This is just a 1st attempt using only the Calculator to see if we are on the right track,
I have not decided the layout for saving to different windows, or if and how settings are saved to a ini.
So calculator will be the test for now.

The limitations
- with AHK splashimage is that you have only ten covers to work with . but it seems very effective.
- to destroy the wincovers when a different window is active, I minimized the Calculator window to the taskbar.
- it does not stop Shortcut Keys.

Screenshot - 16_09_2006 , 10_06_42 PM.png

FYI. I've talked about this idea with a lot of programmers in the past and they all say it can't be done.
Luckily I have never spoke to a programmer, so this does not apply to me.  :)
(Todays learning for dB, AHK splashimage)

Thanks
Feedback welcome
dB
doublebogey




Uncle John

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 38
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #30 on: September 16, 2006, 08:07 AM »
Hi doublebogey,

Thanks for educating me about Splashimage etc. It's a much easier way of doing things.

Had a good laugh about the message to the Principal etc. ;D


Uncle John

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 38
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #31 on: September 19, 2006, 05:25 AM »
Hi Db,

Making the following change switches off SplashImages when no Windows are active:

If Title=                                               ;If title is blank,. then
    {
      Return                                            ;return, do nothing
    }

changed to

If Title=                                                ;If title is blank,. then
    {
      SplashImage 1:Off                                  ;Turn off Wincover 1   
      SplashImage 2:off
      SplashImage 3:off
      Return                                             ;return
    }

However restoring another minimized window terminates the script leaving the Calculator running without covering SplashImages when the Calculator is again restored.

This problem still needs to be solved.

Cheers.
« Last Edit: September 19, 2006, 04:54 PM by Uncle John »

brett

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 125
  • Australia
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #32 on: September 20, 2006, 01:40 AM »
on the road for a couple for days, be back soon

dB

Uncle John

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 38
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #33 on: September 20, 2006, 02:45 AM »
Another approach...
From what I've been told the code can be simplified by making each SplashImage the child of the Calculator Window through the use of the  "ControlGet Hwnd" command and the DllCall("SetParent"...) function call.

Not sure how to go about this. Any volunteers?

Uncle John

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 38
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #34 on: September 20, 2006, 07:13 PM »
Cover.bmp is a grey rectangle W230 H170:

Run, %SystemRoot%\System32\calc.exe
WinWaitActive, Calculator
ControlGet, hWndNewParent, Hwnd,,, Calculator
WinGetPos, X, Y,,, Calculator
x:=X+55
y:=Y+140
SplashImage, cover.bmp, B X%x% Y%y%
ControlGet, hWndChild, Hwnd,,, SplashImage
DllCall("SetParent", hWndChild, hWndNewParent)
Sleep, 10000
SplashImage, Off

I'm try to get the SplashImage to move with Calculator when I drag Calculator.

What did I do wrong?
« Last Edit: October 15, 2006, 06:33 AM by Uncle John »

Uncle John

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 38
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #35 on: October 16, 2006, 04:08 PM »
I couldn't get the SetParent based solution to work.
Nor could I get the "timingloop" based solution, where the Calculator is minimised when another window becomes active, to work satisfactorily.
One reasons I'm not satisfied is that having the script minimise the window then puts it under the control of the task bar button Calculator icon. Then if you press the Calculator icon the script locks up and Calculator stays minimized.
Another reason I'd prefer to explore a different solution is aesthetic. It's impossible to remove the jerkiness from the cover movement when the Calculator is dragged.

The approach I exploring now avoids the Calculator window being de-activated or moved by:
- Closing all windows b4 starting the Calculator script, 
- Hiding the Task Bar,
- Removing the Calculator Menu Bar,
- Placing an Splashimage over the Title Bar.

Here is the code. As you can see the "close all windows" part has been commented out for convenience while I'm trying to fix/develop other parts of the script:

#SingleInstance Force
#NoEnv
SetBatchLines -1
#Persistent

/*WinGet, id, list, , , Program Manager ; Close all windows
Loop, %id%
{
   StringTrimRight, this_id, id%a_index%, 0
   WinGetTitle, this_title, ahk_id %this_id%
   winclose,%this_title%
}
*/
WinHide ahk_class Shell_TrayWnd
Run calc.exe, , , PID
WinWait ahk_pid %PID%
DllCall("SetMenu", uint, WinExist(), uint, 0)  ; Remove menu bar of "last found window".
WinMove, ahk_pid %PID%,,0, 0 ; Move the Calculator window to the top left corner.
SplashImage, , B w455 h30 x0 y0 CWBlue, , , SICalcCover
;WinSet.... 
;SplashImage, , B w175 h165 x55 y125 CWSilver, , , SICalcCover
SetTimer Follow, 100
Follow:
IfWinNotExist ahk_pid %PID%
{
Winshow ahk_class Shell_TrayWnd
ExitApp   ; Calc has been closed
}
Return

I'm trying to work out how I can make a transparent hole over the Calculator Close button because you can still drag by clicking on the right hand edge of the title bar. Does anyone know how to make a hole in a SplashImage?

I'm also trying to get multiple SplashImages working. Only the title bar cover works at the moment. Doublebogey are you there? Do you have any suggestions on this?
« Last Edit: October 16, 2006, 04:10 PM by Uncle John »

brett

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 125
  • Australia
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #36 on: October 17, 2006, 02:37 AM »
I have not forgotten.
Just keep running into dead ends myself with each path I try.

dB
doublebogey

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: WinCovers
« Reply #37 on: December 16, 2006, 06:27 PM »
 :) I don't know if you still need this one...

UnderCover - Automatically hide a window's buttons and other controls.

Features:
- Ctrl-Rightclick to hide a control
- Change settings using Settings in the tray menu

The hidden controls are saved to an ini file, so whenever a new window of the same class is run, it automatically loses it's controls.



You'll find the downloads and more info at 1 Hour Software by Skrommel.

Skrommel

Uncle John

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 38
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #38 on: December 21, 2006, 04:15 PM »
Hi Skrommel,

Wow :)

Thanks for this. It is certainIy very useful to me and I suspect many others will find it useful too. :Thmbsup: 

Back on June 3 you mentioned that your script would work on all Windows default controls. I'm starting to appreciate the extent of those controls.

I'm still a pretty raw newbie so it'll take me a while to analyse your script and understand all it's implications. I really appreciate your having shared it with us.

Thanks and season's greetings to you and your family.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: WinCovers
« Reply #39 on: December 21, 2006, 06:48 PM »
 :) So it's better late than never, then? Merry Christmas to you, too!

Skrommel

Uncle John

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 38
    • View Profile
    • Donate to Member
Re: IDEA: WinCovers
« Reply #40 on: December 21, 2006, 09:41 PM »
Maybe even better late than early. As you can see from the above posts the delay has given me some time to learn a little more about Autohotkey and the Win32 API etc. :D

Thanks again.