hook

xunit add info to output

故事扮演 提交于 2019-12-05 04:35:40
Does anyone know how to add additional info to the output console when running xUnit tests? I'm using testdriven.net, but I don't think that is where my answer lies. I am using a IUseFixture (actually IClassFixture from 2.0) to maintain data between tests. When a test fails I want to output some of that contextual data along with the failure and the stack trace that you usually get. Does anyone know of a hook I can use? n-develop You can use ITestOutputHelper to write any output to the test result view. Just let xUnit inject it into your constructor. using Xunit; using Xunit.Abstractions;

Why would Windows hooks not receive certain messages?

非 Y 不嫁゛ 提交于 2019-12-05 04:17:56
Microsoft does not recommend DirectInput for keyboard and mouse input. As such, I've written an input manager class that uses SetWindowsHookEx to hook into WndProc and GetMsg. I believe the hooks are set appropriately, though they look to be the cause of various issues. Neither my WndProc nor GetMsg hooks receive any of the messages that the actual WndProc is receiving. My input manager never receives the WM_INPUT, WM_ BUTTON , WM_MOUSEWHEEL, and WM_KEY* messages that it needs. What gives? Partial header: namespace InputManager { class CInputManager { HWND m_Window; HHOOK m_WndProcHook; HHOOK

Custom hooks in WordPress across plugins

一个人想着一个人 提交于 2019-12-05 03:53:19
I'm trying to create a hook in one Wordpress plugin that could be used by other plugins. First off, is this even possible? I'm also sending some additional args so this may be 2 questions in one since I've been having trouble finding definitive information on how to do this. Here is what I've tried so far: In the plugin that is creating the hook (call it Plugin 1) I added: do_action('plugin1_hook', $customArg1, $customArg2, $customArg3); at the point that I want the hook to fire. Then, in a different plugin (Plugin 2), I added: add_action('plugin1_hook', 'my_function'); and function my

Closing a hook that captures global input events

六眼飞鱼酱① 提交于 2019-12-05 02:57:24
问题 Intro Here is an example to illustrate the problem. Consider I am tracking and displaying mouse global current position and last click button and position to the user. Here is an image: To archive capturing click events on windows box, that would and will be sent to the other programs event messaging queue, I create a hook using winapi namely user32.dll library. This is outside JDK sandbox, so I use JNA to call the native library. This all works perfectly, but it does not close as I expect it

Changing margin for emacs text-mode

半城伤御伤魂 提交于 2019-12-05 02:01:22
问题 The only way I found to change margins in emacs to my liking without things acting funny is this: (add-hook 'window-configuration-change-hook (lambda () (set-window-margins (car (get-buffer-window-list (current-buffer) nil t)) 24 24))) I would like for this setting to be invoked only in text-mode and change back when I change to other modes. Somewhat naively I tried this: (add-hook 'text-mode-hook (lambda () (set-window-margins (car (get-buffer-window-list (current-buffer) nil t)) 24 24)))

drupal中hook_menu()使用

拈花ヽ惹草 提交于 2019-12-05 01:44:10
hook_menu()钩子可以让模块来注册如何处理URL请求的路径,路径可以只使用来处理URL请求,也可以注册一个链接作为导航菜单。一个路径和它对应的信息通常被叫做“菜单路由项”(menu router item),这个钩子很少被使用(例如在新的模块被启用的时候),结果被缓存在数据库中。 hook_menu()钩子的实现通常返回一个关联数组,它的的键值就是路径,它的值就是一组相关属性的关联数组。它的返回值主要包括以下字段: title :必填项,菜单项的标题 title callback:用来创建标题的回调函数,默认使用t()函数翻译,如果想使用原字符,设置为false title arguments:传递给t()函数的参数或者自定义的回调函数 description :菜单项的说明 page callback :用户访问URL地址时显示页面的回调函数,如果未设置,则使用父菜单项的回调函数。例如我们设置了菜单项bar/foo <code> function test_menu() { $items['bar/foo'] = array( 'page callback' => 'test_abc_view', ); return $items; } function test_abc_view($ghi = 0, $jkl = '') { // ... } </code>

How to add MS outlook reminders event handlers with VBA

白昼怎懂夜的黑 提交于 2019-12-05 01:34:35
问题 I want to extend MS Outlook so that when a calendar reminder pops up, I can run a VBA hook that can run an external program (like a batch script). In my case, I want to "forward" the reminder to a Linux desktop since I work in both environments and I don't always have the Windows desktop visible. I see an example at http://office.microsoft.com/en-us/outlook-help/HV080803406.aspx and have opened VBA Developer view in MS outlook 2010 and inserted a class module and added that VBA code, but I do

Combined SVN FTP system?

给你一囗甜甜゛ 提交于 2019-12-05 01:13:40
Are there any systems out there where one can check in changes for a website and have that automatically update the website. The website effetively runs off the latest stable build the whole time without the need to ftp the files to the server. I would look into using a post-commit hook to update the site when changes are made. This could be something as simple as using "svn export" to export the current state of the repository to the live website location. Of course, this has performance considerations if your site has lots of content, so you may want to do something more sophisticated and

Receive event before Windows enters standby or hibernate using Win32 API

蹲街弑〆低调 提交于 2019-12-04 21:20:39
I'm working on a small chat application written in C++/Qt. My users are complaining that the connection is not shut down gracefully when they are closing the laptop lid and the computer enters standby. Is there a Win32 hook available that is called when Windows is about to enter standby? WM_POWERBROADCAST Reimplement QCoreApplication::winEventFilter in your application to handle Windows standby events. 来源: https://stackoverflow.com/questions/5440133/receive-event-before-windows-enters-standby-or-hibernate-using-win32-api

Run a script when either locking or unlocking Windows XP

你离开我真会死。 提交于 2019-12-04 21:07:20
问题 I have a Windows XP machine and a Linux machine running Ubuntu. I share the keyboard/mouse from the Windows machine via Synergy. What I would like to do is lock/unlock the Linux machine whenever I lock/unlock the Windows machine. So I'd like to be able to run a script of some description when Windows either locks or unlocks the screen. 回答1: The standard way in Windows is to write a package (a dll ) that subscribes to Winlogon notification events. I don't know of any tool that provides an easy