C 언어로 코드를 찾을 수있는 창 스타일을 바꿀 방법을 찾았을 때 제목을 숨길 수 있도록 C# 응용 프로그램에서 아래 스 니펫을 어떻게 사용할 수 있습니까? 외부 응용 프로그램 바? 나는C 코드 사용 #
//Finds a window by class name
[DllImport("USER32.DLL")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
//Sets a window to be a child window of another window
[DllImport("USER32.DLL")]
public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
//Sets window attributes
[DllImport("USER32.DLL")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
//Gets window attributes
[DllImport("USER32.DLL")]
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
//assorted constants needed
public static int GWL_STYLE = -16;
public static int WS_CHILD = 0x40000000; //child window
public static int WS_BORDER = 0x00800000; //window with border
public static int WS_DLGFRAME = 0x00400000; //window with double border but no title
public static int WS_CAPTION= WS_BORDER | WS_DLGFRAME; //window with a title bar
/*
This function sets the parent of the window with class
ClassClass to the form/control the method is in.
*/
public void Reparent()
{
//get handle of parent form (.net property)
IntPtr par = this.Handle;
//get handle of child form (win32)
IntPtr child = FindWindow("ClassClass", null);
//set parent of child form
SetParent(child, par);
//get current window style of child form
int style = GetWindowLong(child, GWL_STYLE);
//take current window style and remove WS_CAPTION from it
SetWindowLong(child, GWL_STYLE, (style & ~WS_CAPTION));
}
: 당신이 시도 할 수 윈도우 검색하십시오
? - 귀하의 응용 프로그램 또는 모든 창에 해당합니까? Winforms, ASP, WPF? 귀하의 다른 게시물과 같습니다. – ChrisBD@ChrisBD, 응용 프로그램의 제목 표시 줄을 숨기고 싶습니다. [제 3 자] 하나의 양식 만 있습니다. 그리고이 응용 프로그램은 내 C# Windows 응용 프로그램에서 시작합니다. 모든 창문이 아닙니다. – Anuya