Skip to content

Commit

Permalink
so real
Browse files Browse the repository at this point in the history
  • Loading branch information
freedom7341 committed Oct 22, 2024
1 parent b679f71 commit 8f6af5b
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
57 changes: 54 additions & 3 deletions progmgr/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ BOOL ExecuteItem(_In_ PITEM pi)
// TODO: if item has run as admin as a flag,
// run it as an admin

// TODO: if path is invalid or other error then tell the user

// TODO: make sure environment is
// refreshed before execution
return FALSE;
Expand Down Expand Up @@ -585,7 +587,15 @@ LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
pCreateStruct = (CREATESTRUCT*)lParam;
pMDICreateStruct = (MDICREATESTRUCT*)pCreateStruct->lpCreateParams;

return 0;
return DefMDIChildProc(hWnd, message, wParam, lParam);
}

case WM_SYSCOMMAND:
{
if (CmdProc(hWnd, wParam, lParam))
return 0;

return DefMDIChildProc(hWnd, message, wParam, lParam);
}

case WM_CONTEXTMENU:
Expand Down Expand Up @@ -643,8 +653,10 @@ LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
break;
}

default:
break;
}
return 0;
return DefMDIChildProc(hWnd, message, wParam, lParam);
}

case WM_SIZE:
Expand Down Expand Up @@ -673,5 +685,44 @@ LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
return DefMDIChildProc(hWnd, message, wParam, lParam);
}

return TRUE;
return DefMDIChildProc(hWnd, message, wParam, lParam);
}

/* * * *\
GroupCmdProc -
Group syscommand procedure.
RETURNS -
Zero if nothing, otherwise returns the good stuff.
\* * * */
LRESULT CALLBACK GroupCmdProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
switch (GET_WM_COMMAND_ID(wParam, lParam))
{
case IDM_FILE_OPEN:
// TODO: ITEM Get currently selected item(s) from listview and open them
break;

case IDM_FILE_MOVE:
// TODO: ITEM Create dialog with other MDI groups, pick one to move item
break;

case IDM_FILE_COPY:
// TODO: ITEM Copy item structure to clipboard
break;

case IDM_FILE_DELETE:
// TODO: ITEM/GROUP Delete selected item, if no items selected or no items
// exist then delete the group
break;

case IDM_FILE_PROPS:
// TODO: ITEM/GROUP Open properties of selected item or if nothing selected
// then open group properties
break;

default:
return 0;
}

return 0;
}
1 change: 1 addition & 0 deletions progmgr/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ HWND GetHwndFromPGroup(_In_ PGROUP pg);
BOOL GetHwndFromPGroupEnum(_In_ HWND hwnd, _In_ LPARAM lParam);
// Group Window
LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK GroupCmdProc(HWND hWnd, WPARAM wParam, LPARAM lParam);
11 changes: 11 additions & 0 deletions progmgr/wndproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ LRESULT CALLBACK CmdProc(HWND hWnd, WPARAM wParam, LPARAM lParam)
DialogBox(g_hAppInstance, MAKEINTRESOURCE(DLG_ITEM), hWnd, (DLGPROC)NewItemDlgProc);
break;

case IDM_FILE_OPEN:
case IDM_FILE_MOVE:
case IDM_FILE_COPY:
case IDM_FILE_DELETE:
case IDM_FILE_PROPS:
{
SendMessage((HWND)SendMessage(hWnd, WM_MDIGETACTIVE, NULL, NULL), WM_COMMAND, wParam, lParam);

break;
}

case IDM_FILE_RUN:
RunFileDlg(hWnd, NULL, NULL, NULL, NULL, RFF_CALCDIRECTORY);
break;
Expand Down

0 comments on commit 8f6af5b

Please sign in to comment.