|
-
August 1st, 2009, 12:47 PM
#1
Hook window and modify controlbox?
Hey all,
I'm trying to hook onto a console application and remove the controlbox buttons, minimize, maximize ect.
using FindWindow to grab the application isn't a problem but how would I modify the form properties to set ControlBox = false; ?
Any ideas are much appreciated!
Thanks,
- Mac
-
August 2nd, 2009, 05:05 PM
#2
Re: Hook window and modify controlbox?
Well there is not much you can do if it is a standard win32 console - you cant remove the sysmenu ( not 100% sure on this but almost :P ). The best thing you can do is disable the buttons this way:
Code:
//assuming wnd is the HWND you have from FindWindow
HMENU menu = GetSystemMenu(wnd,FALSE);
DeleteMenu(menu,SC_MINIMIZE,MF_BYCOMMAND);
DeleteMenu(menu,SC_MAXIMIZE,MF_BYCOMMAND);
DeleteMenu(menu,SC_CLOSE,MF_BYCOMMAND);
DrawMenuBar(wnd);
-
August 2nd, 2009, 07:18 PM
#3
Re: Hook window and modify controlbox?
Exactly what I was looking for! Thanks a bunch!
- Mac
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
|