Skip to content

How to retrieve AppxManifest from a process? #505

Answered by Far-Se
Far-Se asked this question in Q&A
Discussion options

You must be logged in to vote

Did it today:

// ignore_for_file: non_constant_identifier_names

import 'dart:async';
import 'dart:ffi';
import 'package:ffi/ffi.dart';

import 'package:win32/win32.dart';

class AppxNamePath {
  bool? hasManifest;
  String? name;
  String? path;
}

class HwndPath {
  bool hasManifest = true;
  HwndPath();
  AppxNamePath GetAppxInstallLocation(hWnd) {
    //Ger Process Handle
    final ppID = calloc<Uint32>();
    GetWindowThreadProcessId(hWnd, ppID);
    var process = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, ppID.value);
    free(ppID);

    //Get Text
    final cMax = calloc<Uint32>()..value = 512;
    var cAppName = wsalloc(cMax.value);
    GetApplicationUserModelId(proces…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Far-Se
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #502 on June 13, 2022 20:19.