importing 1.2 sources
This commit is contained in:
parent
cb1e09eaf2
commit
dc3a8a4e92
7 changed files with 601 additions and 6 deletions
12
README.md
12
README.md
|
|
@ -1,14 +1,14 @@
|
|||
# UniWharf
|
||||
|
||||
# Lost Code
|
||||
UniWharf is a single instance Wharf module loader
|
||||
|
||||
Somewhere out there the file **uniwharf-1.2.zip** exists and contains the source code. If you find it, please let me know - it was on the Internet circa Dec 1998, hosted at my ISP.
|
||||
## Overview
|
||||
|
||||
## UniWharf
|
||||
|
||||
UniWharf is a small program which will load a given LiteStep Wharf module without the actual Wharf, or LiteStep for that matter. It has been tested with a wide variety of modules and has seemed to work quite well for all of them.
|
||||
UniWharf is a small program which will load a given [LiteStep](http://www.litestep.net/) Wharf module without the actual Wharf, or LiteStep for that matter. It has been tested with a wide variety of modules and has seemed to work quite well for all of them.
|
||||
|
||||
This application was previously know as LSFloater, as written by [RaV](mailto:rav@unpaved.com).
|
||||
|
||||
## ChangeLog
|
||||
|
||||
See [ChangeLog](ChangeLog) checked into gitlab, I was able to retrieve it via the Wayback Machine.
|
||||
See [ChangeLog](ChangeLog)
|
||||
|
||||
|
|
|
|||
111
UniWharf.txt
Normal file
111
UniWharf.txt
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
UniWharf v1.2 Readme File
|
||||
-------------------------
|
||||
|
||||
Changes
|
||||
-------
|
||||
Version 1.2: "te" <tengel@sonic.net>
|
||||
- Completely changed to read native step.rc, no real need for
|
||||
[LSFloater] section in modules.ini anymore. This means you
|
||||
now need LSAPI.DLL for it to function, as some wharf modules
|
||||
(lstime, eg) need step.rc loaded when they're loaded. This also
|
||||
means your modules now have theme support. :-) Ah, and it also
|
||||
indicates that any wharf module should work.
|
||||
- Added background image capability. (see "How It Works" below)
|
||||
- Reformatted and optimized the code, cleaned up some memory
|
||||
leaks, fixed bugs, etc as I found them.
|
||||
- Renamed to "UniWharf" to A) reflect that it's so changed, and
|
||||
B) because you don't really need LiteStep anymore ("Floater"
|
||||
by itself sounded stupid).
|
||||
- Step.rc and modules.ini are now always looked for in the same
|
||||
location as the executable, rather than the current directory.
|
||||
|
||||
Version 1.1: "RaV" <rav@unpaved.com>
|
||||
- Renamed to LSFloater from EvwmLS due to popular demand.
|
||||
- Added a left-double click on border function to turn off or on
|
||||
always on top.
|
||||
|
||||
Version 1.0: "RaV" <rav@unpaved.com>
|
||||
- Initial public release.
|
||||
|
||||
|
||||
What is it?
|
||||
-----------
|
||||
UniWharf used to be an addon program that lets you use Litestep
|
||||
Wharf modules. You can use it as a standalone program without
|
||||
Evwm or LiteStep, as it simply creates a wharf window that runs
|
||||
the wharf module inside it. I actually use it to run lsvwm and
|
||||
lstime under Explorer quite successfully.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
Copy UniWharf.exe to a directory, and copy your modules.ini file
|
||||
and any .dll or .app files from your LiteStep directory there too.
|
||||
If you are using lsvwm, add these 3 lines to your modules.ini under
|
||||
the [lsvwm] line (if that line doesn't exist, add that too).
|
||||
|
||||
[lsvwm]
|
||||
stickies=1
|
||||
sticky1=UniWharf
|
||||
|
||||
|
||||
How it Works
|
||||
------------
|
||||
You start a wharf module by running uniwharf.exe with the dll or app
|
||||
name as the parameter, for example:
|
||||
|
||||
uniwharf.exe lsvwm.dll
|
||||
|
||||
will start the lsvwm module. The module will start in the upper left
|
||||
corner of your desktop. You can move it around by clicking and holding
|
||||
down the right mouse button on the border of the module. To close the
|
||||
module, click on the edge and hit Alt-F4.
|
||||
|
||||
You can also choose to have the module always on top or not by double
|
||||
clicking on the border. After you move the module, its position is
|
||||
saved in your modules.ini file so that it will always open at the same
|
||||
place.
|
||||
|
||||
You can load a background image for your wharf - this should be a
|
||||
64x64 BMP file, exactly the kind you would use with Litestep. This is
|
||||
configured on a per-module basis using the key "backpix" under the
|
||||
module section in MODULES.INI. For example:
|
||||
|
||||
[lsvwm.dll]
|
||||
top=442
|
||||
left=1
|
||||
ontop=1
|
||||
backpix=c:\litestep\images\b24_vwmbg.bmp
|
||||
|
||||
You must always use the fullpath to the image file, or any other file
|
||||
spec that the function LoadImage() can handle.
|
||||
|
||||
|
||||
Extra Stuff
|
||||
-----------
|
||||
If LiteStep is not running, UniWharf does a little trick to make
|
||||
modules work -- as such, you may see a module in your Task List
|
||||
(you do under NT) called "LiteStep". THIS IS NORMAL. There are
|
||||
several LSAPI.DLL functions which try and obtain the main LiteStep
|
||||
window handle before they continue; LoadLSImage is an example of
|
||||
this. Some modules like lstime use LoadLSImage, and therefore
|
||||
need a window called "LiteStep" (with a class of TApplication)
|
||||
hanging around. UniWharf will alter it's internal window name
|
||||
to create this window only if it's not available (in other words,
|
||||
on the first invocation when you're not running LiteStep).
|
||||
|
||||
The real fix is to alter LSAPI to not need the LiteStep window
|
||||
handle (LoadLSImage that's used to load a BMP file has no business
|
||||
looking for this window, folks) in a more intelligent manner. I may
|
||||
well do that, but it this stuff has to work now. :)
|
||||
|
||||
|
||||
Credits and Other Info
|
||||
----------------------
|
||||
Marek "RaV" Gorecki - original code
|
||||
RaV says: "I want to thank the Litestep team for creating such a
|
||||
neat shell and then releasing the source code to the public. I
|
||||
could not do this without that info."
|
||||
|
||||
Website: http://www.sonic.net/~tengel/uniwharf
|
||||
Email: tengel@sonic.net
|
||||
52
src/Makefile.vc6
Normal file
52
src/Makefile.vc6
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
########################################################
|
||||
## Makefile for building uniwharf.exe with MSVC++ 6.0
|
||||
## Use: nmake -f makefile.vc6 [release | debug]
|
||||
## (default is release)
|
||||
##
|
||||
## Comments to: Troy Engel <tengel@sonic.net>
|
||||
|
||||
PROGRAM_NAME = uniwharf.exe
|
||||
LINK_RLIB = ..\lsapi\release\lsapi.lib
|
||||
LINK_DLIB = ..\lsapi\debug\lsapi.lib
|
||||
LSAPI_INC = ..\lsapi
|
||||
|
||||
########################################################
|
||||
## Nothing more to do below this line!
|
||||
|
||||
## Release
|
||||
CCR = cl.exe /MT /O2 /D "NDEBUG"
|
||||
LINKR = link.exe /incremental:no
|
||||
|
||||
## Debug
|
||||
CCD = cl.exe /MTd /Gm /ZI /Od /D "_DEBUG" /GZ
|
||||
LINKD = link.exe /incremental:yes /debug
|
||||
|
||||
CFLAGS = /nologo /I $(LSAPI_INC) /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
LFLAGS = /nologo /out:$(PROGRAM_NAME) /subsystem:windows /machine:I386 /opt:NOWIN98
|
||||
LINKLIBS = kernel32.lib user32.lib gdi32.lib
|
||||
|
||||
all : release
|
||||
|
||||
release: uniwharfr.obj
|
||||
$(LINKR) $(LFLAGS) $(LINKLIBS) $(LINK_RLIB) uniwharf.obj
|
||||
|
||||
debug: uniwharfd.obj
|
||||
$(LINKD) $(LFLAGS) $(LINKLIBS) $(LINK_DLIB) uniwharf.obj
|
||||
|
||||
uniwharfr.obj : uniwharf.c
|
||||
$(CCR) $(CFLAGS) uniwharf.c
|
||||
|
||||
uniwharfd.obj : uniwharf.c
|
||||
$(CCD) $(CFLAGS) uniwharf.c
|
||||
|
||||
clean:
|
||||
del uniwharf.obj
|
||||
del uniwharf.pdb
|
||||
del uniwharf.ilk
|
||||
del vc60.idb
|
||||
del vc60.pdb
|
||||
del vc60.pch
|
||||
|
||||
cleanall: clean
|
||||
del uniwharf.exe
|
||||
|
||||
14
src/unimsgs.h
Normal file
14
src/unimsgs.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ifndef _UNIMSGS_H_
|
||||
#define _UNIMSGS_H_
|
||||
|
||||
#define MSG_UNITITLE "UniWharf"
|
||||
#define MSG_ERROR "UniWharf Error"
|
||||
#define MSG_QUITWHARF "Unable to load module 'quit' function."
|
||||
#define MSG_INITWHARF "Unable to load module 'init' function."
|
||||
#define MSG_LOADWHARF "Unable to load wharf module."
|
||||
#define MSG_ERRMOD "Error writing to modules.ini"
|
||||
#define MSG_OFFTOP "Always on top Turned off."
|
||||
#define MSG_ONTOP "Always on top Turned On."
|
||||
#define MSG_USAGE "No wharf module specified.\n\nUsage: uniwharf.exe <modulename>\n"
|
||||
|
||||
#endif /* _UNIMSGS_H_ */
|
||||
361
src/uniwharf.c
Normal file
361
src/uniwharf.c
Normal file
|
|
@ -0,0 +1,361 @@
|
|||
/************ UniWharf v1.2 (***************
|
||||
* Source is freely distributed under GNU *
|
||||
* Public Distribution license. *
|
||||
* Re-distribution after modification pro- *
|
||||
* hibited without Author's approval. *
|
||||
*******************************************/
|
||||
|
||||
/* Old notice */
|
||||
/************ LSFloater v1.0 ***************
|
||||
* Copyright (c) 1998, Marek "RaV" Gorecki *
|
||||
* --------------------------------------- *
|
||||
* Source is freely distributed under GNU *
|
||||
* Public Distribution license. *
|
||||
* Re-distribution after modification pro- *
|
||||
* hibited without Author's approval. *
|
||||
*******************************************/
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include "lsapi.h"
|
||||
#include "wharfdata.h"
|
||||
#include "unimsgs.h"
|
||||
|
||||
/* Class and Window names of windows */
|
||||
static LPCTSTR lpszClassName = "TApplication";
|
||||
static LPCTSTR lpszWindowName = "UniWharf";
|
||||
|
||||
/* Global Variables */
|
||||
static char modules_ini[MAX_PATH]; /* Path to modules.ini */
|
||||
static char step_rc[MAX_PATH]; /* Path to step.rc */
|
||||
static int ontop = 1; /* Module is on top */
|
||||
LPSTR pluginName; /* Module Name */
|
||||
HBITMAP defaultBackImage = NULL; /* Background */
|
||||
|
||||
/* Declaration for Window procedure */
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
/* Type definitions for external function calls to the module DLL */
|
||||
typedef int (FAR *INITWHARFMODULEPROC)(HWND, HINSTANCE, wharfDataType *);
|
||||
typedef int (FAR *QUITWHARFMODULEPROC)(HINSTANCE);
|
||||
|
||||
/* Loads the Module */
|
||||
void loadWharfModule(HWND Wnd, char *moduleName, int x, int y)
|
||||
{
|
||||
int (FAR *initWharfModule)(HWND, HINSTANCE, wharfDataType*);
|
||||
int (FAR *quitWharfModule)(HINSTANCE);
|
||||
|
||||
HINSTANCE moduleInst;
|
||||
wharfDataType wd;
|
||||
char temp[MAX_PATH];
|
||||
|
||||
/* Fill in the wharf data structure with either values from
|
||||
* the modules.ini or defaults. */
|
||||
SetupRC(step_rc);
|
||||
|
||||
wd.borderSize = GetRCInt("WharfBevelWidth",0);
|
||||
wd.pos = GetRCInt("pos",0);
|
||||
wd.winListSize = GetRCInt("WinListSize",200);
|
||||
wd.winList = NULL;
|
||||
wd.trayIconSize = GetRCInt("TrayIconSize",16);
|
||||
wd.lm78Unit = GetRCInt("lm78Unit",0);
|
||||
wd.lm78MaxCpu = GetRCInt("lm78MaxCpu",0);
|
||||
wd.lm78MaxMb = GetRCInt("lm78MaxMb",0);
|
||||
wd.lm78Cpu = GetRCInt("lm78Cpu",0);
|
||||
wd.taskBar = GetRCInt("NoTaskBar",0);
|
||||
wd.msTaskBar = GetRCInt("MSTaskBar",0);
|
||||
wd.taskBarFore = GetRCColor("LSTaskBarFore",0x000000);
|
||||
wd.taskBarFore2 = GetRCColor("LSTaskBarFore2",0x3f3f3f);
|
||||
wd.taskBarBack = GetRCColor("LSTaskBarBack",0x7f7f7f);
|
||||
wd.taskBarText = GetRCColor("LSTaskBarText",0xffffff);
|
||||
wd.autoHideWharf = GetRCInt("AutoHideWharf",0);
|
||||
wd.autoHideTaskbar = GetRCInt("AutoHideTaskbar",0);
|
||||
wd.autoHideDelay = GetRCInt("AutoHideDelay",300);
|
||||
wd.showBeta = GetRCInt("NoShowBeta",1);
|
||||
wd.usClock = GetRCInt("UsClock",1);
|
||||
wd.vwmVelocity = GetRCInt("VWMVelocity",300);
|
||||
wd.VWMDistance = GetRCInt("VWMSecurityDistance",5);
|
||||
wd.VWMNoGathering = GetRCInt("VWMNoGathering",0);
|
||||
wd.VWMNoAuto = GetRCInt("VWMNoAuto",1);
|
||||
wd.vwmBackColor = GetRCColor("VWMBackColor",0x000000);
|
||||
wd.vwmSelBackColor = GetRCColor("VWMSelBackColor",0x3f3f3f);
|
||||
wd.vwmForeColor = GetRCColor("VWMForeColor",0x906090);
|
||||
wd.vwmBorderColor = GetRCColor("VWMBorderColor",0xffffff);
|
||||
wd.xmouseDelay = GetRCInt("xmouseDelay",0);
|
||||
wd.xmouseBringToTop = GetRCInt("BringToTop",0);
|
||||
wd.stripBar = GetRCInt("stripBar",0);
|
||||
|
||||
GetRCString("PixmapPath",temp,".\\",sizeof(temp));
|
||||
wd.pixmapDir=(char *)malloc(strlen(temp)+1);
|
||||
strcpy(wd.pixmapDir,temp);
|
||||
|
||||
GetRCString("DefaultBackPix",temp,"default.bmp",sizeof(temp));
|
||||
wd.defaultBmp=(char *)malloc(strlen(temp)+1);
|
||||
strcpy(wd.defaultBmp,temp);
|
||||
|
||||
GetRCString("backsaver",temp,"",sizeof(temp));
|
||||
wd.backsaver=(char *)malloc(strlen(temp)+1);
|
||||
strcpy(wd.backsaver,temp);
|
||||
|
||||
GetRCString("lsPath",temp,".\\",sizeof(temp));
|
||||
wd.lsPath=(char *)malloc(strlen(temp)+1);
|
||||
strcpy(wd.lsPath,temp);
|
||||
|
||||
/* Load the module */
|
||||
moduleInst = LoadLibrary(moduleName);
|
||||
|
||||
if ((UINT)moduleInst > HINSTANCE_ERROR) {
|
||||
/* Get exported functions addresses */
|
||||
initWharfModule = (INITWHARFMODULEPROC)GetProcAddress(moduleInst, "initWharfModule");
|
||||
quitWharfModule = (QUITWHARFMODULEPROC)GetProcAddress(moduleInst, "quitWharfModule");
|
||||
|
||||
if (initWharfModule) {
|
||||
if (quitWharfModule) {
|
||||
/* Run module startup */
|
||||
(*initWharfModule)(Wnd, moduleInst, &wd);
|
||||
} else {
|
||||
MessageBox(0, MSG_QUITWHARF, MSG_ERROR, MB_OK);
|
||||
}
|
||||
} else {
|
||||
MessageBox(0, MSG_INITWHARF, MSG_ERROR, MB_OK);
|
||||
}
|
||||
} else {
|
||||
MessageBox(0, MSG_LOADWHARF, MSG_ERROR, MB_OK);
|
||||
}
|
||||
|
||||
free(wd.pixmapDir);
|
||||
free(wd.defaultBmp);
|
||||
free(wd.backsaver);
|
||||
free(wd.lsPath);
|
||||
|
||||
CloseRC();
|
||||
}
|
||||
|
||||
/* Window Procedure for the module */
|
||||
LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
static BOOL dragging=FALSE;
|
||||
static int dragX,dragY; /* position of the cursor relative to the upper left corner */
|
||||
/* of the window, when dragging == TRUE */
|
||||
char cx[10];
|
||||
POINT pt;
|
||||
|
||||
switch(iMessage) {
|
||||
case WM_CREATE:
|
||||
return TRUE;
|
||||
break;
|
||||
case WM_PAINT:
|
||||
if (defaultBackImage != NULL) {
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc = BeginPaint(hWnd,&ps);
|
||||
HDC src = CreateCompatibleDC(NULL);
|
||||
SelectObject(src, defaultBackImage);
|
||||
TransparentBltLS(hdc, 0, 0, 64, 64, src, 0, 0, RGB(255, 0, 255));
|
||||
EndPaint(hWnd,&ps);
|
||||
DeleteDC(src);
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
case WM_NCLBUTTONDOWN:
|
||||
case WM_NCLBUTTONUP:
|
||||
return 0;
|
||||
break;
|
||||
case WM_NCRBUTTONDOWN:
|
||||
/* since the only non-client area of the module is the border, */
|
||||
/* then start right-dragging when the right mouse button is down in an nc area */
|
||||
dragging = TRUE;
|
||||
pt.x = MAKEPOINTS(lParam).x;
|
||||
pt.y = MAKEPOINTS(lParam).y;
|
||||
ScreenToClient(hWnd,&pt);
|
||||
dragX = pt.x;
|
||||
dragY = pt.y;
|
||||
SetCapture(hWnd);
|
||||
return 0;
|
||||
break;
|
||||
case WM_NCRBUTTONUP:
|
||||
{
|
||||
RECT Rect;
|
||||
char cy[9], cx[9];
|
||||
if (dragging) {
|
||||
dragging = FALSE;
|
||||
ReleaseCapture();
|
||||
GetWindowRect(hWnd,&Rect);
|
||||
if (WritePrivateProfileString(pluginName,"top",itoa(Rect.top,cy,10),modules_ini)==0)
|
||||
MessageBox(0,MSG_ERRMOD,MSG_ERROR,MB_OK);
|
||||
WritePrivateProfileString(pluginName,"left",itoa(Rect.left,cx,10),modules_ini);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
case WM_MOUSEMOVE:
|
||||
if (dragging) {
|
||||
GetCursorPos(&pt);
|
||||
SetWindowPos(hWnd,NULL,pt.x-dragX,pt.y-dragY,0,0,SWP_NOZORDER | SWP_NOSIZE);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
case WM_RBUTTONUP:
|
||||
{
|
||||
RECT Rect;
|
||||
char cy[9], cx[9];
|
||||
if (dragging) {
|
||||
dragging = FALSE;
|
||||
ReleaseCapture();
|
||||
GetWindowRect(hWnd,&Rect);
|
||||
if (WritePrivateProfileString(pluginName,"top",itoa(Rect.top,cy,10),modules_ini)==0)
|
||||
MessageBox(0,MSG_ERRMOD,itoa(Rect.top,cy,10),MB_OK);
|
||||
WritePrivateProfileString(pluginName,"left",itoa(Rect.left,cx,10),modules_ini);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
break;
|
||||
case WM_NCLBUTTONDBLCLK:
|
||||
/* Left Double click toggles always on top mode */
|
||||
if (ontop) {
|
||||
MessageBox(0,MSG_OFFTOP,MSG_UNITITLE,MB_OK);
|
||||
ontop = 0;
|
||||
SetWindowPos(hWnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
|
||||
if (WritePrivateProfileString(pluginName,"ontop",itoa(ontop,cx,10),modules_ini)==0)
|
||||
MessageBox(0,MSG_ERROR,itoa(ontop,cx,10),MB_OK);
|
||||
return 0;
|
||||
}
|
||||
MessageBox(0,MSG_ONTOP,MSG_UNITITLE,MB_OK);
|
||||
SetWindowPos(hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
|
||||
ontop = 1;
|
||||
if (WritePrivateProfileString(pluginName,"ontop",itoa(ontop,cx,10),modules_ini)==0)
|
||||
MessageBox(0,MSG_ERROR,itoa(ontop,cx,10),MB_OK);
|
||||
return 0;
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
return(DefWindowProc(hWnd,iMessage,wParam,lParam));
|
||||
}
|
||||
}
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
MSG msg;
|
||||
WNDCLASS wc;
|
||||
HWND hWnd;
|
||||
RECT r;
|
||||
char cy[9], cx[9];
|
||||
char temp[MAX_PATH];
|
||||
int modX = 0, modY = 0;
|
||||
unsigned long modSize = 0;
|
||||
|
||||
/* No command line specified */
|
||||
if (strlen(lpCmdLine)==0) {
|
||||
MessageBox(0,MSG_USAGE,MSG_ERROR,MB_OK);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Register Window style */
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
|
||||
wc.lpfnWndProc = (WNDPROC) WndProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = NULL;
|
||||
wc.hCursor = NULL; /*LoadCursor(NULL, IDC_ARROW); */
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_BACKGROUND+1);
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.lpszClassName = lpszClassName;
|
||||
|
||||
/* Register the window class */
|
||||
if(RegisterClass(&wc) == 0)
|
||||
return FALSE;
|
||||
|
||||
modX = 64+2*(GetSystemMetrics(SM_CXSIZEFRAME)-1);
|
||||
modY = 64+2*(GetSystemMetrics(SM_CYSIZEFRAME)-1);
|
||||
|
||||
/* Create the main application window */
|
||||
/* hack: look for real litestep wind and if not there
|
||||
then call ourselves the ls wind name so GetLitestepWnd()
|
||||
works */
|
||||
hWnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TOOLWINDOW, lpszClassName,
|
||||
(FindWindow("TApplication", "LiteStep") == NULL) ? "LiteStep" : lpszWindowName,
|
||||
WS_DLGFRAME | WS_POPUP, 100, 100, modX, modY,
|
||||
NULL, NULL, hInstance, NULL);
|
||||
|
||||
SetWindowLong(hWnd, GWL_USERDATA, 0x49474541);
|
||||
pluginName = lpCmdLine;
|
||||
modSize = GetModuleFileName(NULL, modules_ini, sizeof(modules_ini));
|
||||
while (modules_ini[--modSize] != '\\')
|
||||
modules_ini[modSize] = '\0';
|
||||
strcpy(step_rc, modules_ini);
|
||||
strcat(modules_ini,"modules.ini");
|
||||
strcat(step_rc, "step.rc");
|
||||
|
||||
/* If window was not created, quit */
|
||||
if(hWnd == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* Set position of the module to the place in the ini file */
|
||||
SetWindowPos(hWnd,NULL,GetPrivateProfileInt(lpCmdLine,"left",0,modules_ini),
|
||||
GetPrivateProfileInt(lpCmdLine,"top",0,modules_ini),0,0,SWP_NOZORDER | SWP_NOSIZE);
|
||||
|
||||
/* Get ontop info for the window */
|
||||
ontop = GetPrivateProfileInt(lpCmdLine,"ontop",1,modules_ini);
|
||||
|
||||
/* our background */
|
||||
GetPrivateProfileString(lpCmdLine, "backpix", NULL, temp, sizeof(temp), modules_ini);
|
||||
if (temp[0] != '\0') {
|
||||
defaultBackImage = (HBITMAP)LoadImage(NULL,temp,
|
||||
IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR | LR_LOADFROMFILE);
|
||||
}
|
||||
|
||||
/* Set window not always ontop */
|
||||
if (!ontop)
|
||||
SetWindowPos(hWnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
|
||||
|
||||
/* Here we check if the window is not on the screen */
|
||||
/* Like if you change resolutions after saving. */
|
||||
/* We thus move the window back onto the screen. */
|
||||
GetWindowRect(hWnd,&r);
|
||||
|
||||
if (r.left >= (GetSystemMetrics(SM_CXSCREEN)))
|
||||
r.left = GetSystemMetrics(SM_CXSCREEN) - modX;
|
||||
if (r.top >= (GetSystemMetrics(SM_CYSCREEN)))
|
||||
r.top = GetSystemMetrics(SM_CYSCREEN) - modY;
|
||||
|
||||
if (r.top < 0)
|
||||
r.top = 0;
|
||||
if (r.left < 0)
|
||||
r.left = 0;
|
||||
|
||||
r.bottom = r.top + modX;
|
||||
r.right = r.left + modY;
|
||||
|
||||
/* Save the new position */
|
||||
if (WritePrivateProfileString(pluginName,"top",itoa(r.top,cy,10),modules_ini)==0)
|
||||
MessageBox(0,MSG_ERRMOD,itoa(r.top,cy,10),MB_OK);
|
||||
WritePrivateProfileString(pluginName,"left",itoa(r.left,cx,10),modules_ini);
|
||||
|
||||
if (WritePrivateProfileString(pluginName,"ontop",itoa(ontop,cx,10),modules_ini)==0)
|
||||
MessageBox(0,MSG_ERRMOD,itoa(ontop,cx,10),MB_OK);
|
||||
|
||||
/* Load the module */
|
||||
loadWharfModule(hWnd,lpCmdLine,0,0);
|
||||
|
||||
/* Show the window */
|
||||
ShowWindow(hWnd,SW_SHOW);
|
||||
MoveWindow(hWnd,r.left,r.top,modX,modY,TRUE);
|
||||
UpdateWindow(hWnd);
|
||||
|
||||
/* Process application messages until the application closes */
|
||||
while( GetMessage(&msg, NULL, 0, 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
if (defaultBackImage)
|
||||
DeleteObject(defaultBackImage);
|
||||
|
||||
return 0;
|
||||
}
|
||||
57
src/wharfdata.h
Normal file
57
src/wharfdata.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#ifndef __WHARFDATA_H
|
||||
#define __WHARFDATA_H
|
||||
|
||||
/* ----------------------------------------------------------------- */
|
||||
|
||||
typedef struct {
|
||||
HWND Handle;
|
||||
BOOL Visible;
|
||||
RECT Position;
|
||||
int Desk;
|
||||
} windowType;
|
||||
|
||||
typedef struct {
|
||||
int borderSize;
|
||||
int pos;
|
||||
int winListSize;
|
||||
windowType *winList;
|
||||
int trayIconSize;
|
||||
int lm78Unit;
|
||||
int lm78MaxCpu;
|
||||
int lm78MaxMb;
|
||||
int lm78Cpu;
|
||||
int taskBar;
|
||||
int msTaskBar;
|
||||
int taskBarFore;
|
||||
int taskBarBack;
|
||||
int taskBarText;
|
||||
int vwmVelocity;
|
||||
int autoHideWharf;
|
||||
int autoHideTaskbar;
|
||||
int VWMDistance;
|
||||
int autoHideDelay;
|
||||
int showBeta;
|
||||
int usClock;
|
||||
int VWMNoGathering;
|
||||
int VWMNoAuto;
|
||||
int xmouseDelay;
|
||||
int xmouseBringToTop;
|
||||
char *pixmapDir;
|
||||
char *defaultBmp;
|
||||
int vwmBackColor;
|
||||
int vwmSelBackColor;
|
||||
int vwmForeColor;
|
||||
int vwmBorderColor;
|
||||
char *backsaver;
|
||||
int taskBarFore2;
|
||||
int stripBar;
|
||||
char *lsPath;
|
||||
} wharfDataType;
|
||||
|
||||
/* ----------------------------------------------------------------- */
|
||||
|
||||
const long magicDWord = 0x49474541;
|
||||
|
||||
/* ----------------------------------------------------------------- */
|
||||
|
||||
#endif
|
||||
BIN
uniwharf.png
Normal file
BIN
uniwharf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Reference in a new issue