Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-04-2007, 08:35 AM
Junior Member
 
Join Date: Jun 2007
Posts: 3
Default Bring application in front of the taskbar

Hello all,
I have an e-zine centered in the middle of the screen. I want my application to appear in front of the taskbar but I don't want to use the 'always on top' command. I don't have a minimize button in my movie and I believe it's a little bit stressing to have an application on the screen that cannot be sent to the back of other applications.
Can you please help me with this problem?
Reply With Quote
  #2 (permalink)  
Old 06-04-2007, 09:02 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Bring application in front of the taskbar

I am not quite clear about your problem, could you please give me more details? Thank you.
Reply With Quote
  #3 (permalink)  
Old 06-04-2007, 09:34 AM
Junior Member
 
Join Date: Jun 2007
Posts: 3
Default Re:Bring application in front of the taskbar

Hello,
Thank you for answering me so quickly! Now the problem:
I made a presentation in flash that has the size of 1024x768pixels. I'm working on a 21' monitor with a resolution of 1600x1200 pixels. I've tested the application and everything looked fine. But on a monitor with a lower resolution my application appears behind the taskbar. I've searched in the operation panel and I found the property always on top. I marked it, tested the application and it appeared in the front of the taskbar which is ok. But now I have another problem. I can't open other windows in front of my application.
I actually want my application in front of the taskbar but not always on top.
Tkanks again!!
Reply With Quote
  #4 (permalink)  
Old 06-04-2007, 11:31 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Bring application in front of the taskbar

Generally, the task bar is always on top. Therefore, if you want to place your program on top of the task bar, you will have to set your program to be on the top most. However, to not always cover other windows, you can set your program to be on the top most only if it is activated. That can be done by insert the following code into the "initialize" script of swfkit pro, before the line "return true;".

Code:
dllimport "user32.dll" stdcall long SetWindowPos(long, long, int, int, int, int, unsigned int);
dllimport "user32.dll" stdcall long GetForegroundWindow();

var wnd = getMainWnd();
var SWP_NOSIZE = 0x0001;
var SWP_NOMOVE = 0x0002;
var SWP_SHOWWINDOW = 0x0040;
wnd.onMessage = function (msg, wparam, lparam) {
if (msg == /*WM_ACTIVATEAPP*/0x001C || msg == /*WM_ACTIVATE*/0x0006) {
var bActivate;
if (msg == /*WM_ACTIVATEAPP*/0x001C) {
bActivate = wparam;
} else {
bActivate = wparam & 0xFFFF;
}

if (bActivate) {
Application.Behaviour.bAlwaysOnTop = true;
} else {
Application.Behaviour.bAlwaysOnTop = false;
SetWindowPos(wnd.handle, GetForegroundWindow(), 0, 0, 0, 0, 
SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
}
}
}
Reply With Quote
  #5 (permalink)  
Old 06-04-2007, 11:47 AM
Junior Member
 
Join Date: Jun 2007
Posts: 3
Default Re:Bring application in front of the taskbar

Thank's a lot!!!
I've tested it and works very fine! ;D
Reply With Quote
  #6 (permalink)  
Old 06-14-2007, 10:24 AM
Member
 
Join Date: May 2007
Posts: 53
Default Re:Bring application in front of the taskbar

I found some additional flag to use - 0x0004 -- SWP_NOZORDER. If this flag is not set, one can ckick on your_app, then on the task manager window, then on some another window, intersecting with your_app window.. and the third window will stay behind swfkit_app. So, the code i use here:
Code:
user32_SetWindowPos(__wnd.handle, GetForegroundWindow(), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOZORDER)
.
gl ;-)
__________________
#define true false //happy debugging, friends
Reply With Quote
  #7 (permalink)  
Old 06-22-2007, 08:33 AM
Member
 
Join Date: May 2007
Posts: 53
Default Re:Bring application in front of the taskbar

The practice showed, the scheme with "Application.Behaviour.bAlwaysOnTop" using is unstable. Bugs with window's z-order. So i consider the following code as optimal solution for both situations (one want window to be alwaysOnTop or not).
Code:
function setAlwaysOnTop(flag) {
Application.Behaviour.bAlwaysOnTop = flag;
SWP_NOZORDER = (flag)?0:0x0004;
}
function setAlwaysOnTop(false);

__wnd.onMessage = function (msg, wparam, lparam) {   
   if (msg == /*WM_ACTIVATEAPP*/0x001C || msg == /*WM_ACTIVATE*/0x0006) {   
      var bActivate;
      if (msg == /*WM_ACTIVATEAPP*/0x001C) {
         bActivate = wparam;
      } else {
         bActivate = wparam & 0xFFFF;
      }
      
      if (bActivate) {
         user32_SetWindowPos(__wnd.handle, -1, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOZORDER);
      } else {
         user32_SetWindowPos(__wnd.handle, -1, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOZORDER);
      }   
   }
}
user32_SetWindowPos(__wnd.handle, GetForegroundWindow(), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOZORDER);
__________________
#define true false //happy debugging, friends
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:21 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.