|
Hi folks i need a little help about hiding maximize button.
I have created an app wizard MFC application..
I wanted to set the window (show when application starts execution) dimension which i did in Function
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
setting cs width and height.
The problem is now i want to make sure this windowsize is unchaged;
for this i want the user is only able to minimize and open the window to the size i fixed in "PreCreateWindow"..
i.e. maximize and restor button are disabled plz tell me how to do it...
Reagrds, Jinbaba
|
|
|
|
|
Is it checked the "Minimize box" and unchecked the "Maximize box" in the Dialog properties/Styles tab ?
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
|
How to show CBitmap in VC++ 7.0 picture control, I assign it
CBitmap *bmp;
bmp->CreateBitmap(w,h,1,24,pdata);
m_static.SetBitmap(HBITMAP(hbmp));
but it does not appear in picture control?
9ine
|
|
|
|
|
Hello
Did you use SS_BITMAP style for your static control ?
Here is sample from MSDN:
CStatic myStatic;
myStatic.Create(_T("my static"),
WS_CHILD|WS_VISIBLE|SS_BITMAP|SS_CENTERIMAGE, CRect(10,10,150,50),
pParentWnd);
myStatic.SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE(OBM_CHECK)) );
Andrew
|
|
|
|
|
No, I need to display manualy created bitmap, not from resource.
you see bmp->CreateBitmap( .... ) with pdata pointing to bitmap pixels values
As to static, it is added from toolbox with type Bitmap.
9ine
|
|
|
|
|
9ine wrote:
No, I need to display manualy created bitmap, not from resource.
So, what is the problem ? SetBitmap is expecting HBITMAP. You can load it from resource or create it manually.
Andrew
|
|
|
|
|
the problem is that picture box static does not want to show my assigned bitmap after I created it manualy?
CBitmap *bmp;
bmp->CreateBitmap(20,20,1,24,pdata);
static.SetBitmap(HBITMAP(bmp));
?????
9ine
|
|
|
|
|
Can anyone provide me Source code which could detect Spywares which Run under stealth mode for detecting keyloggers? Is there any specific algorithm for detecting spywares?
|
|
|
|
|
Yes there is. It is called virus scanner!
Don't try it, just do it!
|
|
|
|
|
I have made a simple dialog based application in which there is just one button.ON that button click i have written the following code.
ShellExecute(NULL,"open","c:/myfile.zip",NULL,NULL,0);
The problem is when i click the button first time , the dialog window loses the focus and that zip file doesn't open but when i press that button again it perfectly opens that file.Can anyone explain what is the problem.
Thanks in advance.
Be FaithFull To Your Work.
|
|
|
|
|
Usman Tasleem Akshaf wrote:
i have written the following code.
ShellExecute(NULL,"open","c:/myfile.zip",NULL,NULL,0);
You mean ShellExecute(NULL,"open","c:\\myfile.zip",NULL,NULL,0) , right?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Try using SW_SHOWNORMAL as the last parameter:
ShellExecute(NULL,"open","c:\\myfile.zip",NULL,NULL,SW_SHOWNORMAL);
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Now it works perfect.But what i want is that when i click the button , that file get unzipped.What code should i include to do that.
Thanks in advance.
Be FaithFull To Your Work.
|
|
|
|
|
I think you are not using pkunzip from the Dos world, so...
Check your unzip software e.g, WinZip or WinRar etc for its command-line version to unzip the files. Look in the unzip software's help.
this is this.
|
|
|
|
|
Either that or use the zip lib (google for it) to unzip the files yourself without launching a separate application.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hello..
I made a dialog resource with three CButton's and a CEdit for use on a CDialogBar.. the dialog resource is set to WS_CHILD..
Now when i used the resource on a CDialogBar.. and i used CDialogBar directly without subclassing it, the buttons is always disabled... But i didn't set it to disabled on the resource editor..
Why is this?
The scenario is that I have a CDockBar docked on a mainframe, and i placed a LayeredCWnd on it as its child..Now the LayeredCWnd has the CDialogBar as its child..
Then when i run the program the buttons in the dialogbar is always disabled, while the Edit control is not..
"WatcH the BIrDiE!"
|
|
|
|
|
I don't understand why it's happenning but you could force to enable these controls when you initializes the dialog (OnInitDialog):
m_button.EnableWindow(true);
m_edit.EnableWindow(true);
Hope it helps,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
One reason they may be disabled is that there is no handler for them. Since you say the DialogBar is on your MainFrame, add handlers in the MainFrm class for the buttons.
I'm assuming MFC here, and MFC automatically disables items it can't find a handler for.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Well, actually i did have a handler for the buttons already.. specifically the OnButtonClicked handler.. tnx anyways..
|
|
|
|
|
hey,
thats a good idea.. im gonna try that.. tnx
but still want to know why the buttons are disabled by default when im using dialog bars -- not dialog boxes..
regards,
Maverick
"wATCh THe BirDIe!..."
|
|
|
|
|
Is the handler in your MainFrm class or some other class. Since the DialogBar is in the MainFrame, that's where the handler needs to be.
If it is there, I'm at a loss why the button is disabled.
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I want to make a tree control based on database file.(I want to group the same occurence in database using tree control). but when I run my program, the tree control is not grouping
here i my function:
HTREEITEM CCDBMainDlg::LoadTree(CStringArray& tree)
{
//HTREEITEM hItem2;
m_treeNetwork = m_treeCDB.GetNextItem(m_treeNetwork,TVGN_ROOT);
//m_treeNetwork = m_treeCDB.GetChildItem(m_treeNetwork);
//m_treeCDB.SetImageList(&m_ImageList,TVSIL_NORMAL);
if((m_treeNetwork = m_treeCDB.GetChildItem(m_treeNetwork)) != NULL)
{
while(m_treeCDB.GetItemText(m_treeNetwork).Compare(tree.GetAt(12))!=NULL || m_treeNetwork != NULL)
{
m_treeNetwork = m_treeCDB.GetNextSiblingItem(m_treeNetwork);
}
if((m_treeNetwork = m_treeCDB.GetChildItem(m_treeNetwork)) != NULL)
{
while(m_treeCDB.GetItemText(m_treeNetwork).Compare(tree.GetAt(11))!=NULL || m_treeNetwork != NULL)
{
m_treeNetwork = m_treeCDB.GetNextSiblingItem(m_treeNetwork);
}
if((m_treeNetwork = m_treeCDB.GetChildItem(m_treeNetwork)) != NULL)
{
while(m_treeCDB.GetItemText(m_treeNetwork).Compare(tree.GetAt(0))!=NULL || m_treeNetwork != NULL)
{
m_treeNetwork = m_treeCDB.GetNextSiblingItem(m_treeNetwork);
}
}
else
{
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(0),0,1,m_treeNetwork);
}
}
else
{
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(11),0,1,m_treeNetwork);
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(0),0,1,m_treeNetwork);
}
}
else
{
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(12),0,1,m_treeNetwork);
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(11),0,1,m_treeNetwork);
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(0),0,1,m_treeNetwork);
}
m_treeNetwork = m_treeCDB.InsertItem(tree.GetAt(1),0,1,m_treeNetwork);
return m_treeNetwork;
}
sorry if my function is too complicated, because I am still new in MFC
pls help..thx
|
|
|
|
|
Hai..
I want to get the path of the file which is currently opened in the notepad. Please let me know.
Thanks,
E.Veera Raghavendra.
|
|
|
|
|
You want a third app to find the path to the file open in notepad ? If notepad has a MRU list, it's probably in the registry, otherwise I reckon you're in trouble.
Christian Graus - Microsoft MVP - C++
|
|
|
|