windows-7

Unicode filenames on Windows in Ruby

随声附和 提交于 2020-01-14 07:27:03
问题 I have a piece of code that looks like this: Dir.new(path).each do |entry| puts entry end The problem comes when I have a file named こんにちは世界.txt in the directory that I list. On a Windows 7 machine I get the output: ???????.txt From googling around, properly reading this filename on windows seems to be an impossible task. Any suggestions? 回答1: You're out of luck with pure ruby (either 1.8 or 1.9.1) since it uses the ANSI versions of the Windows API. It seems like Ruby 1.9.2 will support

Read Bluetooth RSSI on Windows 7/Vista/XP

*爱你&永不变心* 提交于 2020-01-14 05:28:29
问题 I need to read the RSSI of the Bluetooth link on a Windows desktop - ideally Windows 7 and XP, but would be enough Windows 7 too. From what I studied in Windows CE and Mobile, there is a method in the Microsoft Bluetooth stack API called BthReadRSSI, but for desktop I couldn't found anything yet. Does anybody have an workarround solution? 回答1: The response is that in Windows if you are using MS Bluetooth driver stack you cannot get the RSSI. This apply for Windows dekstop versions: XP, Vista

Running .vbs through task Scheduler

你离开我真会死。 提交于 2020-01-14 03:27:06
问题 I am trying to run a vbs script through Task Scheduler. The code for the vbs script is Dim ObjExcel, ObjWB Set ObjExcel = CreateObject("excel.application") 'vbs opens a file specified by the path below Set ObjWB = ObjExcel.Workbooks.Open("FilePath\CombinePDFs.xlsm") 'either use the Workbook Open event (if macros are enabled), or Application.Run ObjWB.Close False ObjExcel.Quit Set ObjExcel = Nothing Then the Action in Task Scheduler is: Program/Script: "FilePath\CombinePDFS.vbs" With no added

How to detect when the user switches to the Log On screen?

大城市里の小女人 提交于 2020-01-13 18:58:07
问题 I need to know when the user switches to the logon screen (as triggered by ctrl-alt-del) in order to circumvent a pesky bug in WPF. I want to work around this bug by reinitializing my GUI after returning from the logon screen. Currently it works, but I have to trigger it manually. I have found SystemEvents.SessionSwitch, but unfortunately this is only triggered when logging off. How can I detect when the logon screen is displayed by forming ctrl-alt-del? 回答1: The tricky thing is that this is

“Wrong” app gets pinned to taskbar (Windows 7)

吃可爱长大的小学妹 提交于 2020-01-13 17:58:50
问题 I have an application that gets started via a shortcut. This application than starts a Java GUI application with CreateProcess(). When the Java application gets pinned to the taskbar the javaw.exe gets pinned to the taskbar instead of the "expected" shortcut. Only the native executable which launches Java can be modified - the shortcut has to stay. What has to be done so that the shortcut gets pinned? Thanks, Stefan 回答1: Use something like winrun4j or create a .bat instead of using a shortcut

Desktop Window Manager capture the whole screen

冷暖自知 提交于 2020-01-13 17:09:15
问题 I was wondering if anyone could give me a starting point of how to capture the entire screen in Windows Vista/7? I know how to do it in previous versions of Windows, but would really like to keep everything in the D3D stack, without resorting to GDI/BltBit calls. I realize that you can get a live thumbnail of a given window if you have the HWND using the DWM API, but how do you get a "thumbnail" of the entire desktop? Thanks, Alex 回答1: Unfortunately, the functions to do this are in the dwmapi

Windows Credential Provider, Filter, and Unlock Workstation Scenario

被刻印的时光 ゝ 提交于 2020-01-13 14:57:14
问题 I'm developing a credential provider and filter. I have some problems with lock scenario. First, I have tried the SampleAllControlCredentialProvider from here. And it works. Even when I logon and lock it afterward, it shows my credential. Second, I tried making my own credential provider filter by adding some lines of codes. The filter is filtering out the windows' credential, only my credentials are allowed to appear. These are my addition of codes: In CSampleProvider.h, I make the class to

How to detect if window is flashing

Deadly 提交于 2020-01-13 14:05:40
问题 I'm using FlashWindowEx() to flash an application window when it needs to attract a user's attention. The window caption and taskbar button flashes continuously until the application receives focus. How can I check whether the application is currently flashing (i.e. has not received focus since it was instructed to flash). 回答1: Here are two possible solutions. One uses WH_SHELL, and one uses a NativeWindow. You will have to provide your own extension method ( FlashWindow() ) to start the

How to read HDD S.M.A.R.T. attributes?

℡╲_俬逩灬. 提交于 2020-01-13 13:50:17
问题 I would monitoring the smart HDD-s on my Windows 7 clients. I would to get the HDD smart attributes without using any vbs file or ready-made tool just looking towards WMI or PowerShell. I would aggregate that data with ZABBIX monitoring server (use zabbix-sender.exe ). I found a more or less solution for Linux, but I would monitor windows 7 machines HDD. Has anyone an idea? 回答1: Use the WMI API to access SMART data like so, gwmi -namespace root\wmi -class MSStorageDriver_FailurePredictStatus

Run explorer.exe as Administrator user within Windows 7

荒凉一梦 提交于 2020-01-13 13:11:43
问题 I have the Windows 7 operating system, and I have administrator user credentials stored (known in advance). I know we can run a program or .exe using "Runas" verb and launch a process, but my question is specific to explorer.exe. I am trying to run "runas /user: "control.exe printers" it launches successfully after giving a password to the prompt, but when I am checking within TaskManager it is running under my regular user with which I have logged on. I have noticed this is only with