w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to automate the "Windows Security" window: "Windows can't verify the publisher of this driver software"
Are you able to identify the window using the Win... functions? If so you could try using MouseClick: $aPos = WinGetPos("Windows Security") MouseClick("left", $aPos[0]+50, $aPos[1]+100) First get the position of the window, then add some pixels so that when you do a right-click with the mouse you click the appropriate button. Of course you need to adjust the number of pixels to add to the x-/y-axis.

Categories : Windows

Pywin32 SendKeys: "Windows button" keypress
From Tim Golden's pages: import ctypes ctypes.windll.user32.LockWorkStation()

Categories : Python

Windows Phone Back KeyPress + MessageBox crashes the app without Selection
http://msdn.microsoft.com/en-US/library/windowsphone/develop/jj206947(v=vs.105).aspx In Windows Phone 8, if you call Show in OnBackKeyPress(CancelEventArgs) or a handler for the BackKeyPress event, the app will exit. You can work around this by calling Show on a different thread, as described in the following steps. Override BackKeyPress or create a handler for the BackKeyPress event. Set the Cancel to true to cancel the back key press action. Dispatch a method that shows the MessageBox. If the user chooses to leave the app, call Terminate(), otherwise, do nothing.

Categories : C#

Automate git bisect for MSBuild/NUnit/.NET/Windows batch commands in msysgit?
To solve the path problem, I simply used an absolute path in the script. To solve the Windows-style forward-slash commandline-option problem, I escaped the forward-slash with another forward slash (I got that tip from another Stack Overflow answer, I'll link to it when I find it again). So now the working script looks like this: #!/bin/sh # http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_02.html # http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html # Build solution. echo "Building..." c:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe //consoleloggerparameters:ErrorsOnly //maxcpucount //nologo //property:Configuration=Debug //verbosity:quiet Epic-Project-of-Supreme-Awesome.sln # Check exit status. # (status != 0) ? status=$? if [ $s

Categories : GIT

Robot and keyPress
Codes are defined as constants in javafx.scene.input.KeyCode. With the glass robot, you can use the deprecated method impl_getCode: Robot robot = com.sun.glass.ui.Application.GetApplication().createRobot(); robot.keyPress(KeyCode.A.impl_getCode()); You can also use the FXRobot, which takes KeyCodes as parameters: FXRobot robot = FXRobotFactory.createRobot(scene); robot.keyPress(javafx.scene.input.KeyCode.A);

Categories : Java

Automate Outlook from COM+
You need to clarify a bit here. You say you want to automate Outlook, but not take a dependency on it. That's just weird unless you're abstracting the concept of an email client, which does not seem to be your motivation. Assuming you do take a dependency on the interop assembly, you could check for broken/invalid references before your application actually uses that reference. See here.

Categories : C#

Manage keypress
If you want to switch to Windows, you could probably use the GetKeyboardState function to find out if one or more keys are being pressed. Even easier than using GetKeyboardState would be to use something like the following: .486 .model flat,stdcall option casemap : none include masm32includewindows.inc include masm32includekernel32.inc include masm32includemsvcrt.inc include masm32macrosmacros.asm includelib masm32libkernel32.lib includelib masm32libmsvcrt.lib .data? key dd ? .code start: printf("Press a key..") call crt__getch mov key,eax printf(" You pressed key number %d", key) invoke ExitProcess,0 END start

Categories : Assembly

KeyPress F1 does not work C#
try this private void Form1_Load(object sender, EventArgs e) { this.KeyPreview = true; this.KeyDown += new KeyEventHandler(Form1_KeyDown); } void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode.ToString() == "F1") { MessageBox.Show("F1 pressed"); } }

Categories : C#

