console-application

Why does PowerCmd show duplicate git commits?

早过忘川 提交于 2019-12-06 15:46:49
I often use the windows console called console2 and recently found PowerCmd , so I have been trying it out. I create a Git repository and make and commit three changes. First the correct log in console2 : c:\code\junk>git log --pretty=oneline 015cfbec12208d7b719d523c92d0c46b726d42e6 third time lucky. c8a9ffeb4381cd515a62937a0a50b7dc5360dbb8 Second commit 370e9cbb72feca9fb784843154f2171fefe2c656 initial commit I get double the goodness using PowerCmd : C:\code\junk>git log --pretty=oneline [33m015cfbec12208d7b719d523c92d0c46b726d42e6[m third time lucky.

System.Drawing.DrawString() weird wrapping of long string

放肆的年华 提交于 2019-12-06 15:30:54
Update: I would like to answer my own question with code that helped me solve the issue. It was submitted by Bradley but tweaked to work for me and may help others as well. But I can't answer until it is reopened. The linked duplicate provides a method, but no code. A code based answer to this question would be helpful to the community I'm having some slight issues with the formatting of the text drawn on an image inside of my console application. The text I'm trying to draw is: BAS2016=PTR=E30BAS2010=(S20)$W30$PTO2016=N5W20N5(W20N10)(S10W20)S5W5S5E10N10(E15N5)(S5E15)S10E25$W25N10(W15N5)(S5W15

Create new console from console app? C++

对着背影说爱祢 提交于 2019-12-06 14:07:00
问题 I am stuck on create new console window for my console application, for logger. That code works fine for GUI apps, but not work for console, and they require: CreateProcess function with the DETACHED_PROCESS flag. Logger Log; DWORD PiD; void __stdcall LoggerCore(PVOID pVoid) { AllocConsole(); while(true) { SetConsoleTitleA(Log.LoggerTittle()); Sleep(5000); } _endthread(); } char* Logger::LoggerTittle() { static char Tittle[55]; sprintf(Tittle, "Debug Logger"); return Tittle; } void Logger:

What exactly is classified as a “symbol” in C#?

荒凉一梦 提交于 2019-12-06 12:45:06
So I am trying to write a program that asks for you to create a password. I have a block of code that checks to see if the string entered by the user contains a symbol. I have the code set to exit the loop when the boolean value 'validPassword' equals true. string pleaseenterapassword = "Create a password:"; bool validPassword = false; Console.WriteLine(pleaseenterapassword); // Writes to the screen "Create a password:" string password = Console.ReadLine(); //Sets the text entered in the Console into the string 'password' bool containsAtLeastOneSymbol = password.Any(char.IsSymbol); if

Changing the console size

限于喜欢 提交于 2019-12-06 12:39:15
Simple problem in Delphi. I've created a console application and I need to change the height of the console window to 80 lines, if it's less than 80 lines. This need to be done from code and is actually conditional within the code. (I.e. when an error occurs, it increases the size of the console so the whole (huge) error report is visible.) Keep in mind that this is a console application! When it starts, it uses the default console, which I need to alter! Wim ten Brink When calling SetConsoleWindowInfo() the values for Left and Top that are passed to the console need to at least be 1, not 0.

How to hide output (not the window) in a console application?

天大地大妈咪最大 提交于 2019-12-06 11:14:08
Well, let me make it clear again. I have a console application with many classes, in each class there is at least one Console.WriteLine("text") line. I defined some arguments that when running the application, it output exactly what I wrote in classes. There, I want to define an argument that when I run the app with this argument, there will be no output on the console screen but the console window still appears. The argument maybe something like "-s". So is there any way I can do this without using the "if" condition in each class and passing an parameter through classes? Many thanks. P/S: I

How to send Return/Enter character to the Console using WriteConsoleInput/WriteConsole

折月煮酒 提交于 2019-12-06 11:01:10
I have the following piece of code. I want to send the command "uci" and then Return/Enter to the console. However, I got no success doing so. Please kindly advise. Thank you! #include <conio.h> #include <iostream> #include <windows.h> DWORD WINAPI test(LPVOID lp) { system("edit"); return 0; } int main(int argc, char* argv[]) { /* HANDLE hConIn = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); HANDLE hConOut = CreateFile("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); *

How to create a console application that does not terminate?

半腔热情 提交于 2019-12-06 10:54:56
问题 In C++,a console application can have a message handler in its Winmain procedure.Like this: int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hwnd; MSG msg; #ifdef _DEBUG CreateConsole("Title"); #endif hwnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc); PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE); while(msg.message != WM_QUIT) { if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if(IsDialogMessage(hwnd, &msg)) continue;

Displaying images in a console application?

拥有回忆 提交于 2019-12-06 10:35:25
I have a console application which screen scrapes some data, and now I need to do image comparisons. If the images are different, I want to show the images to the user. What's the best way to display two images during the execution of a console application? I'm assuming I would use some sort of inter-process communication to send information back and forth, but I'm not sure how exactly I would go about doing that in a good fashion. Also, I'd rather NOT store the images to files if possible. There's no reason to persist the data, and if the console application terminates unexpectedly, it's

How do I get a console application to check for updates without using ClickOnce?

半城伤御伤魂 提交于 2019-12-06 10:17:26
问题 In a normal Windows application I can use... System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CheckForUpdate() ...to determine whether or not there is an update available. I know I can use System.Reflection and Assembly and AssemblyName to print the version of the application as it is currently running, but I don't know how to get it to compare that to what's been published most recently. What is the equivalent to CheckForUpdate() for a console application, without using