0

I've got this C# code below working fine. It removes an external apps border title and control boxes.
What I'd really like to do is change the border style to SingleFixed.

Any help appreciated.

        Process[] Procs = Process.GetProcesses();
        foreach (Process proc in Procs)
        {
            if (proc.ProcessName.StartsWith("notepad"))
            {
                IntPtr pFoundWindow = proc.MainWindowHandle;
                int style = GetWindowLong(pFoundWindow, GWL_STYLE);

                //get menu
                IntPtr HMENU = GetMenu(proc.MainWindowHandle);
                //get item count
                int count = GetMenuItemCount(HMENU);
                //loop & remove
                for (int i = 0; i < count; i++)
                    RemoveMenu(HMENU, 0, (MF_BYPOSITION | MF_REMOVE));

                //force a redraw
                DrawMenuBar(proc.MainWindowHandle);
                SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_SYSMENU)); 
                SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_CAPTION));
                //SetWindowLong(pFoundWindow, GWL_STYLE, (style & ~WS_???????)); 
            } 
        }
2
Contributors
1
Reply
10
Views
2 Years
Discussion Span
Last Post by SteveDotNet
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.