handle

How to make a program not show up in Alt-Tab or on the taskbar

≯℡__Kan透↙ 提交于 2019-12-05 00:50:17
I have a program that needs to sit in the background and when a user connects to a RDP session it will do some environment setup then launch a program. When the program is closed it will do some housekeeping and logoff the session. The current way I am doing it is I have the terminal server launch this application. This is built as a windows forms application to keep the console window from showing up: public static void Main() { //(Snip...) Do some setup work Process proc = new Process(); //(Snip...) Setup the process proc.Start(); proc.WaitForExit(); //(Snip...) Do some housecleaning

parfor and handle classes

心已入冬 提交于 2019-12-04 22:39:08
问题 I have a handle class: classdef A<handle properties a; end methods function obj = A(a) obj.a=a; end end end And I have a cell array of A objects: arr={}; for i=1:3 arr{i}=A(i); end What I would like to do is pass that cell array to a parfor loop so that each object's value will change: parfor i=1:3 arr{i}.a=i*5; end However, this code does not change arr at all. Indeed, here it states that Changes made to handle classes on the workers during loop iterations are not automatically propagated to

Python: win32gui.SetForegroundWindow

蹲街弑〆低调 提交于 2019-12-04 19:37:34
I have just written simple script to launch an applciation and I am trying to use "SendKeys" module to send keystrokes to this application. There is one "Snapshot" button, but I cant get Python to click "Snapshot" button, as the new window is not in focus. So I am planning to use Win32gui module's win32gui.FindWindow and win32gui.SetForegroundWindow functionality. But it gives me error- invalid handle . My app name is "DMCap" Here is code snippet in Python: handle = win32gui.FindWindow(0, "DMCap") //paassing 0 as I dont know classname win32gui.SetForegroundWindow(handle) //put the window in

JQuery UI Slider with Multiple handles: How to stop the handles from crossing?

一曲冷凌霜 提交于 2019-12-04 17:49:58
I'm developing a quick solution that uses a Slider with multiple handles to define widths for a dynamic layout. I've attempted to use both ExtJS3 and the latest JQuery UI. In ExtJS, you can constrain the handles so the don't cross over each other, and it's quite an intuitive approach to the UI I need, however there are reasons why I would rather not use ExtJS for one 'island' in a sea of JQuery. So, does anyone know of a secret attribute, or a bit of code that constrains multiple handles in the JQuery slider ? For clarity: if you have a slider with 2 handles, one at 40 and one at 60; the

How do i mock a method that accepts a handle as an argument in OCMock?

爱⌒轻易说出口 提交于 2019-12-04 15:57:52
问题 I'm trying to mock a method that has the equivalent of the following signature: - (NSDictionary *) uploadValues:(BOOL)doSomething error:(NSError **)error I want it to return a small dictionary so that my test can make sure the code uses the dictionary properly. however, no matter what i do OCMock always returns nil from the method, regardless of how i stub it out. The error begins as nil in the code i'm testing, and these are the different ways i've tried stubbing it: NSError * error = nil; [

Is it possible to get the Hwnd of a WPF Popup control?

大城市里の小女人 提交于 2019-12-04 07:29:56
I need to apply an Aero background blur to only part of a custom-shaped WPF window. The problem is that to apply the blur with DWM, I need to provide a window handle to the DwmEnableBlurBehindWindow function. I have been told that the WPF popup control is actually a separate window. That is good. Can I get a popup's handle to apply blur to it? If so, how? Try this HwndSource source = (HwndSource)HwndSource.FromVisual(myPopup) or this but this one only works for actual Windows, but might help for future references. IntPtr handle = new WindowInteropHelper(myWindow).Handle; Cleber Try this:

GDI handles in a DotNET application

走远了吗. 提交于 2019-12-04 06:31:01
My pure DotNET library runs as a plugin inside an unmanaged desktop application. I've been getting a steady (though low) stream of crash reports that seem to indicate a problem with GDI handles (fonts in error messages etc. revert to the system font, display of all sorts of controls break down, massive crash shortly after). My Forms have few controls, but I do a lot of GDI+ drawing in User controls. What's a good way to tell how many handles I'm using, or even leaking? Thanks, David I've had to deal with the same kind of problem in the past. In order to inspect how many GDI objects your

powershell 'system.windows.media.mediaplayer' Register-ObjectEvent

跟風遠走 提交于 2019-12-04 05:27:35
问题 I'm trying to use the 'system.windows.media.mediaplayer' media player, to play a list of sound files, however I'm having trouble getting the media player to know when to play the next sound file. I'm trying to use the 'MediaEnded' event handle to work out when the sound file has ended, then move onto the next sound file. But I can't get the event handle to fire properly, could someone show me where I'm going wrong please? This is the code I'm using: Add-Type -AssemblyName presentationCore

cleaning nullptr in one-to-many relation that use custom weak pointer

我们两清 提交于 2019-12-04 05:26:46
I have a one-to-many map class - MyMap1N<WeakPtr_Parent,WeakPtr_Children> . By design, it is supposed to store weak pointers of game-related instance. Roughly speaking, it is called like :- MyMap1N<WeakPtr<Room>,WeakPtr<RigidBody>> map; WeakPtr<Room> room=create<Room>(); WeakPtr<RigidBody> body=create<RigidBody>(); map.add(room,body); MyArray<WeakPtr<RigidBody>> bodys=map.getAllChildren(room); By profiling, I found that std::unordered_map is too slow. Thus, I had to find another way to implement it. I decided to create an array (instead of unordered_map ) in Room . To increase speed of query,

Do I need a WOW64 dump for GDI Handle analysis?

三世轮回 提交于 2019-12-04 05:04:05
I'm debugging a potential GDI Handle Leak. Thanks to @Alois Kraus , there is a WinDbg script which performs a handle count. From my debugging sessions, especially for .NET , I find that usually, it's better to have 32-bit dumps of 32-bit processes and 64-bit dumps of 64-bit processes. Unfortunately, with 2 crash dumps I received, the script does not work. Looking deeper into it, I found out that the GdiSharedHandleTable is null in those dumps: 0:000> dt ntdll!_PEB GdiSharedHandleTable @$peb +0x094 GdiSharedHandleTable : (null) Now, on his website , Alois mentions Important: If you are running