remarknibor wrote:
> I'm using Windows on a PC, and Visual C++ 2005.
> I open Notepad as part of my program and I was wondering if I could 
> alter its menus and things in order to limit what participants might 
> (annoyingly) play around with. Ideally, I'd at the very least like to 
> disable their ability to close it using the 'X' button or 'Close' in 
> the menus.
> I can get its handle using:
> HWND hwnd = GetForegroundWindow();
> What do I do next? Do I use things like GetSystemMenu() and 
> EnableMenuItem()? If so how?
> 
> Thanks in advance.

The 'Close'/'X' button is a window style.  You have to change the window 
style (the menu usually follows suit).

GetWindowLongPtr();
(Remove the style that enables the close button).
SetWindowLongPtr();

And then for good measure, call InvalidateRect() on the HWND.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to