|
-
June 18th, 2004, 06:43 AM
#1
Removing Non-Client area of a window
How can I remove non-client area of a window (border, title), which belongs to another process (separate application)? I have only HWND of that window, and cutting its DC using SetLayeredWindowAttributes() with LWA_COLORKEY, to get some specific shape, but all non-client area remains as an ugly frame. So I need to remove it somehow.
Note: the window is created by existing application, and I can’t change its code
-
June 18th, 2004, 09:55 AM
#2
Try using SetWindowLong to set the window class attributes. For example, to remove the caption (title bar):
Code:
DWORD dwStyle = GetWindowLong(hwnd, GWL_STYLE);
dwStyle &= ~WS_CAPTION;
SetWindowLong(hwnd, GWL_STYLE, dwStyle);
SetWindowPos(hwnd, NULL, NULL, NULL, NULL, NULL,
SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE);
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-
June 18th, 2004, 11:53 AM
#3
Thanks a lot! Working perfect with:
Code:
dwStyle &= ~WS_OVERLAPPEDWINDOW;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|