windows

Running C++ executables compiled in Cygwin on Windows

家住魔仙堡 提交于 2021-02-08 06:04:56
问题 The Idea I've compiled a C++ exe using G++ on Cygwin, and I want to be able to get the output of that exe into my HTML via PHP. That is, let's say I have a C++ executable "test.exe" which outputs "Hello, World!" when run. Then logically, I should be able to do <?=exec("./test.exe")?> To send the output of the test.exe file to the file. The Issue I'm testing this on a local WAMP server on Win7. Apparently, exec and system calls on Win7 WAMP go through the Windows command prompt, meaning it's

Get bytes/char* from hIcon/hBitmap

两盒软妹~` 提交于 2021-02-08 06:04:00
问题 I'm working on a C/S application, Server in C++ and Client in C#, I need to send some information about current running processes and related icon. I get icon file thanks to EnumWindows with this code inside the callback... // Get the window icon HICON hIcon = (HICON)(::SendMessageW(hWnd, WM_GETICON, ICON_SMALL, 0)); if (hIcon == 0) { // Alternative method. Get from the window class hIcon = reinterpret_cast<HICON>(::GetClassLongPtrW(hWnd, GCLP_HICONSM)); } // Alternative: get the first icon

What is the Windows command line parameter encoding?

爷,独闯天下 提交于 2021-02-08 05:57:12
问题 What encoding does Windows use for command line parameters passed to programs started in a cmd.exe window? The encoding of command line parameters doesn't seem to be affected by the console code page set using chcp (I set it to UTF-8, code page 65001 and use the Lucida Console font.) If I paste an EN DASH, encoded as hex E28093, from a UTF-8 file into a command line, it is displayed correctly in the cmd.exe window. However, it seems to be translated to a hex 96 (an ANSI representation) when

GNU Make Under Windows: Check for cygwin in PATH

别等时光非礼了梦想. 提交于 2021-02-08 05:43:26
问题 I have been putting together a makefile in a Windows environment for my team to use. I decided to use MinGW's version of make for Windows. I put that executable with its dependencies into a repository location that should be in everyone's PATH variable. The executable was renamed "make.exe" for simplicity. Then I realized that I have to account for the case when someone has cygwin's bin folder in their path. Commands like echo, rmdir, and mkdir will call echo.exe, rmdir.exe, and mkdir.exe

python+win32: detect window drag

99封情书 提交于 2021-02-08 05:39:15
问题 Is there a way to detect when a window that doesn't belong to my application is being dragged in windows using python/pywin32? I want to set it up so that when I drag a window whose title matches a pattern near the desktop edge, it snaps to the edge when the mouse is let go. I could write code to snap all windows with that title to the desktop whenever the mouse is released, but I want to only move the particular window that was being dragged. 回答1: So far the only possible solution I see is

GetWindowText hangs on Windows 10

送分小仙女□ 提交于 2021-02-08 05:16:02
问题 TL;DR: Did GetWindowText win32 api change behavior on windows 10? I have some code that loops through all windows on the desktop to find a window where the title contains some text. When this code hits a window named "" with class "URL Moniker Notification Window" it hangs on GetWindowText. GetWindowText is trying to send a message, my guess is WM_GETTEXT. This window is part of the exe "SearchUI.exe", the process is suspended and can't process messages. When reading: https://blogs.msdn

GetWindowText hangs on Windows 10

喜夏-厌秋 提交于 2021-02-08 05:15:40
问题 TL;DR: Did GetWindowText win32 api change behavior on windows 10? I have some code that loops through all windows on the desktop to find a window where the title contains some text. When this code hits a window named "" with class "URL Moniker Notification Window" it hangs on GetWindowText. GetWindowText is trying to send a message, my guess is WM_GETTEXT. This window is part of the exe "SearchUI.exe", the process is suspended and can't process messages. When reading: https://blogs.msdn

How to replace a string with a substring when there are parentheses in the string

牧云@^-^@ 提交于 2021-02-08 05:06:07
问题 I have been scratching my head for the last two days trying to put together a code that reads a folder structure and the strips off the base path of the listing. What I have so far is this: @ECHO OFF CLS SETLOCAL EnableExtensions EnableDelayedExpansion SET "StartTime=%TIME: =0%" SET "Folder=%~1" IF "%Folder:~-1%"=="\" SET "Folder=%Folder:~0,-1%" FOR %%G IN ("%Folder%") DO SET "Archive=%%~nxG" ECHO Processing %Folder%... ECHO. PUSHD "%Folder%" FOR /F "DELIMS=" %%G IN ('DIR /A:-D /B /O:N /S')

How to replace a string with a substring when there are parentheses in the string

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-08 05:05:32
问题 I have been scratching my head for the last two days trying to put together a code that reads a folder structure and the strips off the base path of the listing. What I have so far is this: @ECHO OFF CLS SETLOCAL EnableExtensions EnableDelayedExpansion SET "StartTime=%TIME: =0%" SET "Folder=%~1" IF "%Folder:~-1%"=="\" SET "Folder=%Folder:~0,-1%" FOR %%G IN ("%Folder%") DO SET "Archive=%%~nxG" ECHO Processing %Folder%... ECHO. PUSHD "%Folder%" FOR /F "DELIMS=" %%G IN ('DIR /A:-D /B /O:N /S')

On Windows, packages installed with cabal seem to be unavailable in ghc/ghci

妖精的绣舞 提交于 2021-02-08 04:49:34
问题 I'm running the latest version of Haskell Platform 8.6.3 on a fairly standard Windows 10 x64 system. Now I am at my wits end getting packages installed from Hackage to work reliably. Attributing my issues to local configuration problems, I've taken all steps short of nuking my Windows installation. I have uninstalled and reinstalled Hackage, rebooted, scoured every last configuration file I could in any hidden directory or otherwise, deleted every registry key apparently related to Haskell,