handle

C# compile error: “Invoke or BeginInvoke cannot be called on a control until the window handle has been created.”

醉酒当歌 提交于 2019-11-29 02:13:58
I just posted a question about how to get a delegate to update a textbox on another form. Just when I thought I had the answer using Invoke...this happens. Here is my code: Main Form Code: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using System.Data.OleDb; using System.Collections.Specialized; using System.Text; using System.Threading; delegate void logAdd(string message); namespace LCR_ShepherdStaffupdater_1._0 { public partial class Main : Form { public Main() { InitializeComponent

How to handle a webview confirm dialog?

三世轮回 提交于 2019-11-28 17:17:33
I'm displaying a webpage in a WebView and on the webpage, there is a button. When you click the button, a confirmation dialog is supposed to popup, but it doesn't show in my WebView. It does popup if I go to the same webpage in the android browser. Anyone know how to handle popup dialogs coming from a webpage inside your WebView? Ok, found the answer and here it is! In order to handle a popup confirmation coming from a webpage in your WebView, you need to override the onJsConfirm method in WebChromeClient to display the popup as an Android Alert dialog. Here is the code to do so. final Context

C# get child handles using FindWindowEx by name and ordinal number

风流意气都作罢 提交于 2019-11-28 09:29:21
According to http://msdn.microsoft.com/en-us/library/ms633500(v=vs.85).aspx I define FindWindowEx function. using System.Runtime.InteropServices; [DllImport("user32.dll", CharSet=CharSet.Unicode)] static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle); Now I am able to find first handle of "Button" control (get name from Spy++) setting childAfter as IntPtr.Zero . IntPtr hWndParent = new IntPtr(2032496); // providing parent window handle IntPtr hWndButton = FindWindowEx(hWndParent, IntPtr.Zero, "Button", string.Empty); How to get second

Storing handles of objects generated by imline in MATLAB

旧时模样 提交于 2019-11-28 05:34:01
问题 I am trying to store a set of object handles in an array. The objects are a series of lines generated by imline(.). I want to store the handles in order to be able to change the property of a desired line (in this case, position). I know how to do this - however, when I try to fill a matrix with the handles of lines, an error occurs - MATLAB states that conversion from IMLINE to DOUBLE is not possible. This does not happen with other types of objects. Is there a way to circumvent this? Here

Delete a directory where someone has opened a file

痞子三分冷 提交于 2019-11-28 05:09:10
问题 I am trying to programmatically delete and replace the contents of an application, "App A", using an "installer" program, which is just a custom WPF .exe app, we'll call "App B". (My question concerns code in "App B".) GUI Setup (not particularly important) App B has a GUI where a user can pick computer names to copy App A onto. A file picker is there the admin uses to fill in the source directory path on the local machine by clicking "App A.exe". There are also textboxes for a user name and

Getting Matlab handles events or properties

时光怂恿深爱的人放手 提交于 2019-11-27 22:29:49
问题 The question How may I get the list of events and properties for a handle of double type, as a figure , axes ? The issue Matlab documentation says to you to use the WindowButtonDownFcn , WindowButtonMotionFcn , and so on in order to listen to whatever happens at your interface. The issue is that this properties are very limited as the following fact: Keeping Variables in Scope When MATLAB evaluates function handles, the same variables are in scope as when the function handle was created. (In

Is there a proper 'ownership-in-a-package' for 'handles' available?

不问归期 提交于 2019-11-27 16:14:26
Handles have proper semantics other than pointers. So for me an example like this (extracted from the Rule of Zero ): class module { public: explicit module(std::wstring const& name) : handle { ::LoadLibrary(name.c_str()), &::FreeLibrary } {} // other module related functions go here private: using module_handle = std::unique_ptr<void, decltype(&::FreeLibrary)>; module_handle handle; }; using unique_ptr as an 'ownership-in-a-package' for handles is a bad example. First, it makes use of internal knowledge that the handle is a pointer type, and use this to make a unique_ptr to the basic type the

In fortran 90, how do I program the equivalent of a handle in matlab [duplicate]

大憨熊 提交于 2019-11-27 15:53:47
This question already has an answer here: Passing external function of multiple variables as a function of one variable in Fortran 2 answers I have a Fortran90 function f(a,b). I need to use a 1D root finder that requires a function g(a), with only one variable a, to find the roots of f for various values of b. In Matlab, I can build a new function g with only one variable a, with parameter b, g = @(a) f(a, b); with b being a parameter that can change in the main program and has scope in f also. How can I do this in Fortran 90 or 95 ? Simple: use a wrapping function... If this is your original

Matlab ode45. How to change a parameter inside it while calling it?

南笙酒味 提交于 2019-11-27 15:39:27
I'm new with Matlab. I hope you can help me. I have to solve a system of ODEs using ODE45 function. Here is the function which describes my equitions. function dNdt = rateEquations(t, y) %populations of corresponding state Ng = y(1); Ns = y(2); Nt = y(3); %All constants used are dropped for the sake of easy reading. Note the parameter F. %rate equations dNs = s0 * Ng * F - Ns/ t_S1; dNt = Ns / t_ISC - Nt / t_T1; dNg = -dNt - dNs; dNdt = [dNg; dNs; dNt]; end Then, in my script .m-file i call the ode45 function in 'for loop'. During each iteration i have to change the parameter F and pass it to

What is the range of a Windows HANDLE on a 64 bits application?

只愿长相守 提交于 2019-11-27 13:57:09
On WinAPI, the HANDLE type is defined as a void* , thus on a 64 bit application the HANDLE value may range from 0 to 18446744073709551615 . But is that true in practice? Does any documentation specify the integral range of such a HANDLE ? If for instance one wants to store this HANDLE as an int32_t on a 32 bit application that's completely fine, but on a 64 bit application the doubts sticks. BlueMonkMN MSDN states: Interprocess Communication Between 32-bit and 64-bit Applications 64-bit versions of Windows use 32-bit handles for interoperability. When sharing a handle between 32-bit and 64-bit