mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Updated with latest progress. Started on a worker thread for network enumerating and file change notifications.
svn path=/trunk/; revision=3272
This commit is contained in:
parent
86dc3a88d2
commit
ad319a46cf
12 changed files with 446 additions and 583 deletions
|
@ -30,25 +30,26 @@ RCFLAGS = -DGCC -D_WIN32_IE=0x0400
|
||||||
|
|
||||||
|
|
||||||
OBJS = about.o \
|
OBJS = about.o \
|
||||||
framewnd.o \
|
|
||||||
childwnd.o \
|
childwnd.o \
|
||||||
debug.o \
|
debug.o \
|
||||||
dialogs.o \
|
dialogs.o \
|
||||||
draw.o \
|
draw.o \
|
||||||
entries.o \
|
entries.o \
|
||||||
run.o \
|
framewnd.o \
|
||||||
shell.o \
|
listview.o \
|
||||||
|
main.o \
|
||||||
network.o \
|
network.o \
|
||||||
settings.o \
|
settings.o \
|
||||||
splitpath.o \
|
shell.o \
|
||||||
sort.o \
|
sort.o \
|
||||||
utils.o \
|
splitpath.o \
|
||||||
treeview.o \
|
run.o \
|
||||||
listview.o \
|
|
||||||
trace.o \
|
trace.o \
|
||||||
main.o
|
treeview.o \
|
||||||
|
utils.o \
|
||||||
|
worker.o
|
||||||
|
|
||||||
LIBS = -lgdi32 -luser32 -lkernel32 -lcomctl32
|
LIBS = -lgdi32 -luser32 -lkernel32 -ladvapi32 -lcomctl32 -lcomdlg32 -lversion
|
||||||
|
|
||||||
all: $(TARGET).exe
|
all: $(TARGET).exe
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
#define ASSERT assert
|
#define ASSERT assert
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "childwnd.h"
|
|
||||||
#include "framewnd.h"
|
#include "framewnd.h"
|
||||||
|
#include "childwnd.h"
|
||||||
#include "treeview.h"
|
#include "treeview.h"
|
||||||
#include "listview.h"
|
#include "listview.h"
|
||||||
#include "dialogs.h"
|
#include "dialogs.h"
|
||||||
|
@ -65,87 +65,6 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Local module support methods
|
// Local module support methods
|
||||||
//
|
//
|
||||||
/*
|
|
||||||
#ifndef _NO_EXTENSIONS
|
|
||||||
|
|
||||||
void set_header(Pane* pane)
|
|
||||||
{
|
|
||||||
HD_ITEM item;
|
|
||||||
int scroll_pos = GetScrollPos(pane->hWnd, SB_HORZ);
|
|
||||||
int i=0, x=0;
|
|
||||||
|
|
||||||
item.mask = HDI_WIDTH;
|
|
||||||
item.cxy = 0;
|
|
||||||
|
|
||||||
for(; x+pane->widths[i]<scroll_pos && i<COLUMNS; i++) {
|
|
||||||
x += pane->widths[i];
|
|
||||||
Header_SetItem(pane->hwndHeader, i, &item);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i < COLUMNS) {
|
|
||||||
x += pane->widths[i];
|
|
||||||
item.cxy = x - scroll_pos;
|
|
||||||
Header_SetItem(pane->hwndHeader, i++, &item);
|
|
||||||
|
|
||||||
for(; i<COLUMNS; i++) {
|
|
||||||
item.cxy = pane->widths[i];
|
|
||||||
x += pane->widths[i];
|
|
||||||
Header_SetItem(pane->hwndHeader, i, &item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static LRESULT pane_notify(Pane* pane, NMHDR* pnmh)
|
|
||||||
{
|
|
||||||
switch(pnmh->code) {
|
|
||||||
case HDN_TRACK:
|
|
||||||
case HDN_ENDTRACK:
|
|
||||||
{
|
|
||||||
HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
|
|
||||||
int idx = phdn->iItem;
|
|
||||||
int dx = phdn->pitem->cxy - pane->widths[idx];
|
|
||||||
int i;
|
|
||||||
|
|
||||||
RECT clnt;
|
|
||||||
GetClientRect(pane->hWnd, &clnt);
|
|
||||||
// move immediate to simulate HDS_FULLDRAG (for now [04/2000] not realy needed with WINELIB)
|
|
||||||
Header_SetItem(pane->hwndHeader, idx, phdn->pitem);
|
|
||||||
pane->widths[idx] += dx;
|
|
||||||
for (i = idx; ++i <= COLUMNS; )
|
|
||||||
pane->positions[i] += dx;
|
|
||||||
{
|
|
||||||
int scroll_pos = GetScrollPos(pane->hWnd, SB_HORZ);
|
|
||||||
RECT rt_scr = {pane->positions[idx+1]-scroll_pos, 0, clnt.right, clnt.bottom};
|
|
||||||
RECT rt_clip = {pane->positions[idx]-scroll_pos, 0, clnt.right, clnt.bottom};
|
|
||||||
if (rt_scr.left < 0) rt_scr.left = 0;
|
|
||||||
if (rt_clip.left < 0) rt_clip.left = 0;
|
|
||||||
ScrollWindowEx(pane->hWnd, dx, 0, &rt_scr, &rt_clip, 0, 0, SW_INVALIDATE);
|
|
||||||
rt_clip.right = pane->positions[idx+1];
|
|
||||||
RedrawWindow(pane->hWnd, &rt_clip, 0, RDW_INVALIDATE|RDW_UPDATENOW);
|
|
||||||
if (pnmh->code == HDN_ENDTRACK) {
|
|
||||||
ListBox_SetHorizontalExtent(pane->hWnd, pane->positions[COLUMNS]);
|
|
||||||
if (GetScrollPos(pane->hWnd, SB_HORZ) != scroll_pos)
|
|
||||||
set_header(pane);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
case HDN_DIVIDERDBLCLICK:
|
|
||||||
{
|
|
||||||
HD_NOTIFY* phdn = (HD_NOTIFY*) pnmh;
|
|
||||||
HD_ITEM item;
|
|
||||||
calc_single_width(pane, phdn->iItem);
|
|
||||||
item.mask = HDI_WIDTH;
|
|
||||||
item.cxy = pane->widths[phdn->iItem];
|
|
||||||
Header_SetItem(pane->hwndHeader, phdn->iItem, &item);
|
|
||||||
InvalidateRect(pane->hWnd, 0, TRUE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static BOOL pane_command(Pane* pane, UINT cmd)
|
static BOOL pane_command(Pane* pane, UINT cmd)
|
||||||
{
|
{
|
||||||
|
@ -168,22 +87,12 @@ static BOOL pane_command(Pane* pane, UINT cmd)
|
||||||
if (pane->visible_cols != COL_ALL) {
|
if (pane->visible_cols != COL_ALL) {
|
||||||
pane->visible_cols = COL_ALL;
|
pane->visible_cols = COL_ALL;
|
||||||
calc_widths(pane, TRUE);
|
calc_widths(pane, TRUE);
|
||||||
#ifndef _NO_EXTENSIONS
|
|
||||||
set_header(pane);
|
|
||||||
#endif
|
|
||||||
InvalidateRect(pane->hWnd, 0, TRUE);
|
InvalidateRect(pane->hWnd, 0, TRUE);
|
||||||
CheckMenuItem(Globals.hMenuView, ID_VIEW_NAME, MF_BYCOMMAND);
|
CheckMenuItem(Globals.hMenuView, ID_VIEW_NAME, MF_BYCOMMAND);
|
||||||
// CheckMenuItem(Globals.hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND|MF_CHECKED);
|
// CheckMenuItem(Globals.hMenuView, ID_VIEW_ALL_ATTRIBUTES, MF_BYCOMMAND|MF_CHECKED);
|
||||||
// CheckMenuItem(Globals.hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
|
// CheckMenuItem(Globals.hMenuView, ID_VIEW_SELECTED_ATTRIBUTES, MF_BYCOMMAND);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifndef _NO_EXTENSIONS
|
|
||||||
case ID_PREFERED_SIZES: {
|
|
||||||
calc_widths(pane, TRUE);
|
|
||||||
set_header(pane);
|
|
||||||
InvalidateRect(pane->hWnd, 0, TRUE);
|
|
||||||
break;}
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
// TODO: more command ids...
|
// TODO: more command ids...
|
||||||
default:
|
default:
|
||||||
|
@ -191,24 +100,6 @@ static BOOL pane_command(Pane* pane, UINT cmd)
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HWND hSplitWnd; // Splitter Bar Control Window
|
|
||||||
//
|
|
||||||
// hSplitWnd = CreateWindow(szFrameClass, "splitter window", WS_VISIBLE|WS_CHILD,
|
|
||||||
// CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
|
|
||||||
// Globals.hMainWnd, (HMENU)SPLIT_WINDOW, hInstance, NULL);
|
|
||||||
// if (!hSplitWnd)
|
|
||||||
// return FALSE;
|
|
||||||
// hTreeWnd = CreateTreeView(Globals.hMDIClient, "c:\\foobar.txt");
|
|
||||||
// if (!hTreeWnd)
|
|
||||||
// return FALSE;
|
|
||||||
// hListWnd = CreateListView(Globals.hMDIClient, "");
|
|
||||||
// if (!hListWnd)
|
|
||||||
// return FALSE;
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
static void draw_splitbar(HWND hWnd, int x)
|
static void draw_splitbar(HWND hWnd, int x)
|
||||||
{
|
{
|
||||||
|
@ -222,72 +113,14 @@ static void draw_splitbar(HWND hWnd, int x)
|
||||||
ReleaseDC(hWnd, hdc);
|
ReleaseDC(hWnd, hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
static void ResizeWnd(ChildWnd* pChildWnd, int cx, int cy)
|
||||||
static void OnPaint(HWND hWnd, ChildWnd* pChildWnd)
|
|
||||||
{
|
{
|
||||||
HBRUSH lastBrush;
|
HDWP hdwp = BeginDeferWindowPos(2);
|
||||||
PAINTSTRUCT ps;
|
|
||||||
RECT rt;
|
|
||||||
|
|
||||||
BeginPaint(hWnd, &ps);
|
|
||||||
GetClientRect(hWnd, &rt);
|
|
||||||
lastBrush = SelectObject(ps.hdc, (HBRUSH)GetStockObject(COLOR_SPLITBAR));
|
|
||||||
Rectangle(ps.hdc, rt.left, rt.top-1, rt.right, rt.bottom+1);
|
|
||||||
SelectObject(ps.hdc, lastBrush);
|
|
||||||
// rt.top = rt.bottom - GetSystemMetrics(SM_CYHSCROLL);
|
|
||||||
// FillRect(ps.hdc, &rt, GetStockObject(BLACK_BRUSH));
|
|
||||||
EndPaint(hWnd, &ps);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static void OnPaint(HWND hWnd, ChildWnd* pChildWnd)
|
|
||||||
{
|
|
||||||
HBRUSH lastBrush;
|
|
||||||
PAINTSTRUCT ps;
|
|
||||||
RECT rt;
|
|
||||||
|
|
||||||
GetClientRect(hWnd, &rt);
|
|
||||||
BeginPaint(hWnd, &ps);
|
|
||||||
|
|
||||||
lastBrush = SelectObject(ps.hdc, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
|
||||||
Rectangle(ps.hdc, rt.left, rt.top-1, rt.right, rt.bottom+1);
|
|
||||||
SelectObject(ps.hdc, lastBrush);
|
|
||||||
rt.top = rt.bottom - GetSystemMetrics(SM_CYHSCROLL);
|
|
||||||
FillRect(ps.hdc, &rt, GetStockObject(BLACK_BRUSH));
|
|
||||||
/*
|
|
||||||
rt.left = pChildWnd->nSplitPos-SPLIT_WIDTH/2;
|
|
||||||
rt.right = pChildWnd->nSplitPos+SPLIT_WIDTH/2+1;
|
|
||||||
lastBrush = SelectBrush(ps.hdc, (HBRUSH)GetStockObject(COLOR_SPLITBAR));
|
|
||||||
Rectangle(ps.hdc, rt.left, rt.top-1, rt.right, rt.bottom+1);
|
|
||||||
SelectObject(ps.hdc, lastBrush);
|
|
||||||
#ifdef _NO_EXTENSIONS
|
|
||||||
rt.top = rt.bottom - GetSystemMetrics(SM_CYHSCROLL);
|
|
||||||
FillRect(ps.hdc, &rt, GetStockObject(BLACK_BRUSH));
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
EndPaint(hWnd, &ps);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//void ResizeWnd(ChildWnd* child, int cx, int cy);
|
|
||||||
static void ResizeWnd(ChildWnd* child, int cx, int cy)
|
|
||||||
{
|
|
||||||
HDWP hdwp = BeginDeferWindowPos(4);
|
|
||||||
RECT rt = {0, 0, cx, cy};
|
RECT rt = {0, 0, cx, cy};
|
||||||
|
|
||||||
cx = child->nSplitPos + SPLIT_WIDTH/2;
|
cx = pChildWnd->nSplitPos + SPLIT_WIDTH/2;
|
||||||
#ifndef _NO_EXTENSIONS
|
DeferWindowPos(hdwp, pChildWnd->left.hWnd, 0, rt.left, rt.top, pChildWnd->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
|
||||||
{
|
DeferWindowPos(hdwp, pChildWnd->right.hWnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
|
||||||
WINDOWPOS wp;
|
|
||||||
HD_LAYOUT hdl = {&rt, &wp};
|
|
||||||
Header_Layout(child->left.hwndHeader, &hdl);
|
|
||||||
DeferWindowPos(hdwp, child->left.hwndHeader, wp.hwndInsertAfter,
|
|
||||||
wp.x-1, wp.y, child->nSplitPos-SPLIT_WIDTH/2+1, wp.cy, wp.flags);
|
|
||||||
DeferWindowPos(hdwp, child->right.hwndHeader, wp.hwndInsertAfter,
|
|
||||||
rt.left+cx+1, wp.y, wp.cx-cx+2, wp.cy, wp.flags);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
DeferWindowPos(hdwp, child->left.hWnd, 0, rt.left, rt.top, child->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
|
|
||||||
DeferWindowPos(hdwp, child->right.hWnd, 0, rt.left+cx+1, rt.top, rt.right-cx, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
|
|
||||||
EndDeferWindowPos(hdwp);
|
EndDeferWindowPos(hdwp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,6 +138,22 @@ void OnFileMove(HWND hWnd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void OnPaint(HWND hWnd, ChildWnd* pChildWnd)
|
||||||
|
{
|
||||||
|
HBRUSH lastBrush;
|
||||||
|
PAINTSTRUCT ps;
|
||||||
|
RECT rt;
|
||||||
|
|
||||||
|
BeginPaint(hWnd, &ps);
|
||||||
|
GetClientRect(hWnd, &rt);
|
||||||
|
lastBrush = SelectObject(ps.hdc, (HBRUSH)GetStockObject(COLOR_SPLITBAR));
|
||||||
|
Rectangle(ps.hdc, rt.left, rt.top-1, rt.right, rt.bottom+1);
|
||||||
|
SelectObject(ps.hdc, lastBrush);
|
||||||
|
// rt.top = rt.bottom - GetSystemMetrics(SM_CYHSCROLL);
|
||||||
|
// FillRect(ps.hdc, &rt, GetStockObject(BLACK_BRUSH));
|
||||||
|
EndPaint(hWnd, &ps);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
|
// FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
|
||||||
|
@ -315,11 +164,11 @@ void OnFileMove(HWND hWnd)
|
||||||
|
|
||||||
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
UINT cmd = LOWORD(wParam);
|
//UINT cmd = LOWORD(wParam);
|
||||||
//HWND hChildWnd;
|
//HWND hChildWnd;
|
||||||
|
|
||||||
if (1) {
|
switch (LOWORD(wParam)) {
|
||||||
switch (cmd) {
|
// Parse the menu selections:
|
||||||
/*
|
/*
|
||||||
// case ID_FILE_MOVE:
|
// case ID_FILE_MOVE:
|
||||||
// OnFileMove(hWnd);
|
// OnFileMove(hWnd);
|
||||||
|
@ -398,11 +247,10 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// FUNCTION: ChildWndProc(HWND, unsigned, WORD, LONG)
|
// FUNCTION: ChildWndProc(HWND, unsigned, WORD, LONG)
|
||||||
//
|
//
|
||||||
|
@ -428,16 +276,13 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
//create_list_window(pChildWnd->hWnd, &pChildWnd->right, IDW_TREE_RIGHT, IDW_HEADER_RIGHT);
|
//create_list_window(pChildWnd->hWnd, &pChildWnd->right, IDW_TREE_RIGHT, IDW_HEADER_RIGHT);
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
OnPaint(hWnd, pChildWnd);
|
OnPaint(hWnd, pChildWnd);
|
||||||
break;
|
return 0;
|
||||||
|
|
||||||
case WM_NCDESTROY:
|
case WM_NCDESTROY:
|
||||||
// free_child_window(pChildWnd);
|
// free_child_window(pChildWnd);
|
||||||
SetWindowLong(hWnd, GWL_USERDATA, 0);
|
SetWindowLong(hWnd, GWL_USERDATA, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SETCURSOR:
|
case WM_SETCURSOR:
|
||||||
if (LOWORD(lParam) == HTCLIENT) {
|
if (LOWORD(lParam) == HTCLIENT) {
|
||||||
POINT pt;
|
POINT pt;
|
||||||
|
@ -449,24 +294,19 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
goto def;
|
goto def;
|
||||||
|
|
||||||
case WM_LBUTTONDOWN: {
|
case WM_LBUTTONDOWN: {
|
||||||
RECT rt;
|
RECT rt;
|
||||||
int x = LOWORD(lParam);
|
int x = LOWORD(lParam);
|
||||||
|
|
||||||
GetClientRect(hWnd, &rt);
|
GetClientRect(hWnd, &rt);
|
||||||
if (x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
|
if (x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) {
|
||||||
last_split = pChildWnd->nSplitPos;
|
last_split = pChildWnd->nSplitPos;
|
||||||
#ifdef _NO_EXTENSIONS
|
|
||||||
draw_splitbar(hWnd, last_split);
|
draw_splitbar(hWnd, last_split);
|
||||||
#endif
|
|
||||||
SetCapture(hWnd);
|
SetCapture(hWnd);
|
||||||
}
|
}
|
||||||
break;}
|
break;}
|
||||||
|
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
if (GetCapture() == hWnd) {
|
if (GetCapture() == hWnd) {
|
||||||
#ifdef _NO_EXTENSIONS
|
|
||||||
RECT rt;
|
RECT rt;
|
||||||
int x = LOWORD(lParam);
|
int x = LOWORD(lParam);
|
||||||
draw_splitbar(hWnd, last_split);
|
draw_splitbar(hWnd, last_split);
|
||||||
|
@ -474,27 +314,20 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
GetClientRect(hWnd, &rt);
|
GetClientRect(hWnd, &rt);
|
||||||
pChildWnd->nSplitPos = x;
|
pChildWnd->nSplitPos = x;
|
||||||
ResizeWnd(pChildWnd, rt.right, rt.bottom);
|
ResizeWnd(pChildWnd, rt.right, rt.bottom);
|
||||||
#endif
|
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef _NO_EXTENSIONS
|
|
||||||
case WM_CAPTURECHANGED:
|
case WM_CAPTURECHANGED:
|
||||||
if (GetCapture()==hWnd && last_split>=0)
|
if (GetCapture()==hWnd && last_split>=0)
|
||||||
draw_splitbar(hWnd, last_split);
|
draw_splitbar(hWnd, last_split);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
if (wParam == VK_ESCAPE)
|
if (wParam == VK_ESCAPE)
|
||||||
if (GetCapture() == hWnd) {
|
if (GetCapture() == hWnd) {
|
||||||
RECT rt;
|
RECT rt;
|
||||||
#ifdef _NO_EXTENSIONS
|
|
||||||
draw_splitbar(hWnd, last_split);
|
draw_splitbar(hWnd, last_split);
|
||||||
#else
|
|
||||||
pChildWnd->nSplitPos = last_split;
|
|
||||||
#endif
|
|
||||||
GetClientRect(hWnd, &rt);
|
GetClientRect(hWnd, &rt);
|
||||||
ResizeWnd(pChildWnd, rt.right, rt.bottom);
|
ResizeWnd(pChildWnd, rt.right, rt.bottom);
|
||||||
last_split = -1;
|
last_split = -1;
|
||||||
|
@ -507,49 +340,19 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
if (GetCapture() == hWnd) {
|
if (GetCapture() == hWnd) {
|
||||||
RECT rt;
|
RECT rt;
|
||||||
int x = LOWORD(lParam);
|
int x = LOWORD(lParam);
|
||||||
|
|
||||||
#ifdef _NO_EXTENSIONS
|
|
||||||
HDC hdc = GetDC(hWnd);
|
HDC hdc = GetDC(hWnd);
|
||||||
GetClientRect(hWnd, &rt);
|
GetClientRect(hWnd, &rt);
|
||||||
|
|
||||||
rt.left = last_split-SPLIT_WIDTH/2;
|
rt.left = last_split-SPLIT_WIDTH/2;
|
||||||
rt.right = last_split+SPLIT_WIDTH/2+1;
|
rt.right = last_split+SPLIT_WIDTH/2+1;
|
||||||
InvertRect(hdc, &rt);
|
InvertRect(hdc, &rt);
|
||||||
|
|
||||||
last_split = x;
|
last_split = x;
|
||||||
rt.left = x-SPLIT_WIDTH/2;
|
rt.left = x-SPLIT_WIDTH/2;
|
||||||
rt.right = x+SPLIT_WIDTH/2+1;
|
rt.right = x+SPLIT_WIDTH/2+1;
|
||||||
InvertRect(hdc, &rt);
|
InvertRect(hdc, &rt);
|
||||||
|
|
||||||
ReleaseDC(hWnd, hdc);
|
ReleaseDC(hWnd, hdc);
|
||||||
#else
|
|
||||||
GetClientRect(hWnd, &rt);
|
|
||||||
|
|
||||||
if (x>=0 && x<rt.right) {
|
|
||||||
pChildWnd->nSplitPos = x;
|
|
||||||
ResizeWnd(pChildWnd, rt.right, rt.bottom);
|
|
||||||
rt.left = x-SPLIT_WIDTH/2;
|
|
||||||
rt.right = x+SPLIT_WIDTH/2+1;
|
|
||||||
InvalidateRect(hWnd, &rt, FALSE);
|
|
||||||
UpdateWindow(pChildWnd->left.hWnd);
|
|
||||||
UpdateWindow(hWnd);
|
|
||||||
UpdateWindow(pChildWnd->right.hWnd);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifndef _NO_EXTENSIONS
|
|
||||||
case WM_GETMINMAXINFO:
|
|
||||||
DefMDIChildProc(hWnd, message, wParam, lParam);
|
|
||||||
|
|
||||||
{LPMINMAXINFO lpmmi = (LPMINMAXINFO)lParam;
|
|
||||||
|
|
||||||
lpmmi->ptMaxTrackSize.x <<= 1;//2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN
|
|
||||||
lpmmi->ptMaxTrackSize.y <<= 1;//2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN
|
|
||||||
break;}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
SetCurrentDirectory(pChildWnd->szPath);
|
SetCurrentDirectory(pChildWnd->szPath);
|
||||||
SetFocus(pChildWnd->nFocusPanel? pChildWnd->right.hWnd: pChildWnd->left.hWnd);
|
SetFocus(pChildWnd->nFocusPanel? pChildWnd->right.hWnd: pChildWnd->left.hWnd);
|
||||||
|
@ -565,15 +368,6 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
/*
|
|
||||||
if (!SendMessage(pChildWnd->right.hWnd, message, wParam, lParam)) {
|
|
||||||
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
|
||||||
} else {
|
|
||||||
return _CmdWndProc(hWnd, message, wParam, lParam);
|
|
||||||
// return DefMDIChildProc(hWnd, message, wParam, lParam);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
if (_CmdWndProc(hWnd, message, wParam, lParam)) break;
|
if (_CmdWndProc(hWnd, message, wParam, lParam)) break;
|
||||||
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
||||||
|
|
||||||
|
@ -585,74 +379,12 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
// return _CmdWndProc(hWnd, message, wParam, lParam);
|
// return _CmdWndProc(hWnd, message, wParam, lParam);
|
||||||
// }
|
// }
|
||||||
break;
|
break;
|
||||||
/*
|
case WM_NOTIFY:
|
||||||
case WM_COMMAND:
|
|
||||||
{
|
{
|
||||||
Pane* pane = GetFocus()==pChildWnd->left.hWnd? &pChildWnd->left: &pChildWnd->right;
|
|
||||||
|
|
||||||
switch(HIWORD(wParam)) {
|
|
||||||
case LBN_SELCHANGE: {
|
|
||||||
int idx = ListBox_GetCurSel(pane->hWnd);
|
|
||||||
Entry* entry = (Entry*) ListBox_GetItemData(pane->hWnd, idx);
|
|
||||||
|
|
||||||
if (pane == &pChildWnd->left)
|
|
||||||
set_curdir(pChildWnd, entry);
|
|
||||||
else
|
|
||||||
pane->cur = entry;
|
|
||||||
break;}
|
|
||||||
|
|
||||||
case LBN_DBLCLK:
|
|
||||||
activate_entry(pChildWnd, pane);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WM_DISPATCH_COMMAND: {
|
|
||||||
Pane* pane = GetFocus()==pChildWnd->left.hWnd? &pChildWnd->left: &pChildWnd->right;
|
|
||||||
|
|
||||||
switch(LOWORD(wParam)) {
|
|
||||||
case ID_WINDOW_NEW_WINDOW:
|
|
||||||
//CreateChildWindow(pChildWnd->szPath);
|
|
||||||
CreateChildWindow(-1);
|
|
||||||
// {
|
|
||||||
// ChildWnd* new_child = alloc_child_window(pChildWnd->szPath);
|
|
||||||
// if (!create_child_window(new_child))
|
|
||||||
// free(new_child);
|
|
||||||
// }
|
|
||||||
break;
|
|
||||||
#if 0
|
|
||||||
case ID_REFRESH:
|
|
||||||
scan_entry(pChildWnd, pane->cur);
|
|
||||||
break;
|
|
||||||
case ID_ACTIVATE:
|
|
||||||
activate_entry(pChildWnd, pane);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case ID_WINDOW_CASCADE:
|
|
||||||
SendMessage(Globals.hMDIClient, WM_MDICASCADE, 0, 0);
|
|
||||||
break;
|
|
||||||
case ID_WINDOW_TILE_HORZ:
|
|
||||||
SendMessage(Globals.hMDIClient, WM_MDITILE, MDITILE_HORIZONTAL, 0);
|
|
||||||
break;
|
|
||||||
case ID_WINDOW_TILE_VERT:
|
|
||||||
SendMessage(Globals.hMDIClient, WM_MDITILE, MDITILE_VERTICAL, 0);
|
|
||||||
break;
|
|
||||||
case ID_WINDOW_ARRANGE_ICONS:
|
|
||||||
SendMessage(Globals.hMDIClient, WM_MDIICONARRANGE, 0, 0);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return pane_command(pane, LOWORD(wParam));
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;}
|
|
||||||
*/
|
|
||||||
//#ifndef _NO_EXTENSIONS
|
|
||||||
case WM_NOTIFY: {
|
|
||||||
int idCtrl = (int)wParam;
|
int idCtrl = (int)wParam;
|
||||||
//NMHDR* pnmh = (NMHDR*)lParam;
|
//NMHDR* pnmh = (NMHDR*)lParam;
|
||||||
//return pane_notify(pnmh->idFrom==IDW_HEADER_LEFT? &pChildWnd->left: &pChildWnd->right, pnmh);
|
//return pane_notify(pnmh->idFrom==IDW_HEADER_LEFT? &pChildWnd->left: &pChildWnd->right, pnmh);
|
||||||
if (idCtrl == IDW_TREE_LEFT) {
|
if ((int)wParam == IDW_TREE_LEFT) {
|
||||||
if ((((LPNMHDR)lParam)->code) == TVN_SELCHANGED) {
|
if ((((LPNMHDR)lParam)->code) == TVN_SELCHANGED) {
|
||||||
Entry* entry = (Entry*)((NMTREEVIEW*)lParam)->itemNew.lParam;
|
Entry* entry = (Entry*)((NMTREEVIEW*)lParam)->itemNew.lParam;
|
||||||
if (entry != NULL) {
|
if (entry != NULL) {
|
||||||
|
@ -664,19 +396,18 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
if (!SendMessage(pChildWnd->left.hWnd, message, wParam, lParam)) {
|
if (!SendMessage(pChildWnd->left.hWnd, message, wParam, lParam)) {
|
||||||
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
if (idCtrl == IDW_TREE_RIGHT) {
|
if ((int)wParam == IDW_TREE_RIGHT) {
|
||||||
if (!SendMessage(pChildWnd->right.hWnd, message, wParam, lParam)) {
|
if (!SendMessage(pChildWnd->right.hWnd, message, wParam, lParam)) {
|
||||||
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
return DefMDIChildProc(hWnd, message, wParam, lParam);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
if (wParam != SIZE_MINIMIZED) {
|
if (wParam != SIZE_MINIMIZED && pChildWnd != NULL) {
|
||||||
OnSize(pChildWnd, wParam, lParam);
|
ResizeWnd(pChildWnd, LOWORD(lParam), HIWORD(lParam));
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
default: def:
|
default: def:
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#else
|
#else
|
||||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
//#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -51,13 +51,17 @@
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Global Variables:
|
// Global and Local Variables:
|
||||||
//
|
//
|
||||||
|
|
||||||
BOOL bInMenuLoop = FALSE; // Tells us if we are in the menu loop
|
BOOL bInMenuLoop = FALSE; // Tells us if we are in the menu loop
|
||||||
int nOldWidth; // Holds the previous client area width
|
int nOldWidth; // Holds the previous client area width
|
||||||
int nOldHeight; // Holds the previous client area height
|
int nOldHeight; // Holds the previous client area height
|
||||||
|
|
||||||
|
static HHOOK hcbthook;
|
||||||
|
static ChildWnd* newchild = NULL;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Local module support methods
|
// Local module support methods
|
||||||
//
|
//
|
||||||
|
@ -110,8 +114,6 @@ void resize_frame_client(HWND hWnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
static HHOOK hcbthook;
|
|
||||||
static ChildWnd* newchild = NULL;
|
|
||||||
|
|
||||||
static LRESULT CALLBACK CBTProc(int code, WPARAM wParam, LPARAM lParam)
|
static LRESULT CALLBACK CBTProc(int code, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -486,7 +488,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT:
|
case ID_OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT:
|
||||||
if (Globals.Options & OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT) {
|
if (Globals.Options & OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT) {
|
||||||
Globals.Options &= ~OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT;
|
Globals.Options &= ~OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT;
|
||||||
CheckMenuItem(Globals.hMenuOptions, cmd, MF_CHECKED);
|
CheckMenuItem(Globals.hMenuOptions, cmd, MF_BYCOMMAND);
|
||||||
} else {
|
} else {
|
||||||
Globals.Options |= OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT;
|
Globals.Options |= OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT;
|
||||||
CheckMenuItem(Globals.hMenuOptions, cmd, MF_BYCOMMAND | MF_CHECKED);
|
CheckMenuItem(Globals.hMenuOptions, cmd, MF_BYCOMMAND | MF_CHECKED);
|
||||||
|
@ -495,7 +497,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_OPTIONS_MINIMISE_ON_USE:
|
case ID_OPTIONS_MINIMISE_ON_USE:
|
||||||
if (Globals.Options & ID_OPTIONS_MINIMISE_ON_USE) {
|
if (Globals.Options & ID_OPTIONS_MINIMISE_ON_USE) {
|
||||||
Globals.Options &= ~ID_OPTIONS_MINIMISE_ON_USE;
|
Globals.Options &= ~ID_OPTIONS_MINIMISE_ON_USE;
|
||||||
CheckMenuItem(Globals.hMenuOptions, cmd, MF_CHECKED);
|
CheckMenuItem(Globals.hMenuOptions, cmd, MF_BYCOMMAND);
|
||||||
} else {
|
} else {
|
||||||
Globals.Options |= ID_OPTIONS_MINIMISE_ON_USE;
|
Globals.Options |= ID_OPTIONS_MINIMISE_ON_USE;
|
||||||
CheckMenuItem(Globals.hMenuOptions, cmd, MF_BYCOMMAND | MF_CHECKED);
|
CheckMenuItem(Globals.hMenuOptions, cmd, MF_BYCOMMAND | MF_CHECKED);
|
||||||
|
@ -504,7 +506,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_OPTIONS_SAVE_ON_EXIT:
|
case ID_OPTIONS_SAVE_ON_EXIT:
|
||||||
if (Globals.Options & OPTIONS_SAVE_ON_EXIT) {
|
if (Globals.Options & OPTIONS_SAVE_ON_EXIT) {
|
||||||
Globals.Options &= ~OPTIONS_SAVE_ON_EXIT;
|
Globals.Options &= ~OPTIONS_SAVE_ON_EXIT;
|
||||||
CheckMenuItem(Globals.hMenuOptions, cmd, MF_CHECKED);
|
CheckMenuItem(Globals.hMenuOptions, cmd, MF_BYCOMMAND);
|
||||||
} else {
|
} else {
|
||||||
Globals.Options |= OPTIONS_SAVE_ON_EXIT;
|
Globals.Options |= OPTIONS_SAVE_ON_EXIT;
|
||||||
CheckMenuItem(Globals.hMenuOptions, cmd, MF_BYCOMMAND | MF_CHECKED);
|
CheckMenuItem(Globals.hMenuOptions, cmd, MF_BYCOMMAND | MF_CHECKED);
|
||||||
|
@ -716,7 +718,6 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
HMENU hMenuWindow = GetSubMenu(Globals.hMenuFrame, GetMenuItemCount(Globals.hMenuFrame)-2);
|
HMENU hMenuWindow = GetSubMenu(Globals.hMenuFrame, GetMenuItemCount(Globals.hMenuFrame)-2);
|
||||||
CLIENTCREATESTRUCT ccs = { hMenuWindow, IDW_FIRST_CHILD };
|
CLIENTCREATESTRUCT ccs = { hMenuWindow, IDW_FIRST_CHILD };
|
||||||
Globals.hMDIClient = CreateWindowEx(0, _T("MDICLIENT"), NULL,
|
Globals.hMDIClient = CreateWindowEx(0, _T("MDICLIENT"), NULL,
|
||||||
//WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|WS_HSCROLL|WS_VISIBLE|WS_BORDER,
|
|
||||||
WS_EX_MDICHILD|WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE,
|
WS_EX_MDICHILD|WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE,
|
||||||
0, 0, 0, 0,
|
0, 0, 0, 0,
|
||||||
hWnd, (HMENU)0, hInst, &ccs);
|
hWnd, (HMENU)0, hInst, &ccs);
|
||||||
|
@ -732,6 +733,7 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
if (MsgNotify(hWnd, message, wParam, lParam)) return TRUE;
|
if (MsgNotify(hWnd, message, wParam, lParam)) return TRUE;
|
||||||
// return MsgNotify(hWnd, message, wParam, lParam);
|
// return MsgNotify(hWnd, message, wParam, lParam);
|
||||||
switch (((LPNMHDR)lParam)->code) {
|
switch (((LPNMHDR)lParam)->code) {
|
||||||
|
#ifdef _MSC_VER
|
||||||
case TTN_GETDISPINFO:
|
case TTN_GETDISPINFO:
|
||||||
{
|
{
|
||||||
LPTOOLTIPTEXT lpttt;
|
LPTOOLTIPTEXT lpttt;
|
||||||
|
@ -741,6 +743,7 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
lpttt->lpszText = MAKEINTRESOURCE(lpttt->hdr.idFrom);
|
lpttt->lpszText = MAKEINTRESOURCE(lpttt->hdr.idFrom);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,10 +34,7 @@ extern "C" {
|
||||||
|
|
||||||
LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
|
LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
HWND CreateChildWindow(int drv_id);
|
HWND CreateChildWindow(int drv_id);
|
||||||
|
|
||||||
void resize_frame_client(HWND hWnd);
|
void resize_frame_client(HWND hWnd);
|
||||||
//BOOL activate_drive_window(LPCTSTR path);
|
|
||||||
//void toggle_child(HWND hWnd, UINT cmd, HWND hchild);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -35,9 +35,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
//#include <assert.h>
|
|
||||||
//#define ASSERT assert
|
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "listview.h"
|
#include "listview.h"
|
||||||
#include "dialogs.h"
|
#include "dialogs.h"
|
||||||
|
@ -51,6 +48,10 @@
|
||||||
|
|
||||||
static WNDPROC g_orgListWndProc;
|
static WNDPROC g_orgListWndProc;
|
||||||
|
|
||||||
|
#define MAX_LIST_COLUMNS 5
|
||||||
|
static int default_column_widths[MAX_LIST_COLUMNS] = { 175, 100, 100, 100, 70 };
|
||||||
|
static int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_RIGHT, LVCFMT_RIGHT, LVCFMT_RIGHT, LVCFMT_LEFT };
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Local module support methods
|
// Local module support methods
|
||||||
|
@ -98,10 +99,6 @@ static void InsertListEntries(HWND hWnd, Entry* entry, int idx)
|
||||||
ShowWindow(hWnd, SW_SHOW);
|
ShowWindow(hWnd, SW_SHOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_LIST_COLUMNS 5
|
|
||||||
static int default_column_widths[MAX_LIST_COLUMNS] = { 175, 100, 100, 100, 70 };
|
|
||||||
static int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_RIGHT, LVCFMT_RIGHT, LVCFMT_RIGHT, LVCFMT_LEFT };
|
|
||||||
|
|
||||||
static void CreateListColumns(HWND hWndListView)
|
static void CreateListColumns(HWND hWndListView)
|
||||||
{
|
{
|
||||||
TCHAR szText[50];
|
TCHAR szText[50];
|
||||||
|
@ -296,11 +293,7 @@ void RefreshList(HWND hWnd, Entry* entry)
|
||||||
|
|
||||||
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
UINT cmd = LOWORD(wParam);
|
switch (LOWORD(wParam)) {
|
||||||
//HWND hChildWnd;
|
|
||||||
|
|
||||||
if (1) {
|
|
||||||
switch (cmd) {
|
|
||||||
case ID_FILE_OPEN:
|
case ID_FILE_OPEN:
|
||||||
{
|
{
|
||||||
LVITEM item;
|
LVITEM item;
|
||||||
|
@ -314,7 +307,6 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ID_FILE_MOVE:
|
case ID_FILE_MOVE:
|
||||||
//OnFileMove(hWnd);
|
//OnFileMove(hWnd);
|
||||||
|
@ -354,7 +346,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_VIEW_SORT_BY_TYPE:
|
case ID_VIEW_SORT_BY_TYPE:
|
||||||
case ID_VIEW_SORT_BY_SIZE:
|
case ID_VIEW_SORT_BY_SIZE:
|
||||||
case ID_VIEW_SORT_BY_DATE:
|
case ID_VIEW_SORT_BY_DATE:
|
||||||
CmdSortItems(hWnd, cmd);
|
CmdSortItems(hWnd, LOWORD(wParam));
|
||||||
break;
|
break;
|
||||||
case ID_WINDOW_REFRESH:
|
case ID_WINDOW_REFRESH:
|
||||||
RefreshList(hWnd, NULL/*entry*/);
|
RefreshList(hWnd, NULL/*entry*/);
|
||||||
|
@ -362,12 +354,9 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
ChildWnd* child = (ChildWnd*)GetWindowLong(GetParent(hWnd), GWL_USERDATA);
|
ChildWnd* child = (ChildWnd*)GetWindowLong(GetParent(hWnd), GWL_USERDATA);
|
||||||
|
@ -395,6 +384,7 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
|
||||||
if (nmitem->hdr.hwndFrom != hWnd) break;
|
if (nmitem->hdr.hwndFrom != hWnd) break;
|
||||||
// if (nmitem->hdr.idFrom != IDW_LISTVIEW) break;
|
// if (nmitem->hdr.idFrom != IDW_LISTVIEW) break;
|
||||||
// if (nmitem->hdr.code != ???) break;
|
// if (nmitem->hdr.code != ???) break;
|
||||||
|
#ifdef _MSC_VER
|
||||||
switch (nmitem->uKeyFlags) {
|
switch (nmitem->uKeyFlags) {
|
||||||
case LVKF_ALT: // The ALT key is pressed.
|
case LVKF_ALT: // The ALT key is pressed.
|
||||||
// properties dialog box ?
|
// properties dialog box ?
|
||||||
|
@ -405,6 +395,7 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
|
||||||
case LVKF_SHIFT: // The SHIFT key is pressed.
|
case LVKF_SHIFT: // The SHIFT key is pressed.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
info.pt.x = nmitem->ptAction.x;
|
info.pt.x = nmitem->ptAction.x;
|
||||||
info.pt.y = nmitem->ptAction.y;
|
info.pt.y = nmitem->ptAction.y;
|
||||||
if (ListView_HitTest(hWnd, &info) != -1) {
|
if (ListView_HitTest(hWnd, &info) != -1) {
|
||||||
|
|
|
@ -95,10 +95,6 @@ TCHAR szChildClass[MAX_LOADSTRING];
|
||||||
//
|
//
|
||||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||||
{
|
{
|
||||||
// char TCHAR[MAX_PATH];
|
|
||||||
// int nParts[4];
|
|
||||||
// ChildWnd* child;
|
|
||||||
|
|
||||||
WNDCLASSEX wcFrame = {
|
WNDCLASSEX wcFrame = {
|
||||||
sizeof(WNDCLASSEX),
|
sizeof(WNDCLASSEX),
|
||||||
CS_HREDRAW | CS_VREDRAW/*style*/,
|
CS_HREDRAW | CS_VREDRAW/*style*/,
|
||||||
|
@ -157,7 +153,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||||
Globals.hMainWnd = CreateWindowEx(0, (LPCTSTR)(int)hFrameWndClass, szTitle,
|
Globals.hMainWnd = CreateWindowEx(0, (LPCTSTR)(int)hFrameWndClass, szTitle,
|
||||||
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
|
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||||
0/*hWndParent*/, hMenuFrame, hInstance, 0/*lpParam*/);
|
0/*hWndParent*/, hMenuFrame, hInstance, NULL/*lpParam*/);
|
||||||
if (!Globals.hMainWnd) {
|
if (!Globals.hMainWnd) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -320,13 +316,6 @@ SetParent (hWndEdit, Globals.hToolBar);
|
||||||
|
|
||||||
// Create the status bar panes
|
// Create the status bar panes
|
||||||
SetupStatusBar(FALSE);
|
SetupStatusBar(FALSE);
|
||||||
/*
|
|
||||||
nParts[0] = 250;
|
|
||||||
nParts[1] = 220;
|
|
||||||
nParts[2] = 100;
|
|
||||||
nParts[3] = 100;
|
|
||||||
SendMessage(Globals.hStatusBar, SB_SETPARTS, 4, (long)nParts);
|
|
||||||
*/
|
|
||||||
#if 0
|
#if 0
|
||||||
//Globals.hstatusbar = CreateStatusWindow(WS_CHILD|WS_VISIBLE, 0, Globals.Globals.hMainWnd, IDW_STATUSBAR);
|
//Globals.hstatusbar = CreateStatusWindow(WS_CHILD|WS_VISIBLE, 0, Globals.Globals.hMainWnd, IDW_STATUSBAR);
|
||||||
//CheckMenuItem(Globals.Globals.hMenuOptions, ID_OPTIONS_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
|
//CheckMenuItem(Globals.Globals.hMenuOptions, ID_OPTIONS_STATUSBAR, MF_BYCOMMAND|MF_CHECKED);
|
||||||
|
@ -355,16 +344,7 @@ SetParent (hWndEdit, Globals.hToolBar);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
Globals.hMDIClient = CreateWindowEx(0, _T("MDICLIENT"), NULL,
|
|
||||||
// Globals.hMDIClient = CreateWindowEx(0, (LPCTSTR)(int)hChildClass, NULL,
|
|
||||||
WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|WS_HSCROLL|WS_VISIBLE|WS_BORDER,
|
|
||||||
0, 0, 0, 0,
|
|
||||||
Globals.hMainWnd, 0, hInstance, &ccs);
|
|
||||||
if (!Globals.hMDIClient) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void SetupStatusBar(BOOL bResize)
|
void SetupStatusBar(BOOL bResize)
|
||||||
{
|
{
|
||||||
|
|
|
@ -189,6 +189,19 @@ extern TCHAR szChildClass[];
|
||||||
void SetupStatusBar(BOOL bResize);
|
void SetupStatusBar(BOOL bResize);
|
||||||
void UpdateStatusBar(void);
|
void UpdateStatusBar(void);
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
typedef struct tagNMITEMACTIVATE{
|
||||||
|
NMHDR hdr;
|
||||||
|
int iItem;
|
||||||
|
int iSubItem;
|
||||||
|
UINT uNewState;
|
||||||
|
UINT uOldState;
|
||||||
|
UINT uChanged;
|
||||||
|
POINT ptAction;
|
||||||
|
LPARAM lParam;
|
||||||
|
UINT uKeyFlags;
|
||||||
|
} NMITEMACTIVATE, FAR *LPNMITEMACTIVATE;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
};
|
};
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -47,13 +47,9 @@
|
||||||
|
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
// Global Variables:
|
|
||||||
extern HINSTANCE hInst;
|
|
||||||
|
|
||||||
|
|
||||||
// Global variables and constants
|
// Global variables and constants
|
||||||
// Image_Open, Image_Closed, and Image_Root - integer variables for
|
// Image_Open, Image_Closed, and Image_Root - integer variables for indexes of the images.
|
||||||
// indexes of the images.
|
|
||||||
// CX_BITMAP and CY_BITMAP - width and height of an icon.
|
// CX_BITMAP and CY_BITMAP - width and height of an icon.
|
||||||
// NUM_BITMAPS - number of bitmaps to add to the image list.
|
// NUM_BITMAPS - number of bitmaps to add to the image list.
|
||||||
int Image_Open;
|
int Image_Open;
|
||||||
|
@ -315,6 +311,22 @@ static BOOL InitTreeViewImageLists(HWND hwndTV)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
|
||||||
|
{
|
||||||
|
static int expanding;
|
||||||
|
|
||||||
|
Entry* entry = (Entry*)pnmtv->itemNew.lParam;
|
||||||
|
|
||||||
|
if (expanding) return FALSE;
|
||||||
|
expanding = TRUE;
|
||||||
|
if (entry) {
|
||||||
|
insert_tree_entries(hwndTV, entry->down, 0);
|
||||||
|
// insert_tree_entries(hwndTV, entry, 0);
|
||||||
|
}
|
||||||
|
expanding = FALSE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#define NMTVDISPINFO TV_DISPINFO
|
#define NMTVDISPINFO TV_DISPINFO
|
||||||
#define NMTVDISPINFO TV_DISPINFO
|
#define NMTVDISPINFO TV_DISPINFO
|
||||||
|
@ -342,27 +354,6 @@ static void OnGetDispInfo(NMTVDISPINFO* ptvdi)
|
||||||
ptvdi->item.cchTextMax = lstrlen(entry->data.cFileName);
|
ptvdi->item.cchTextMax = lstrlen(entry->data.cFileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
typedef struct tagTVITEM{
|
|
||||||
UINT mask;
|
|
||||||
HTREEITEM hItem;
|
|
||||||
UINT state;
|
|
||||||
UINT stateMask;
|
|
||||||
LPTSTR pszText;
|
|
||||||
int cchTextMax;
|
|
||||||
int iImage;
|
|
||||||
int iSelectedImage;
|
|
||||||
int cChildren;
|
|
||||||
LPARAM lParam;
|
|
||||||
} TVITEM, FAR *LPTVITEM;
|
|
||||||
|
|
||||||
TVITEM structure that identifies and contains information about the tree view item. The mask member of the TVITEM structure specifies which information is being set or retrieved. It can be one or more of the following values: TVIF_CHILDREN The cChildren member specifies, or is to receive, a value that indicates whether the item has child items.
|
|
||||||
TVIF_IMAGE The iImage member specifies, or is to receive, the index of the item's nonselected icon in the image list.
|
|
||||||
TVIF_SELECTEDIMAGE The iSelectedImage member specifies, or is to receive, the index of the item's selected icon in the image list.
|
|
||||||
TVIF_TEXT The pszText member specifies the new item text or the address of a buffer that is to receive the item text.
|
|
||||||
If the structure is receiving item text, you typically copy the text to the buffer pointed to by the pszText member of the TVITEM structure. However, you can return a string in the pszText member instead. If you do so, you cannot change or delete the string until the corresponding item text is deleted or until two additional TVN_GETDISPINFO notification messages have been sent.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
// OnEndLabelEdit - processes the LVN_ENDLABELEDIT notification message.
|
// OnEndLabelEdit - processes the LVN_ENDLABELEDIT notification message.
|
||||||
// Returns TRUE if the label is changed, or FALSE otherwise.
|
// Returns TRUE if the label is changed, or FALSE otherwise.
|
||||||
|
@ -381,48 +372,6 @@ static BOOL OnEndLabelEdit(NMTVDISPINFO* ptvdi)
|
||||||
// many characters in the field.
|
// many characters in the field.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static BOOL OnExpand(int flag, HTREEITEM* pti)
|
|
||||||
{
|
|
||||||
TRACE(_T("TreeWndProc(...) OnExpand()\n"));
|
|
||||||
// pnmtv = (NMTREEVIEW) lParam
|
|
||||||
//TRACE("OnExpand(...) entry name: %s\n", entry->data.cFileName);
|
|
||||||
/*
|
|
||||||
TVE_COLLAPSE Collapses the list.
|
|
||||||
TVE_COLLAPSERESET Collapses the list and removes the child items. The TVIS_EXPANDEDONCE state flag is reset. This flag must be used with the TVE_COLLAPSE flag.
|
|
||||||
TVE_EXPAND Expands the list.
|
|
||||||
TVE_EXPANDPARTIAL Version 4.70. Partially expands the list. In this state, the child items are visible and the parent item's plus symbol is displayed. This flag must be used in combination with the TVE_EXPAND flag.
|
|
||||||
TVE_TOGGLE Collapses the list if it is expanded or expands it if it is collapsed.
|
|
||||||
*/
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL OnExpanding(HWND hWnd, NMTREEVIEW* pnmtv)
|
|
||||||
{
|
|
||||||
static int expanding;
|
|
||||||
|
|
||||||
Entry* entry = (Entry*)pnmtv->itemNew.lParam;
|
|
||||||
|
|
||||||
TRACE(_T("TreeWndProc(...) OnExpanding() entry: %p\n"), entry);
|
|
||||||
|
|
||||||
if (expanding) return FALSE;
|
|
||||||
expanding = TRUE;
|
|
||||||
if (entry) {
|
|
||||||
insert_tree_entries(hWnd, entry->down, 0);
|
|
||||||
// insert_tree_entries(hWnd, entry, 0);
|
|
||||||
}
|
|
||||||
expanding = FALSE;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
static BOOL OnSelChanged(NMTREEVIEW* pnmtv)
|
|
||||||
{
|
|
||||||
LPARAM parm = pnmtv->itemNew.lParam;
|
|
||||||
ChildWnd* child = (ChildWnd*)pnmtv->itemNew.lParam;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void UpdateStatus(HWND hWnd, Entry* pEntry)
|
void UpdateStatus(HWND hWnd, Entry* pEntry)
|
||||||
{
|
{
|
||||||
int file_count = 0;
|
int file_count = 0;
|
||||||
|
@ -478,15 +427,14 @@ static LRESULT CALLBACK TreeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
|
||||||
#endif
|
#endif
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
switch (((LPNMHDR)lParam)->code) {
|
switch (((LPNMHDR)lParam)->code) {
|
||||||
case TVM_EXPAND:
|
// case TVM_EXPAND:
|
||||||
//return OnExpand((int)wParam, (HTREEITEM*)lParam);
|
// OnTreeExpand((int)wParam, (HTREEITEM*)lParam);
|
||||||
OnExpand((int)wParam, (HTREEITEM*)lParam);
|
// break;
|
||||||
break;
|
|
||||||
case TVN_GETDISPINFO:
|
case TVN_GETDISPINFO:
|
||||||
OnGetDispInfo((NMTVDISPINFO*)lParam);
|
OnGetDispInfo((NMTVDISPINFO*)lParam);
|
||||||
break;
|
break;
|
||||||
case TVN_ITEMEXPANDING:
|
case TVN_ITEMEXPANDING:
|
||||||
return OnExpanding(hWnd, (NMTREEVIEW*)lParam);
|
return OnTreeExpanding(hWnd, (NMTREEVIEW*)lParam);
|
||||||
break;
|
break;
|
||||||
case TVN_SELCHANGED:
|
case TVN_SELCHANGED:
|
||||||
|
|
||||||
|
@ -528,20 +476,18 @@ static LRESULT CALLBACK TreeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateTreeView - creates a tree view control.
|
// CreateTreeView - creates a tree view control.
|
||||||
// Returns the handle to the new control if successful,
|
// Returns the handle to the new control if successful, or NULL otherwise.
|
||||||
// or NULL otherwise.
|
|
||||||
// hwndParent - handle to the control's parent window.
|
// hwndParent - handle to the control's parent window.
|
||||||
|
|
||||||
static HWND CreateTreeView(HWND hwndParent, int id)
|
static HWND CreateTreeView(HWND hwndParent, int id)
|
||||||
{
|
{
|
||||||
RECT rcClient; // dimensions of client area
|
RECT rcClient;
|
||||||
HWND hwndTV; // handle to tree view control
|
HWND hwndTV;
|
||||||
|
|
||||||
// Get the dimensions of the parent window's client area, and create
|
// Get the dimensions of the parent window's client area, and create the tree view control.
|
||||||
// the tree view control.
|
|
||||||
GetClientRect(hwndParent, &rcClient);
|
GetClientRect(hwndParent, &rcClient);
|
||||||
hwndTV = CreateWindowEx(0, WC_TREEVIEW, _T("Tree View"),
|
hwndTV = CreateWindowEx(0, WC_TREEVIEW, _T("Tree View"),
|
||||||
WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
|
WS_VISIBLE | WS_CHILD | WS_BORDER | WS_EX_CLIENTEDGE | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
|
||||||
0, 0, rcClient.right, rcClient.bottom,
|
0, 0, rcClient.right, rcClient.bottom,
|
||||||
hwndParent, (HMENU)id, hInst, NULL);
|
hwndParent, (HMENU)id, hInst, NULL);
|
||||||
// Initialize the image list, and add items to the control.
|
// Initialize the image list, and add items to the control.
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
#include <defines.h>
|
||||||
|
#include <reactos/resource.h>
|
||||||
|
|
||||||
//Microsoft Developer Studio generated resource script.
|
//Microsoft Developer Studio generated resource script.
|
||||||
//
|
//
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
@ -529,8 +532,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,0,1
|
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
|
||||||
PRODUCTVERSION 1,0,0,1
|
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -543,10 +546,10 @@ VS_VERSION_INFO VERSIONINFO
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "0c0904b0"
|
BLOCK "040904b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Comments", "Absolutely no warranties whatsoever - Use at your own risk\0"
|
VALUE "Comments", "Absolutely no warranties whatsoever - Use at your own risk\0"
|
||||||
VALUE "CompanyName", "ReactWare\0"
|
VALUE "CompanyName", RES_STR_COMPANY_NAME
|
||||||
VALUE "FileDescription", "ReactOS File Manager by Robert Dickenson\0"
|
VALUE "FileDescription", "ReactOS File Manager by Robert Dickenson\0"
|
||||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||||
VALUE "InternalName", "winfile\0"
|
VALUE "InternalName", "winfile\0"
|
||||||
|
@ -554,8 +557,8 @@ BEGIN
|
||||||
VALUE "LegalTrademarks", "\0"
|
VALUE "LegalTrademarks", "\0"
|
||||||
VALUE "OriginalFilename", "winfile.exe\0"
|
VALUE "OriginalFilename", "winfile.exe\0"
|
||||||
VALUE "PrivateBuild", "\0"
|
VALUE "PrivateBuild", "\0"
|
||||||
VALUE "ProductName", "ReactOS File Manager\0"
|
VALUE "ProductName", RES_STR_PRODUCT_NAME
|
||||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
|
||||||
VALUE "SpecialBuild", "Non-versioned Development Beta Release\0"
|
VALUE "SpecialBuild", "Non-versioned Development Beta Release\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -572,7 +575,7 @@ END
|
||||||
//
|
//
|
||||||
// Accelerator
|
// Accelerator
|
||||||
//
|
//
|
||||||
|
#ifdef _MSC_VER
|
||||||
IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE
|
IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
"+", ID_DISK_SELECT_DRIVE, ASCII, NOINVERT
|
"+", ID_DISK_SELECT_DRIVE, ASCII, NOINVERT
|
||||||
|
@ -591,7 +594,7 @@ BEGIN
|
||||||
VK_RETURN, ID_FILE_PROPERTIES, VIRTKEY, ALT, NOINVERT
|
VK_RETURN, ID_FILE_PROPERTIES, VIRTKEY, ALT, NOINVERT
|
||||||
VK_SUBTRACT, ID_TREE_EXPAND_ALL, VIRTKEY, NOINVERT
|
VK_SUBTRACT, ID_TREE_EXPAND_ALL, VIRTKEY, NOINVERT
|
||||||
END
|
END
|
||||||
|
#endif // _MSC_VER
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
|
155
rosapps/winfile/worker.c
Normal file
155
rosapps/winfile/worker.c
Normal file
|
@ -0,0 +1,155 @@
|
||||||
|
/*
|
||||||
|
* ReactOS winfile
|
||||||
|
*
|
||||||
|
* worker.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#include "stdafx.h"
|
||||||
|
#else
|
||||||
|
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
#include <windows.h>
|
||||||
|
#include <commctrl.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <memory.h>
|
||||||
|
#include <tchar.h>
|
||||||
|
#include <process.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <windowsx.h>
|
||||||
|
#include <process.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#define ASSERT assert
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
#include "worker.h"
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Global Variables:
|
||||||
|
//
|
||||||
|
|
||||||
|
static HANDLE hMonitorThreadEvent = NULL; // When this event becomes signaled then we run the monitor thread
|
||||||
|
|
||||||
|
void MonitorThreadProc(void *lpParameter);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Local module support methods
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
LRESULT CALLBACK MoveDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
HWND hLicenseEditWnd;
|
||||||
|
TCHAR strLicense[0x1000];
|
||||||
|
|
||||||
|
switch (message) {
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
hLicenseEditWnd = GetDlgItem(hDlg, IDC_LICENSE_EDIT);
|
||||||
|
LoadString(hInst, IDS_LICENSE, strLicense, 0x1000);
|
||||||
|
SetWindowText(hLicenseEditWnd, strLicense);
|
||||||
|
return TRUE;
|
||||||
|
case WM_COMMAND:
|
||||||
|
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) {
|
||||||
|
EndDialog(hDlg, LOWORD(wParam));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void StartWorkerThread(HWND hWnd)
|
||||||
|
{
|
||||||
|
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, (DLGPROC)MoveDialogWndProc);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void MonitorThreadProc(void *lpParameter)
|
||||||
|
{
|
||||||
|
// ULONG OldProcessorUsage = 0;
|
||||||
|
// ULONG OldProcessCount = 0;
|
||||||
|
HWND hWnd = (HWND)lpParameter;
|
||||||
|
|
||||||
|
// Create the event
|
||||||
|
hMonitorThreadEvent = CreateEvent(NULL, TRUE, TRUE, "Winfile Monitor Event");
|
||||||
|
|
||||||
|
// If we couldn't create the event then exit the thread
|
||||||
|
if (!hMonitorThreadEvent)
|
||||||
|
return;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
DWORD dwWaitVal;
|
||||||
|
|
||||||
|
// Wait on the event
|
||||||
|
dwWaitVal = WaitForSingleObject(hMonitorThreadEvent, INFINITE);
|
||||||
|
|
||||||
|
// If the wait failed then the event object must have been
|
||||||
|
// closed and the task manager is exiting so exit this thread
|
||||||
|
if (dwWaitVal == WAIT_FAILED) {
|
||||||
|
// CloseHandle(hMonitorThreadEvent); // Should we close the event object handle or not ???
|
||||||
|
// hMonitorThreadEvent = NULL; // if we do then check what happens when main thread tries to delete it also....
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dwWaitVal == WAIT_OBJECT_0) {
|
||||||
|
// Reset our event
|
||||||
|
ResetEvent(hMonitorThreadEvent);
|
||||||
|
#if 0
|
||||||
|
TCHAR text[260];
|
||||||
|
if ((ULONG)SendMessage(hProcessPageListCtrl, LVM_GETITEMCOUNT, 0, 0) != PerfDataGetProcessCount())
|
||||||
|
SendMessage(hProcessPageListCtrl, LVM_SETITEMCOUNT, PerfDataGetProcessCount(), /*LVSICF_NOINVALIDATEALL|*/LVSICF_NOSCROLL);
|
||||||
|
if (IsWindowVisible(hProcessPage))
|
||||||
|
InvalidateRect(hProcessPageListCtrl, NULL, FALSE);
|
||||||
|
if (OldProcessorUsage != PerfDataGetProcessorUsage()) {
|
||||||
|
OldProcessorUsage = PerfDataGetProcessorUsage();
|
||||||
|
wsprintf(text, _T("CPU Usage: %3d%%"), OldProcessorUsage);
|
||||||
|
SendMessage(hStatusWnd, SB_SETTEXT, 1, (LPARAM)text);
|
||||||
|
}
|
||||||
|
if (OldProcessCount != PerfDataGetProcessCount()) {
|
||||||
|
OldProcessCount = PerfDataGetProcessCount();
|
||||||
|
wsprintf(text, _T("Processes: %d"), OldProcessCount);
|
||||||
|
SendMessage(hStatusWnd, SB_SETTEXT, 0, (LPARAM)text);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL CreateMonitorThread(HWND hWnd)
|
||||||
|
{
|
||||||
|
_beginthread(MonitorThreadProc, 0, hWnd);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SignalMonitorEvent(void)
|
||||||
|
{
|
||||||
|
SetEvent(hMonitorThreadEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL DestryMonitorThread(void)
|
||||||
|
{
|
||||||
|
CloseHandle(hMonitorThreadEvent);
|
||||||
|
hMonitorThreadEvent = NULL;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
43
rosapps/winfile/worker.h
Normal file
43
rosapps/winfile/worker.h
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* ReactOS winfile
|
||||||
|
*
|
||||||
|
* worker.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __WORKER_H__
|
||||||
|
#define __WORKER_H__
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void StartWorkerThread(HWND hWnd);
|
||||||
|
//void StopWorkerThread(HWND hWnd);
|
||||||
|
|
||||||
|
BOOL CreateMonitorThread(HWND hWnd);
|
||||||
|
void SignalMonitorEvent(void);
|
||||||
|
BOOL DestryMonitorThread(void);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // __WORKER_H__
|
Loading…
Reference in a new issue