Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- using System.Windows;
- // To use magic
- using System.Runtime.InteropServices;
- // Hide console
- //ShowWindow(handle, SW_HIDE);
- // Show console
- //ShowWindow(handle, SW_SHOW
- namespace CSharpTest
- {
- class Program
- {
- // Magic
- [DllImport("kernel32.dll")]
- static extern IntPtr GetConsoleWindow();
- // Same
- [DllImport("user32.dll")]
- static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
- // There is normal code
- static void Main(string[] args)
- {
- // A bit more magic
- const int SW_HIDE = 0;
- const int SW_SHOW = 5;
- var handle = GetConsoleWindow();
- ShowWindow(handle, SW_HIDE); // This thing should hide console
- // ------------------------------ That's there my code starts ------------------------------
- CultureInfo.CurrentCulture = new CultureInfo("en-US", false);
- var pay = 300.0;
- var userMessage = string.Format("{0:c}", pay);
- userMessage = string.Format("Fisting is " + userMessage);
- MessageBox.Show(userMessage);
- }
- }
- }
Add Comment
Please, Sign In to add comment