Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-17-2006, 11:10 PM
Junior Member
 
Join Date: Aug 2006
Posts: 3
Default Dockable windows?

Is it possible to make a SWF->EXE application that docks on any side of the screen using SWFkit?
Reply With Quote
  #2 (permalink)  
Old 08-18-2006, 03:26 AM
Junior Member
 
Join Date: Aug 2006
Posts: 3
Default Re:Dockable windows?

This is parsing without error and running, but the call:

SHAppBarMessage(ABM_NEW, abd)

is returning false so my window isn't docking. anyone know why?



//-------------------------------------------------------------
// windows API struct defitions, constants and function imports
//-------------------------------------------------------------
var ABM_NEW = 0;
var ABM_REMOVE = 1;
var ABM_QUERYPOS = 2;
var ABM_SETPOS = 3;
var ABM_GETSTATE = 4;
var ABM_GETTASKBARPOS = 5;
var ABM_ACTIVATE = 6;
var ABM_GETAUTOHIDEBAR = 7;
var ABM_SETAUTOHIDEBAR = 8;
var ABM_WINDOWPOSCHANGED = 9;
var ABM_SETSTATE = 10;

var ABN_STATECHANGE = 0;
var ABN_POSCHANGED = 1;
var ABN_FULLSCREENAPP = 2;
var ABN_WINDOWARRANGE = 3;

var ABE_LEFT = 0;
var ABE_TOP = 1;
var ABE_RIGHT = 2;
var ABE_BOTTOM = 3;

struct
{
long left;
long top;
long right;
long bottom;
} Rect;

struct
{
long cbSize;
long* hWnd;
unsigned int uCallbackMessage;
unsigned int uEdge;
Rect rc;
long* lParam;
} AppBarData;

dllimport "shell32.dll" stdcall unsigned int* SHAppBarMessage(long, AppBarData*);
dllimport "user32.dll" stdcall Boolean MoveWindow(int*, int, int, int, int, Boolean);
dllimport "user32.dll" stdcall long RegisterWindowMessageA(char*);

if (dockpos != DOCK_NONE)
{
//-------------------------------------------------------------
// register our app as dockable with windows
//-------------------------------------------------------------
var abd = new Struct(AppBarData);

abd.cbSize = abd.structSize;
abd.hWnd = getMainWnd().handle;

var uCallback = RegisterWindowMessageA("AppBarMessage");
abd.uCallbackMessage = uCallback;

if (SHAppBarMessage(ABM_NEW, abd))
{
docked = true;

Application.Appearance.borderStyle = $BSNONE;

//-------------------------------------------------------------
// set the position of the dockable window
//-------------------------------------------------------------
abd.uEdge = ABE_TOP;

abd.rc.left = left;
abd.rc.top = top;
abd.rc.right = left + width;
abd.rc.bottom = top + height;

// query system for position
SHAppBarMessage(ABM_QUERYPOS, abd);

// send our rect coords to the system
SHAppBarMessage(ABM_SETPOS, abd);

// move our app to the rect coords
MoveWindow(abd.hWnd, abd.rc.left, abd.rc.top, abd.rc.right - abd.rc.left, abd.rc.bottom - abd.rc.top, true);
}
}
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 03:50 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.