user32

How to call user32.dll methods from javascript

做~自己de王妃 提交于 2019-12-18 18:30:34
问题 I have a javascript running on a browser. Is it possible to call a function/method in user32.dll. This is possible from C# by using pInvoke calls. How do I do the same in JavaScript? Thanks, Datte 回答1: Because of the JavaScript sandbox, you can't do it without a middle layer requiring elevated security permissions, such as a Netscape-style browser plug-in (widely supported), ActiveX control (pretty much IE-only), or .Net control (I assume that's possible; again probably IE-only). In each case

Get key from any process

折月煮酒 提交于 2019-12-18 17:56:11
问题 Ive seen many solutions online but none does exactly what I want. What is the best/simplest way to get any keys pressed in a given process (not my console applicaton) while my application is running in background. I dont need the modifiers or anything. 回答1: If you don't particularly care which process the keys are being pressed in the easiest method would be to call GetAsyncKeyState. It's rather limited though as it does not hook the keyboard and requires you to call it continuously. The best

Swapping left and right mouse button in .NET

南笙酒味 提交于 2019-12-18 12:39:05
问题 How do I swap left and right mouse buttons in .NET (preferably C#)? Basically the result should be the same as if the user checked the "Switch primary and secondary buttons" checkbox in the Mouse Properties through the control panel. I'm dealing with Windows XP, in case that makes a difference. 回答1: You can use a Windows API call to SwapMouseButton : using System.Runtime.InteropServices; // ... [DllImport("user32.dll")] public static extern Int32 SwapMouseButton(Int32 bSwap); // ... // Swap

Send keys through SendInput in user32.dll

自古美人都是妖i 提交于 2019-12-17 04:21:23
问题 I am using this board as a keyboard for demo purposes. Anyways to make the long story short everything works fine except for very few cases. I send keystrokes with the SendInput function located in user32.dll. So my program looks like: static void Main(string[] args) { Console.Write("Press enter an on the next secont the key combination shift+end will be send"); Console.Read(); Thread.Sleep(1000); SendKeyDown(KeyCode.SHIFT); SendKeyPress(KeyCode.END); SendKeyUp(KeyCode.SHIFT); Console.Read();

Change the taskbar color of Windows 10

旧巷老猫 提交于 2019-12-14 02:53:37
问题 Is it possible to change the color of the taskbar programmatically? I want to change the color to solid (opaque) black but ONLY for the taskbar (That's the reason why I can't use the DwmSetColorizationParameters function. It changes the color for entire UI of Windows) I am able to disable the transparency by finding the taskbar's hWnd ( FindWindow("Shell_TrayWnd", null); ) and setting the transparency by DWM API function DwmEnableBlurBehindWindow but I don't know how to change the color. 回答1:

Get list of all runing processes (with processName+ProcessPath+ProcessTitle) [closed]

帅比萌擦擦* 提交于 2019-12-13 11:31:07
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . what i'am trying to do: get list of all runing processes with: processName (without .exe ) ProcessFullFilePath ProcessMainWindowTitle something like: process1 c:\p1.exe TheprocessTitle .............. Very important: i need working code that will not make any exception( try catch ) My Code: i used

Setting Icon of Windows Issues (WinXP and Win7)

强颜欢笑 提交于 2019-12-13 03:04:04
问题 I'm making a Firefox addon with js-ctypes and was using user32.dll functions to set the icons of all windows of a profile. I plan to do this for Mac OS and Linux but trying to knock out Windows first. So I'm setting the icons like this: GitHub - Gist :: Noitidart / _ff-addon-snippet-ChangeWindowIcon.js - Rev2 That code is simplified. This code I use to apply to all windows: Cu.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); var SendMessage = user32.declare

user32 GetClassName isn't correct

旧城冷巷雨未停 提交于 2019-12-12 04:24:48
问题 I have a routine that get's all open windows (processes) and then searches for it's classname with the GetClassName method in user32. But when for example Teamviewer is on the classnames of all applications get the teamviewer classname. Example: Notepad is open and TeamViewer on classname: 'TeamViewer_TitleBarButtonClass' Notepad is open and TeamViewer off classname: 'Notepad' I looked how this came and found out that Teamviewer puts a control on top of some application windows. So how can i

Detecting if Windows Login Screen is visible to user in VB.NET

ε祈祈猫儿з 提交于 2019-12-12 04:15:33
问题 Hey StackOverflow VB.NET members, After running the following code (which locks the computer), what code must I be applying to see if the user has successfully logged into the computer and that "Lock Screen" I'd so called has disappeared? Private Declare Function LockWorkStation Lib "user32.dll" () As Long Private Function LockComputer() LockWorkStation() End Function I will call "LockComputer", after that what do I do to see if the Lock screen so called by this function (after say 2 minutes)

How do I get the “topmost” status of every window in c#

时光怂恿深爱的人放手 提交于 2019-12-12 03:25:03
问题 Actually I wrote my self a programm that sets the topmost status of a specific window to true or false . I realised this by importing the user32.dll [DllImport("user32.dll")] private static extern bool SetWindowPos(...); Now I was wondering if its possible to get the state of the window and see if the topmost is set and add this to the items I have in a Listview . Of course I can do this in runtime, depending on the actions I performed, but my programm will not be opend all the time and I