|
근데 다른 메모장파일은 저렇게 소스해도 되더라구요
볼랜드만 안되는데 무슨 이유인지 모르겠어여 ㅠㅠ
님이 쓰신 글 :
: 님이 쓰신 글 :
: :
: : 안녕하세요..
: : 볼랜드c++ 컴파일한 exe 파일을 비쥬얼스튜디어에서 불러서 사용하려고 하는데요...
: : 다른 exe 파일은 실행이 되는데, 볼랜드 c++ exe 파일은 실행이 안되네여
: : 이게 15초에 exe가 실행되고 그뒤에 30초 동안 hide 되는 소스입니다.
: : 혹시, 볼랜드c++에서 컴파일할때 다르게 해야하는게 있나요??
: :
: : 혹시나 해서 c#소스를 올려드립니다.
: :
: : using System;
: : using System.Diagnostics;
: : using System.Runtime.InteropServices;
: : using System.Threading;
: :
: : namespace WindowChange
: : {
: : class Program
: : {
: : [DllImport("user32.dll")]
: : static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags);
: :
: : static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
: : static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2);
: : static readonly IntPtr HWND_TOP = new IntPtr(0);
: :
: : const UInt32 SWP_NOSIZE = 0x0001;
: : const UInt32 SWP_NOMOVE = 0x0002;
: : const UInt32 SWP_NOZORDER = 0x0004;
: : const UInt32 SWP_NOREDRAW = 0x0008;
: : const UInt32 SWP_NOACTIVATE = 0x0010;
: : const UInt32 SWP_FRAMECHANGED = 0x0020; /* The frame changed: send WM_NCCALCSIZE */
: : const UInt32 SWP_SHOWWINDOW = 0x0040;
: : const UInt32 SWP_HIDEWINDOW = 0x0080;
: : const UInt32 SWP_NOCOPYBITS = 0x0100;
: : const UInt32 SWP_NOOWNERZORDER = 0x0200; /* Don't do owner Z ordering */
: : const UInt32 SWP_NOSENDCHANGING = 0x0400; /* Don't send WM_WINDOWPOSCHANGING */
: : const UInt32 TOPMOST_FLAGS = SWP_NOMOVE | SWP_NOSIZE;
: :
: : static void Main(string[] args)
: : {
: :
: : System.Diagnostics.Process SamsungProject1;
: :
: : System.Diagnostics.Process MiPlatform320U;
: :
: :
: : //string sFileName = @"SamsungProject1.exe";
: :
: : //System.Diagnostics.ProcessStartInfo prif = new System.Diagnostics.ProcessStartInfo("SamsungProject1.exe");
: :
: : //prif.CreateNoWindow = true;
: : //prif.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
: : //prif.Arguments = sFileName;
: : //SamsungProject1 = System.Diagnostics.Process.Start(prif);
: :
: : //SamsungProject1 = Process.Start("SamsungProject1");
: :
: : //iexplore = Process.Start("MiPlatform320U");
: :
: : SamsungProject1 = Process.Start("notepad");
: : //SamsungProject1 = Process.GetProcessesByName("SamsungProject1");
: :
: :
: :
: : Thread.Sleep(5000);
: :
: : //MiPlatform320U = Process.Start("MiPlatform320U");
: : //MiPlatform320U = Process.GetProcessesByName("iexplore");
: :
: : //Thread.Sleep(20000);
: :
: :
: :
: :
: :
: : while (true)
: : {
: : //Thread.Sleep(1000);
: : Console.WriteLine("Change SamsungProject1 SWP_FRAMECHANGED Start");
: :
: : SetWindowPos(SamsungProject1.MainWindowHandle, HWND_NOTOPMOST, 0, 0, 1920, 1080, SWP_SHOWWINDOW);
: :
: : Console.WriteLine("Change SamsungProject1 SWP_FRAMECHANGED End");
: :
: : Thread.Sleep(5000);
: :
: : Console.WriteLine("Change SamsungProject1 SWP_HIDEWINDOW Start");
: :
: : SetWindowPos(SamsungProject1.MainWindowHandle, HWND_NOTOPMOST, 0, 0, 1920, 1080, SWP_HIDEWINDOW);
: :
: : Console.WriteLine("Change SamsungProject1 SWP_HIDEWINDOW End");
: :
: : Thread.Sleep(5000);
: : //Console.WriteLine("Change SamsungProject1 SWP_SHOWWINDOW Start");
: : //SetWindowPos(SamsungProject1.MainWindowHandle, HWND_NOTOPMOST, 0, 0, 1920, 1080, SWP_SHOWWINDOW);
: :
: : //Console.WriteLine("Change SamsungProject1 SWP_SHOWWINDOW End");
: :
: : //Console.WriteLine("Change MiPlatform320U Start");
: : //SetWindowPos(MiPlatform320U.MainWindowHandle, HWND_TOPMOST, 0, 0, 1920, 1080, SWP_SHOWWINDOW);
: : //Console.WriteLine("Change MiPlatform320U End");
: :
: : //Thread.Sleep(8000);
: :
: : //SetWindowPos(calc.MainWindowHandle, HWND_TOP, 0, 0, 1920, 1080, SWP_HIDEWINDOW);
: :
: : }
: :
: :
: : }
: :
: : public static Process iexplore { get; set; }
: : }
: : }
: :
:
: "SamsungProject1"이 패스가 걸려있지 않은 듯.
:
|