|
|||
|
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? |
|
|||
|
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!! |
|
|||
|
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);
}
}
}
|
|
|||
|
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 |
|
|||
|
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 |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|