KeyPress not being detected
Here you have a sample code showing you how to hook when a key is being pressed: Imports System.Runtime.InteropServices Public Class Form1 Private Const WM_HOTKEY As Integer = &H312 Private Const MOD_ALT As Integer = &H1 Private Const MOD_CONTROL As Integer = &H2 Private Const MOD_SHIFT As Integer = &H4 Private Declare Function RegisterHotKey Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal id As Integer, ByVal fsModifier As Integer, ByVal vk As Integer) As Integer Private Declare Function UnregisterHotKey Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal id As Integer) As Boolean Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) If (m.Msg = WM_HOTKEY AndAlso m.WParam = CType(0, IntPtr)) Then If (m.LParam

Categories : Dotnet

How to automate a function
SQL Server Agent - accessible on the database through SSMS - allows you to schedule jobs to run on particular schedules. http://msdn.microsoft.com/en-us/library/ms189237.aspx

Categories : C#

Keypress on tab not working
Change keypress to keydown. keypress will not capture tab and some other keys. Example on jsFiddle $(document).keydown(function(e) { if (e.keyCode == 9) alert("Tab"); });

Categories : Jquery

How to automate a job in Jenkins?
Normally in Maven snapshot builds are triggered by changes in the source code and release builds are created on demand (when code is released). This is the workflow supported by the Maven release plugin. It wasn't clear whether you also have the Jenkins M2 release plugin installed or not? It provides a convenient "Release" button to trigger release builds on your job.

Categories : Svn

Close modal box on keypress
What you are doing is just hiding the div. What you should do instead is to programatically close the modal using $.modal.close(); or your myModalObj.close();

Categories : Misc

How can I simulate a keypress event?
I read an article last night where they used a TextEvent. It may provide a suitable solution for your use case as well.

Categories : Dart

VBA macro to automate Rexcel
once you have the table arimazP, RInterface.GetArray "arimazP", Range("A1") Edit: The following will be executed much more quickly. Actually, I wrote a Function that completely replaces the RInterface.GetArray (due to performance issues) for tables with/without row/column names. If anyone wants that let me know and I'll post it. Range("A1") = RInterface.GetRExpressionValueToVBA("arimazP")

Categories : Misc

How to trigger the enter keypress
You can do this - var e = $.Event( "keypress", { which: 13 } ); $('#yourInput').trigger(e); http://api.jquery.com/category/events/event-object/ http://api.jquery.com/trigger/

Categories : Javascript

How do I add a keypress action in my program?
To use KeyAdapters and/or KeyListeners you will need to construct a Gui in which to add these Adapters/Listners too. The way you are currently reading in the users action is a valid way to do it for a console app. Edit Extending on BlakeP's Answer if you have your determineAction method you could have a Map of the text your print out like so then you only need to add the special actions for the keys. Map<Character, String> actionText = new HashMap<Character, String>(); actionText.put('x', " You quit the game!"); actionText.put('i', " Inventory Items: Things are here"); private void determineAction(char choice) { System.out.println(actionText.get(choice)); switch (choice1) { case "x": System.exit(0);

Categories : Java

Simulate a keypress for X seconds
Not sure what you're doing with the PostMessage but modifying some code from here: SendKey.Send() Not working [DllImport("user32.dll", SetLastError = true)] static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo); public static void PressKey(Keys key, bool up) { const int KEYEVENTF_EXTENDEDKEY = 0x1; const int KEYEVENTF_KEYUP = 0x2; if (up) { keybd_event((byte)key, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, (UIntPtr)0); } else { keybd_event((byte)key, 0x45, KEYEVENTF_EXTENDEDKEY, (UIntPtr)0); } } void TestProc() { PressKey(Keys.Tab, false); Thread.Sleep(1000); PressKey(Keys.Tab, true); } Maybe this could work

Categories : C#

How to substitute a keypress with another in JQuery?
You can do something like this on the control where this value is entered $('#searchbox input').bind('keypress', function(e) { if(e.keyCode==13){//here in your case it would be keycode of '.' // Enter pressed... do anything here... } }); You can use this link to find out the required keycode http://www.theasciicode.com.ar/ascii-printable-characters/dot-full-stop-ascii-code-46.html

Categories : Jquery

Automate the insertion of breakpoints?
No. There's no functionality in the IDE to do so. Based on your comment to the original question, what you're actually trying to do is detect where a global ("public") variable is being changed. The way to do that is to set a Data Breakpoint, which is tripped when the variable is changed, and then view the callstack to see what code was executing last. (You can find this in the help file by searching on "Breakpoints, setting data breakpoints" in the help index for Delphi 2007, or "Breakpoint Properties, Data Breakpoint" in XE4's help (linked above). Note that both ask for an address to watch, but work with @VariableName as well. (Using a stack (local) variable triggers a dialog that tells you that doing so can make your app unstable and asking you to confirm you want to do so.) As @Davi

Categories : Delphi

Automate multiple installers
I would suggest using NSIS. You can bundle all the MSI installers (including python) into one executable, and install them in "silent mode" in whatever order you want. NSIS also has a great script generator you can download. Also, you might be interested in activepython. It comes with pip and automatically adds everything to your path so you can just pip install most of your dependencies from a batch script.

Categories : Python

Detect Keypress without blocking
Your question is a little bit ambiguous (as noted by @TankorSmash). But here goes... from multiprocessing import Process, Pipe def f(c2): count = 1 while not c2.poll(): print('hit ENTER to stop ({})'.format(count)) count += 1 c1, c2 = Pipe() p = Process(target=f, args=(c2,)) p.start() raw_input() c1.send(None) p.join() My answer still uses while, but it doesn't block the running code. Does this work for you?

Categories : Python

on keypress display one div and other should hide
Try this out var currentVisible = 0; document.onkeyup = function() { // First hide all by class 'objects' // Requires IE9+ FF3+, others are supported var objs = document.getElementsByClassName('objects'); for (var i=0; i<objs.length; i++) { objs[i].style.display = 'none'; } // Show the one we are supposed to show if (++currentVisible == 7) currentVisible = 1; var el = document.getElementById('d' + currentVisible); el.style.display = 'block'; } 100% untested tho, since I have no access to any fiddle atm.

Categories : Javascript

Any way to automate IE *WITHOUT* using webbrowser control?
You could use a testing tool like Selenium to automate IE. You can download the IE Driver from their downloads page. A simple example using google (Make sure you read the instructions on how to get the IE Driver working): OpenQA.Selenium.IE.InternetExplorerDriver d = new OpenQA.Selenium.IE.InternetExplorerDriver(); d.Navigate().GoToUrl("http://www.google.com"); d.FindElementByName("q").SendKeys("Stack"); d.FindElementByName("btnK").Click(); WebDriverWait waiter = new WebDriverWait(d, TimeSpan.FromSeconds(10)); waiter.Until(ExpectedConditions.ElementExists(By.CssSelector(".rc .r a"))); // Message the first element MessageBox.Show(d.FindElementByCssSelector(".rc .r a").Text);

Categories : C#

How to use a keypress event in AngularJS?
You need to add a directive, like this: Javascript: app.directive('myEnter', function () { return function (scope, element, attrs) { element.bind("keydown keypress", function (event) { if(event.which === 13) { scope.$apply(function (){ scope.$eval(attrs.myEnter); }); event.preventDefault(); } }); }; }); HTML: <div ng-app="" ng-controller="MainCtrl"> <input type="text" my-enter="doSomething()"> </div>

Categories : Angularjs

How do you break a while loop with a keypress in WPF?
You can create na event in the KeyDown Event in the MainWindow and get the KeyEventArgs e to know what key was pressed. private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.A) { // set a flag to break the loop } }

Categories : Wpf

C++ Check Keypress Linux
Try this:- #include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <fcntl.h> #include <termios.h> int main() { struct termios oldSettings, newSettings; tcgetattr( fileno( stdin ), &oldSettings ); newSettings = oldSettings; newSettings.c_lflag &= (~ICANON & ~ECHO); tcsetattr( fileno( stdin ), TCSANOW, &newSettings ); while ( 1 ) { fd_set set; struct timeval tv; tv.tv_sec = 10; tv.tv_usec = 0; FD_ZERO( &set ); FD_SET( fileno( stdin ), &set ); int res = select( fileno( stdin )+1, &set, NULL, NULL, &tv ); if( res > 0 ) { char c;

Categories : C++

Automate answer to jar through shell
If you're running on Windows, you might want to consider AutoIt. In your case, it would probably look like Run("cmd.exe") WinWaitActive("C:WINDOWSsystem32cmd.exe") Send("java -jar info.jar{ENTER}") Sleep(1000) Send("Owner1{ENTER}") Send("xxxx xxxx xxxx xxx{ENTER}") Send("999{ENTER}")

Categories : Java

How to Automate Web Analytics testing?
A bit late to the party but maybe I can help. There are a few different ways to automate testing. I've been looking into it lately myself. So far I'm looking into Selenium, Zombiejs and Phantomjs. You can search for "headless testing" which basically let's run code as a browser and test conditions on the page you visit. Here's a good place to start https://github.com/ariya/phantomjs/wiki/Headless-Testing Using these platforms, you could easily set pages to automatically validate if the SiteCatalyst code is firing, page names are correct, click events happen etc. Selenium is an enterprise product whereas the JS frameworks would be more of a development effort. Hope that helps. Brett

Categories : Google Analytics

How to automate SQL Server DB comparison?
I've had a lot of luck with RedGate's SQLCompare product, and it comes with an SDK. http://www.red-gate.com/supportcenter/Content?c=knowledgebase%5CSQL_Comparison_SDK%5CKB200801000220.htm&p=SQL%20Comparison%20SDK

Categories : Sql Server

Keypress event if NOT input
In the event: if ($(e.target).closest("input")[0]) { return; } What that does is see if the target originates in or passes through an input element and return without doing anything if so. More: closest | event.target Your logic for other cases would follow, e.g.: $(document).keydown(function(e) { if ($(e.target).closest("input")[0]) { return; } if(e.keyCode==68){ window.location.href = "{PreviousPost}"; } }); N.B. - If you also want to filter out select elements, then: $(e.target).closest("input, select") (and so on, for instance for button elements).

Categories : Jquery

differentiate F2 keypress on active TAB
If you have a set of tabbed documents in a TabControl this does not mean you have to have a save button for every tab. Here you should have one save button and picup the currently active tab upon the save button click. You will then be able to pick up the object you need to save from that tab. You can pick up the active control from the active tab using a property like public SomeControlToSave ActiveControl { get { if (tabControl.TabPages.Count == 0) return null; return tabControl.SelectedTab.Controls.OfType<SomeControlToSave>().FirstOrDefault(); } } Also, don't simulate a click event to do your work. Create a method that does the requires job and call that from your code behind. You should also use that method inside your event handlers.

Categories : C#

Registry value not being saved on keypress
Replace RegSetValueEx(key, TEXT("MakeAllAppsDefault"), NULL, REG_DWORD, (const BYTE*) DISABLE_APPS_VIEW, sizeof(DISABLE_APPS_VIEW)); // Set value to 0 (OFF) by RegSetValueEx(key, TEXT("MakeAllAppsDefault"), NULL, REG_DWORD, (const BYTE*) &DISABLE_APPS_VIEW, sizeof(DISABLE_APPS_VIEW)); // Set value to 0 (OFF) In other words : put a & in front of DISABLE_APPS_VIEW. You must pass the address of your DWORD variable to RegSetValueEx and not the value itself. BTW you shouldn't put variable names in "all capitals", as by convention in C and C++ "all capitals" names are usually used for preprocessor defined constants (e.g. #define MYCONSTANT 123).

Categories : C++

How can I get ui-keypress working in my Angular JS app?
Taking a wild guess -- you've got the ui-keypress attribute on your button and not your two input tags.. Took me a bit to reproduce in jsfiddle w/ all your dependencies: http://jsfiddle.net/tuv45/

Categories : Javascript

C# automate constructors refactoring
If possible, you can use C# Generics : class A<T> { public A(T b) {} } class B<T> : A<T> { public B(T b) : base(b) {} } class C<T> : B<T> { public C(T b) : base(b) { } } You can use the following syntax for int (and use the same principle for a car) : var intVar = new C<int>(10); Otherwise, there is no tool to change all types at once. If you change parameter type to Car, Resharper will propose you to refactor the constructor of derived class.

Categories : C#

How do I automate the deletion of a worksheet?
Update your code to disable the display of alerts before you delete your sheet; Then enable the alerts after the delete code executes Application.DisplayAlerts = False Sheets("Sheet6").Delete Application.DisplayAlerts = True

Categories : Vba

Automate build porcess for SVN
It's too late to do a build once you create a tag. What if you have a build issue? Instead, you should build upon a branch or trunk, and then, if that build is good, tag that revision of the branch or trunk. Take a look at Jenkins. This is the most popular continuous integration tool. You can setup Jenkins, so every time you commit a change in your code, Jenkins will spawn build with that change. Jenkins can even run automated tests for you. If there's a problem, Jenkins can email the project leads and the developer who made the change. You can store the built artifacts you need to run right in Jenkins, and Jenkins can be setup to do automated deployments if you so desire. What you don't want is a Subversion hook that would do a build for you. Otherwise, the user doing the commit is lo

Categories : Svn

Is it possible to automate routing in Express?
You might want to check this earlier answer on stackoverflow - http://stackoverflow.com/a/6064205/821720 A little more code but abstracts routing to the next level and also gives you a cleaner main file.

Categories : Javascript

Automate a copy constructor in C#
Here is one way: public static T DeepClone<T>(T original) { if (!typeof(T).IsSerializable) { throw new ArgumentException("The type must be serializable.", "original"); } if (ReferenceEquals(original, null)) { return default(T); } using (var stream = new MemoryStream()) { var formatter = new BinaryFormatter { Context = new StreamingContext(StreamingContextStates.Clone) }; formatter.Serialize(stream, original); stream.Position = 0; return (T) formatter.Deserialize(stream); } } This is adapted from CLR via C# by Jeffrey Richter. You use it like this: var objB = DeepClone(objA); The type must be serializable for this to work, though.

Categories : C#

How to setup KeyPress in netbeans
For Swing, typically use key bindings over the AWT based, lower level, KeyListener. See How to Use Key Bindings for details on how to use them.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.