showwindow

ShowWindow Function Doesn't Work When Target Application Is Run As Administrator

妖精的绣舞 提交于 2020-01-12 08:51:31
问题 I am writing a program that shows/hides the window of some target application. I was testing it out earlier and noticed something strange. If I run the target application as Administrator (right-click->Properties, "Compatability" tab, "Run this program as administrator") it doesn't work. To demonstrate I wrote a simple GUI app called "TargetApplication" and then I wrote the following code to test showing/hiding this application: class Program { static void Main(string[] args) { IntPtr

HowTo hide Console Window with WinAPI?

时光毁灭记忆、已成空白 提交于 2020-01-11 07:55:11
问题 I'm trying to hide console window when my C application lauching with this simple WinAPI code: #define CONSOLE_NAME "6FD66E14-FF0F-4B94-B8AF-AFE3D42DC399" void hide_window(void) { // Ставим заголовок для консольного окна / Setting window caption SetConsoleTitle(TEXT(CONSOLE_NAME)); // Находим по заголовку Handle для окна / Searching Handle of the window HWND hWnd = FindWindow(NULL, TEXT(CONSOLE_NAME)); if (hWnd == 0) { ErrorExit(TEXT("FindWindow")); } // Скрываем консоль / Hidding console

Why do I have to call showWindow on my NSWindowController twice on 10.5?

情到浓时终转凉″ 提交于 2019-12-06 07:28:27
问题 I've got a subclass of an NSWindowController that I'm using to load a window from a nib and show it on the screen. Below is the code that is called when I want to show the window. On 10.6 when showCustomWindow is called the window is displayed, but on 10.5 this method has to be called twice to get the window to display. -(IBAction)showCustomWindow:(id)sender { if(!windowController){ windowController = [[MyWindowController alloc] initWithWindowNibName:@"MyWindow"]; } [windowController

HowTo hide Console Window with WinAPI?

余生颓废 提交于 2019-12-01 14:25:59
I'm trying to hide console window when my C application lauching with this simple WinAPI code: #define CONSOLE_NAME "6FD66E14-FF0F-4B94-B8AF-AFE3D42DC399" void hide_window(void) { // Ставим заголовок для консольного окна / Setting window caption SetConsoleTitle(TEXT(CONSOLE_NAME)); // Находим по заголовку Handle для окна / Searching Handle of the window HWND hWnd = FindWindow(NULL, TEXT(CONSOLE_NAME)); if (hWnd == 0) { ErrorExit(TEXT("FindWindow")); } // Скрываем консоль / Hidding console ShowWindow(hWnd, SW_HIDE); } int _tmain(int argc, _TCHAR* argv[]) { hide_window(); /* other code */ }

How to stop Explorer starting my application maximized?

£可爱£侵袭症+ 提交于 2019-12-01 09:19:28
Explorer seems to always start my application with SW_MAXIMIZE ( STARTF_USESHOWWINDOW is set in STARTUPINFO.dwFlags ). I know that ShowWindow will use this value the first time you/Windows needs to display a window but it has the unfortunate consequence of maximizing a window that should never be maximized. My window is created with CreateDialogIndirectParam and has the following styles: WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPCHILDREN|DS_MODALFRAME|DS_CENTER|WS_VISIBLE . Why does ShowWindow not check if WS_MAXIMIZEBOX is set before allowing STARTF_USESHOWWINDOW to force SW_MAXIMIZE ? Is

How to stop Explorer starting my application maximized?

给你一囗甜甜゛ 提交于 2019-12-01 06:12:12
问题 Explorer seems to always start my application with SW_MAXIMIZE ( STARTF_USESHOWWINDOW is set in STARTUPINFO.dwFlags). I know that ShowWindow will use this value the first time you/Windows needs to display a window but it has the unfortunate consequence of maximizing a window that should never be maximized. My window is created with CreateDialogIndirectParam and has the following styles: WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPCHILDREN|DS_MODALFRAME|DS_CENTER|WS_VISIBLE . Why does