mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 06:08:05 +02:00
Merge pull request #16127 from amerhifi/master
case DEV-492: Ensure launcher cannot be pinned
This commit is contained in:
commit
b3c7ca6e8f
3 changed files with 18 additions and 2 deletions
|
@ -13,6 +13,8 @@
|
||||||
#include "LauncherApp.h"
|
#include "LauncherApp.h"
|
||||||
#include "LauncherDlg.h"
|
#include "LauncherDlg.h"
|
||||||
|
|
||||||
|
#include <propsys.h>
|
||||||
|
#include <propkey.h>
|
||||||
#include <d2d1.h>
|
#include <d2d1.h>
|
||||||
#pragma comment(lib, "d2d1")
|
#pragma comment(lib, "d2d1")
|
||||||
|
|
||||||
|
@ -84,7 +86,7 @@ END_MESSAGE_MAP()
|
||||||
|
|
||||||
BOOL CLauncherDlg::OnInitDialog() {
|
BOOL CLauncherDlg::OnInitDialog() {
|
||||||
CDialog::OnInitDialog();
|
CDialog::OnInitDialog();
|
||||||
|
MarkWindowAsUnpinnable();
|
||||||
SetIcon(m_hIcon, TRUE); // Set big icon
|
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||||
|
|
||||||
|
@ -129,6 +131,19 @@ BOOL CLauncherDlg::OnInitDialog() {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CLauncherDlg::MarkWindowAsUnpinnable() {
|
||||||
|
HWND hwnd = AfxGetMainWnd()->m_hWnd;
|
||||||
|
IPropertyStore* pps;
|
||||||
|
HRESULT hr = SHGetPropertyStoreForWindow(hwnd, IID_PPV_ARGS(&pps));
|
||||||
|
if (SUCCEEDED(hr)) {
|
||||||
|
PROPVARIANT var;
|
||||||
|
var.vt = VT_BOOL;
|
||||||
|
var.boolVal = VARIANT_TRUE;
|
||||||
|
hr = pps->SetValue(PKEY_AppUserModel_PreventPinning, var);
|
||||||
|
pps->Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
POINT CLauncherDlg::getMouseCoords(MSG* pMsg) {
|
POINT CLauncherDlg::getMouseCoords(MSG* pMsg) {
|
||||||
POINT pos;
|
POINT pos;
|
||||||
pos.x = (int)(short)LOWORD(pMsg->lParam);
|
pos.x = (int)(short)LOWORD(pMsg->lParam);
|
||||||
|
|
|
@ -59,6 +59,7 @@ protected:
|
||||||
BOOL getTextFormat(int ResID, TextFormat& formatOut);
|
BOOL getTextFormat(int ResID, TextFormat& formatOut);
|
||||||
void showWindows(std::vector<CStatic*> windows, bool show);
|
void showWindows(std::vector<CStatic*> windows, bool show);
|
||||||
POINT getMouseCoords(MSG* pMsg);
|
POINT getMouseCoords(MSG* pMsg);
|
||||||
|
void MarkWindowAsUnpinnable();
|
||||||
|
|
||||||
|
|
||||||
bool _isConsoleRunning { false };
|
bool _isConsoleRunning { false };
|
||||||
|
|
|
@ -150,7 +150,7 @@ BOOL LauncherUtils::launchApplication(LPCWSTR lpApplicationName, LPTSTR cmdArgs)
|
||||||
ZeroMemory(&si, sizeof(si));
|
ZeroMemory(&si, sizeof(si));
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
ZeroMemory(&pi, sizeof(pi));
|
ZeroMemory(&pi, sizeof(pi));
|
||||||
|
|
||||||
// start the program up
|
// start the program up
|
||||||
BOOL success = CreateProcess(
|
BOOL success = CreateProcess(
|
||||||
lpApplicationName, // the path
|
lpApplicationName, // the path
|
||||||
|
|
Loading…
Reference in a new issue