Skip to content

Commit

Permalink
vista+ compatibility part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
freedom7341 committed Oct 21, 2023
1 parent e7bcb43 commit 000ecc5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
1 change: 0 additions & 1 deletion progmgr/desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ LRESULT CALLBACK DeskWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
break;

case WM_ACTIVATE:
case WM_DPICHANGED:
case WM_DISPLAYCHANGE:
case WM_DEVICECHANGE:
// Get size of the root HWND
Expand Down
2 changes: 1 addition & 1 deletion progmgr/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "resource.h"
// #define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <pathcch.h>
#include <Commctrl.h>
#include <Shlobj.h>
#include <shlwapi.h>
#include <strsafe.h>
Expand Down
31 changes: 11 additions & 20 deletions progmgr/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ PITEM CreateItem(_In_ HWND hWndGroup, _In_ PITEM pi)
HICON hIcon = NULL;
LVITEM lvi = { 0 };
PGROUP pGroup = NULL;
PGROUP pNewGroup = NULL;
PITEM pItem = NULL;
UINT uiTest = 0;
HWND hWndListView = NULL;
Expand All @@ -260,16 +261,12 @@ PITEM CreateItem(_In_ HWND hWndGroup, _In_ PITEM pi)
if (hWndListView == NULL)
return NULL;

// compare group's existing memory to needed memory
// if needed, reallocate the group's memory
if (_msize(pGroup) != CalculateGroupMemory(pGroup, 1))
// if we reallocate memory then send the new pointer in
pNewGroup = realloc(pGroup, CalculateGroupMemory(pGroup, 1));
if (pNewGroup != NULL)
{
// if we reallocate memory then send the new pointer in
PGROUP pNewGroup = realloc(pGroup, CalculateGroupMemory(pGroup, 1));
if (pNewGroup != NULL) {
pGroup = pNewGroup;
SetWindowLongPtr(hWndGroup, GWLP_USERDATA, (LONG_PTR)pGroup);
}
pGroup = pNewGroup;
SetWindowLongPtr(hWndGroup, GWLP_USERDATA, (LONG_PTR)pGroup);
}

// add the item
Expand Down Expand Up @@ -356,21 +353,15 @@ BOOL ExecuteItem(_In_ PITEM pi)
\* * * */
VOID UpdateGroup(_In_ PGROUP pg)
{
GROUP grp = {
.dwSignature = GRP_SIGNATURE,
.wVersion = GRP_VERSION,
.wChecksum = 0,
.szName = TEXT(""),
.dwFlags = 0,
.ftLastWrite = 0,
.cItemArray = 0,
.pItemArray = 0
};
// Set the important flags
pg->dwSignature = GRP_SIGNATURE;
pg->wVersion = GRP_VERSION;

// Set the group checksum
pg->wChecksum = 1; // NOTE: implement this for real later lol

// TODO: set group flags
// TODO: set name and group flags
// pg->szName = GetWindowText(blah blah blah);
// pg->dwFlags = GRP_FLAG_MAXIMIZED;// GetGroupFlags(pgw);

// Set FILETIME
Expand Down

0 comments on commit 000ecc5

Please sign in to comment.