多文档程序启动后子窗口(非主窗口)处于最大化,要使子窗口最小化和恢复按钮无效。这个问题至今还没有人能正确解答。
解决方案 »
- 网页自动登陆 问题
- 在结构体中定义了一个数组char a[100];,那么,定义这个结构体时,a变量被系统分配多少内存,即a占用了多少内存?
- flash透明播放器
- 我要做一个小程序能完成打开一个文本,并能对其修改、保存和打印(急急急!!!)
- 求教:怎样判断一个字符串是不是一个合法的文件名?
- 两个关于任务栏的问题啊
- 请问哪里有类似于wpe那样,可以抓某个进程的数据的可以在xp下运行的软件
- 菜鸟寒号(嚎):win32 application和win32 console application有什么不一样啊?
- vc源文件大小超标的问题
- 请问谁有win95的ddk
- 很简单的问题。在vc中使用_beginthread除了要 #include <process.h> /* for _beginthread*/ 之外还要加载什么库吗?
- 讨论:国内与国外的在线电影。
将WS_MINIMIZEBOX属性屏蔽就行了贝
Rem 以下几个API及其常量声明为了屏蔽窗体关闭按钮
Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Public Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Const MF_BYPOSITION = &H400&
Public Const MF_REMOVE = &H1000&
Public Const SC_CLOSE = &HF060&Public Function ShieldWindowCloseButton(frm As Form) As Boolean
Dim hSysMenu As Long
Dim n As Long
hSysMenu = GetSystemMenu(frm.hwnd, Flase)
If hSysMenu Then
n = GetMenuItemCount(hSysMenu)
If n Then
RemoveMenu hSysMenu, n - 1, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, n - 2, MF_BYPOSITION Or MF_REMOVE
DrawMenuBar frm.hwnd
ShieldWindowCloseButton = True
End If
End If
ShieldWindowCloseButton = False
End Function
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
cs.style &= ~WS_MAXIMIZEBOX;//加上
cs.style &= ~WS_MINIMIZEBOX
}
楼主你应该将帖子加分!
因为现在都凌晨1:20-----〉全是被你的问题搞得!明天还有上班呀!
嘿嘿!
[email protected]
---------------------------------
//make the child frame window maximize,so the view maximize!
void CMDI_TestView::OnInitialUpdate()
{
CView::OnInitialUpdate(); CFrameWnd *pFrame=NULL;
pFrame=this->GetParentFrame();
if(pFrame)
{
pFrame->ShowWindow(SW_MAXIMIZE );
}
// TODO: Add your specialized code here and/or call the base class
}添加消息:WM_SYSCOMMAND
//mask the systemcommand message!
void CChildFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
// TODO: Add your message handler code here and/or call default
//mask the system message :maximize button,minimize button
//and restore button!
if(SC_MAXIMIZE==nID||SC_RESTORE==nID||SC_MINIMIZE==nID)
return;
CMDIChildWnd::OnSysCommand(nID, lParam);
}