Aqua-Soft Forums: Flowswitch - I Need Help To Finish This - Aqua-Soft Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Flowswitch - I Need Help To Finish This Rate Topic: -----

#1 User is offline   vhanla Icon

  • Group: Member
  • Posts: 48
  • Joined: 15-June 08

Posted 19 February 2009 - 02:59 PM

Posted Image
FlowSwitch


Hi, this is what I'm trying to do, it's a Flow Taskbar and I also want to make it an ALT+TAB replacement.

What I did so far is (in Delphi 7)...
- I used CoverFrame unit from Sean Cross for CoverFlow effect
- I just Enumerated the Windows and filtered for chosing the Taskbar applications only, but some can't be winprinted (PrintWindow)
- Set a global hotkey for ALT+TAB, however I cannot figure out how to detect ALT keyup in order to switch to the selected task
- It flows with Alt+tab and Scrollwheel
- With a click I switch to the selected task
- It closes when focus is lost
- I can't find a way to hide it from taskbar at starting (after YES but I need it not to show in the taskbar)

At the moment it can be used as pseudo plugin for any Dock by launching the application :D

In the beginning I wanted to make it a plugin for XWindowsDock. However, it seems it will consume 20MB or more apart of the XWD and plugins existing.

Basically I need a guide about the correct way to PrintWindow applications (preferably not repeating windows) and AltTab procedure, and some suggestions :P.

You can download it HERE what I did so far, hope you like it...

Moved to a more appropriate area where some of the developers come and go - Thanks - mps69

This post has been edited by vhanla: 20 February 2009 - 04:01 PM
Reason for edit: moved

0

#2 User is offline   skdj Icon

  • Group: Member
  • Posts: 152
  • Joined: 01-October 08

Post icon  Posted 19 February 2009 - 03:22 PM

Wow men!

I certainly can't help you with coding or something, but you can bet that im downloading it right now and givin´u my feedback ASAP....

Let´s see....

Well...
So far, it´s not bad at all!
It will be kinda handy when you finish it; nice and smooth transitions; I know this is not finished yet, but, it will be nice if you can add a transition when you reach the window you wanna see,hope you get me....

Ok men, at the end this looks very promising, hope the other developers there can give you a hand with the things you need....

Greetings!
0

#3 User is offline   matonga Icon

  • Group: Developers
  • Posts: 1,286
  • Joined: 04-September 06

Posted 19 February 2009 - 03:57 PM

- Set a global hotkey for ALT+TAB, however I cannot figure out how to detect ALT keyup in order to switch to the selected task

To detect if Alt key is up:

function IsAltKeyUp : Boolean;
begin
	// I don't have Delphi here, maybe it is GetKeyAsycnState... search Win API
	Result := (GetAsyncKeyState (VK_LALT) And $8000) = 0;
end;


- I can't find a way to hide it from taskbar at starting (after YES but I need it not to show in the taskbar)

There are some alternatives...

One is to put this into FormCreate event of main form: Application.ShowMainForm := False;

Another one is:

SetWindowLong (Application.Handle, GWL_EXSTYLE, (GetWindowLong (Application.Handle, GWL_EXSTYLE) And Not WS_EX_APPWINDOW) Or WS_EX_TOOLWINDOW);

I highly recommend the first one (ShowMainForm).

-

At least to my knowledge, there is not a "correct" way to PrintWindow applications. You can print windows in the background, with a Timer or similar, only one window at each TTimer.Timer event, scheduling older non-printed windows first (this is what I want to implement for WinExpose 2, if I ever write it).

Also you have the problem of frozen apps, which will in turn freeze you if you try to PrintWindow them.

There are two measures you can take to avoid this: (I'd recommend you use both)

1. TaskSwitchXP sends a message to the window, via SendMessageTimeout (the message must not cause any effect on app, for e.g. WM_GETICON is a good choice... remember to destroy the icons if the function succeeds!).

2. Launch a separate process (not a thread, but a process), receiving the window handle as parameter, and returning the screenshot to your app via SendMessage (WM_COPYDATA, ...). If your app finds the process doesn't return screenshot after 2 seconds of launching it, you can suppose it tried to screenshot a frozen app, and use TerminateProcess to kill the window printer process (and take note not to PrintWindow such app again for a while).
0

#4 User is offline   vhanla Icon

  • Group: Member
  • Posts: 48
  • Joined: 15-June 08

Post icon  Posted 19 February 2009 - 07:22 PM

Thanks a lot Matonga, I'll be researching more.

[20]
Ok, I managed to set global hotkeys for Windows XP only, and also used SendMessageTimeOut as you suggested. I tested with Free Extended Taks Manager which I used to freeze one running application and it works :D

I'm currently (happily) using Alt+Tab in WinXP. However, there seems that in Windows Vista/7 it doesn't work the Alt+Tab (Alt+Shift+Tab /Alt+Esc).
I'm using :
RegisterHotKey(Self.Handle,GlobalAddAtom('ALT_TAB'),MOD_ALT,VK_TAB);
RegisterHotKey(Self.Handle,GlobalAddAtom('ALT_SHIFT_TAB'),MOD_ALT+MOD_SHIFT,VK_TAB);
RegisterHotKey(Self.Handle,GlobalAddAtom('ALT_ESC'),MOD_ALT,$01b);

Hope there is a better way to do it. I don't know how to set the Global HotKey for Vista/7.

And also I can't find a good way to hide the program when lost focus. I'm using:
	procedure WMNCACTIVATE(var M: TWMNCACTIVATE); message WM_NCACTIVATE;

However, by doing form1.hide it Shows a warning message about violating OnShow and OnHide events.
I thought on activating a timer to hide after a 100/1000 second or less. But, hopefully there would be a better way :D

Anyone interested in trying and testing (suggesting too) can download from the first entry. It's still in its basic form.

Changelog:
- Some fixes done :o
- Alt+Tab switching barely works.
- Only one instance and if you launch the executable again, it will show the window instead. So you will be able to use it with any Dock.

This is how can I use this :P
Posted Image

This post has been edited by vhanla: 20 February 2009 - 03:58 PM

0

#5 User is offline   djwilliams Icon

  • Group: Member
  • Posts: 277
  • Joined: 15-February 05

Posted 21 February 2009 - 06:59 PM

I think get rid of the black background or at least make it translucent around 60%. Kinda like Vista's Flip3D.
0

#6 User is offline   matonga Icon

  • Group: Developers
  • Posts: 1,286
  • Joined: 04-September 06

Posted 21 February 2009 - 08:00 PM

View Postvhanla, on Feb 19th 2009, 04:22 PM, said:

And also I can't find a good way to hide the program when lost focus. I'm using:
	procedure WMNCACTIVATE(var M: TWMNCACTIVATE); message WM_NCACTIVATE;

However, by doing form1.hide it Shows a warning message about violating OnShow and OnHide events.
I thought on activating a timer to hide after a 100/1000 second or less. But, hopefully there would be a better way :D


I capture the WM_APPACTIVATE message, but maybe WM_NCACTIVATE works better for you. But this is not the solution.

The problem is: when you hide your window via form1.hide (because the user released the VK_LALT key), your window then deactivates and you try to form1.hide it again. Maybe adding this to WM_NCACTIVATE would work:

If Visible Then Hide;


So it shouldn't put an event violation in the way.

Maybe you'll have to use ShowWindow (form1.Handle, SW_SHOW {SW_HIDE} );
0

#7 User is offline   tengshj Icon

  • Group: Member
  • Posts: 108
  • Joined: 12-June 06

Posted 23 February 2009 - 02:41 AM

View Postdjwilliams, on Feb 21st 2009, 07:59 PM, said:

I think get rid of the black background or at least make it translucent around 60%. Kinda like Vista's Flip3D.

Second that.
another suggestion: can minimized windows also be displayed instead of only a title bar.

This post has been edited by tengshj: 23 February 2009 - 02:42 AM

0

#8 User is offline   vhanla Icon

  • Group: Member
  • Posts: 48
  • Joined: 15-June 08

Posted 25 February 2009 - 01:58 AM

Actually I'm kinda newbie at this. I just did a mashup.
And I don't know if it's possible to make an OpenGL window translucent.

View Posttengshj, on Feb 22nd 2009, 10:41 PM, said:

Second that.
another suggestion: can minimized windows also be displayed instead of only a title bar.


On the other hand. I was trying to restore a window before taking the snapshot and restoring (minimizing again) after that.
It works, but in some way it interferes with correct switching to a selected window.
var
  ... {snaphost related e.g. BMP }
  Placement: TWindowPlacement;
begin
  Placement.length := SizeOf(TWindowPlacement);
  GetWindowPlacement(H, @Placement);
  if Placement.showCmd = SW_SHOWMINIMIZED then
  begin
   Placement.ShowCmd:=SW_ShowNormal;
   SetWindowPlacement(H,@Placement);
   {i take the snapshot after it i minimize again}
   PrintWindow(the window handle,bmp);
   Placement.ShowCmd:=SW_ShowMinimized;
   SetWindowPlacement(H,@Placement);
  end
  else PrintWindow(the window handle, a bmp );


is it better to use SendMessage(wnd, WM_SYSCOMMAND, SC_RESTORE, 0) and SendMessage(wnd, WM_SYSCOMMAND, SC_MINIMIZE, 0) instead? Maybe I should use SendMessageTimeOut then...

I was also noticing that using OpenGL shows a flickering while I use XWindows Dock, but with RKLauncher, YzDock that doesn't happen. Is it because of OpenGL or just GLScene, which is what I'm using?.

Hopefully somebody would help. Thanks by advance.
0

#9 User is offline   matonga Icon

  • Group: Developers
  • Posts: 1,286
  • Joined: 04-September 06

Posted 25 February 2009 - 03:21 AM

View Postvhanla, on Feb 24th 2009, 10:58 PM, said:

And I don't know if it's possible to make an OpenGL window translucent.

I was also noticing that using OpenGL shows a flickering while I use XWindows Dock, but with RKLauncher, YzDock that doesn't happen. Is it because of OpenGL or just GLScene, which is what I'm using?.


Flicker: I have that problem with RocketDock and OpenGL apps. Not sure if it is specific to XWD and RD but it surprises you tell YD and RKL doesn't have it... I haven't tried that.

For both flicker and translucency a solution would be to use pixel buffers instead of rendering to screen, then put the pixels into a bitmap and use UpdateLayeredWindow stuff.

The only problem is it would require a high end video board like ATI or nVidia no-more-than-about-two-year-old cards.
0

#10 User is offline   vhanla Icon

  • Group: Member
  • Posts: 48
  • Joined: 15-June 08

Posted 26 February 2009 - 01:57 AM

Yeah, I've been reading about buffering, but it would be slower...

I definitely discarded the idea of using translucency, because I also tested with Lazarus GLScene's version and it flickers a lot while animating, unless I use buffering and painting on canvas (mmm I will test that).

Flicker: I meant that XWD makes my program to flicker (mostly the bottom part), and YD and RKL don't, but they do flicker instead (in their own areas).
In fact it is because of GLScene for Delphi. I also tested with Lazarus+GLScene, and that issue doesn't occur with XWD.

Changes:
- Full screen, or almost
- Background uses current wallpaper (stretched mode only) and updates if it's changed
- TrayIcon added with the following PopuMenu:
* Enable Alt+Tab (XP Only) - I couldn't find a way to registerhotkey on Vista/7
* Call with F9
* Hot Spots (check locations)
* Save Changes - to Config.ini
* Acerca de... (About)
* Exit (the most important part while it's in beta)


Currently it has this look:
Posted Image

Download updated (refer first entry)

This post has been edited by vhanla: 26 February 2009 - 06:35 PM

0

#11 User is offline   technosinner Icon

  • Group: Member
  • Posts: 122
  • Joined: 14-February 06

Posted 07 March 2009 - 10:47 PM

Real nice idea for an app vhanla!

Unfortunately I tried it and it seems it has 0 support for multi monitors... I know it's still in development but I figured you might want to know ;)
0

#12 User is offline   Ghostwalker Icon

  • Group: Member
  • Posts: 1,990
  • Joined: 05-March 03

Posted 08 March 2009 - 12:47 AM

Wow it's getting there. I agree on multi Monitors and it displays firefox download window but not firefox.
0

#13 User is offline   holo13x Icon

  • Group: Member
  • Posts: 169
  • Joined: 24-April 08

Posted 08 March 2009 - 02:37 AM

man, keep the good work,1 bug, when I use the corners it freezes because the corner is used by a dock, and again keep the good work.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic