|
But that returns an HTREEITEM, can't find any details on this structure on MSDN.
|
|
|
|
|
|
TVITEM* Selected;
TreeView_GetItem( HandleforTreeList, Selected);
Fails saying uninitialized variable!
|
|
|
|
|
That is no surprise.
TVITEM item;
item.mask = ;
...
TreeView_GetItem( HandleforTreeList, &item);
|
|
|
|
|
|
Hello,
I have Mfc application with formview and child dialog box. formview contains couple of everything(i.e checkbox,radio button,edit control,buttons) and Now I have dialog box, i want to hide all data in formview when i click in my dialog box(in simple way i want to get rid of all the buttons,checkbox and everything in formview when i click in dialog and if i click back to form they all should be back.
I have tried, Hide,invisivle,showwindow and everything but that doesn't make sense to my problems since i do not want to hide or invisible my form, i want to hide or invisible the stuff inside formview.
anyone got a clue? Help me.
Thx,
Cheers from canada.
|
|
|
|
|
What's the relation between the dialog and the formview ? is it a modal dialog or a modeless dialog ?
Why do you want to hide the different "everything" when the user clicks the dialog ?
doesn't CWnd::ShowWindow(SW_HIDE); (or SW_SHOW) work ?
Watched code never compiles.
|
|
|
|
|
Here's what i have. I have formview and INSIDE that I have MyTabCtrl and Inside each tabs I have dialog, so apparently dialog is part of formview if i try to call(SW_SHOW) or (SW_HIDE) with formview's m_hWnd it will hide everything in form(wooops dialog too!) yes. it will also hide my dialog(tab control) which i want visible so it is not possible to use (sw_hide) or (sw_show) or any invisibility code for formview.
What i want is when i double click on dialog box(which is part of tab control and tab control is inside formview) it suppose to hide all buttons and check box edit tools and everything which is visible on formview expect tab control and i have like 100 buttons and edit tools so it's not a good idea to get each item and hide or make them invisible it would make my complexity to it's highest level.
thx for your time,
cheers from canada
|
|
|
|
|
If you have added a member variable to you controls like button, check boxes then use below
memberVariableName.ShowWindow(SW_HIDE);
If you have not added member variable then use below
CButton hBtn = (CButton *) GetDlgItem(IDC_Button1);
hBtn->ShowWindow(SW_HIDE);
|
|
|
|
|
yes I defined all member variables, but it's not a good idea to take each member variables and hide/insivle them individually since i already said in last post i have 100+ buttons/edit control/check box and bunch of other things on form(it's scientific calculator, oh yea). so If there is another code or method to hide all buttons with one line of code(that would work ! )
thx for your time,
cheers from canada.
|
|
|
|
|
Tryout this
BOOL CALLBACK HideAllChildren(HWND hwnd,LPARAM) {
ShowWindow(hwnd,SW_HIDE);
return TRUE;
}
void HideControls(HWND hDlg) {
EnumChildWindows(hDlg,HideAllChildren,0);
}
HideControls(GetSafeHwnd());
or
WinAPI Solution
for (CWnd *pwnd = GetWindow(GW_CHILD); pwnd != NULL; pwnd = pwnd->GetNextWindow(GW_HWNDNEXT))
{
}
|
|
|
|
|
Don't invent "incredible and magic solutions" whose sole effect is to disorient the user. Just make the dialog modal!
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
making dialog modal will work ? I do not think so since i am dealing with formview. All I want IS hide all edit control/buttons and rest of things when i click on dialog box.
thx for your time,
cheers from canada.
|
|
|
|
|
Let me paraphrase your talk:
"Entering the motorway the other side will work ?? I don think so: all I want to do is tell all those people coming against me to keep aside".
The problem is not the formview, but the bad design that has been done initially.
Even if you succeed in you intent, how many other application out there you know behaving that way? It is quite hard for a user that clicks somewhere and see something suddenly disappear to not be disoriented.
If you want to go in that direction think to disable the buttons, not to hide them.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
I think you haven't understand the issue yet. Problems is not bad desgining neither formview nor dialog box, User won't be shocked when everything disappear since graph will be maximized and doubleclicks again will get it back to original size and most of the application DO HAVE the feature of doubleclicking even in mainwindow if you double click the header it will be maximized and double clicking back will make it look normal, but I am trying to do that in dialog boxes, It's not hard it just need little more time efford and better understanding of MFC ( WHICH I DO NOT HAVE SINCE I STARTED IT LEARNING BY MYSELF SINCE MONTH ONLY)
Yes disabling or hiding will not make much more diffrence since graph will be overlapped to them ( all i want is when i click just hide/disable/invisible or anything i just dont want them on formview LOL!)
thx for your reply. appericiate it, RESPECT
cheers from canada.
|
|
|
|
|
GetDlgItem(ID_of button)->ShowWindow(SW_SHOW);//For show control
GetDlgItem(ID_of button)->ShowWindow(SW_HIDE);//For Hide control
|
|
|
|
|
thx for your reply. But i do not think that you have read my previous post, as i mentioned i have 100+ buttons so it's not a good idea to getdlgitem for all of them and hide them or show them because it would just make my code's complexity to 100+ which i do not want so if there is another way/idea to solve that problem please let me know.
thx again,
cheers from canada
|
|
|
|
|
if you have similar kind of control (button or editbox) then you can defined array of control variable.
after that, using for loop you can hide / show the control.
eg. CButton m_MyButton[200];
for(int i=0;i<200;i++)
{
m_MyButton[i].ShowWindow(SW_SHOW);
}
|
|
|
|
|
I managed to retrieve my desired icon from shell32.dll.
However the icon doesn't appear smooth! :S
HICON hItem = ExtractIcon(0, L"C:\\Windows\\system32\\shell32.dll", 8);
ImageList_AddIcon( himlIcons, hItem );
DestroyIcon(hItem);
Manifest Dependency fixed it!
modified on Thursday, August 19, 2010 1:43 PM
|
|
|
|
|
You will run into trouble if you deploy on a machine with the os installed on a different drive or in a different folder.
You would be better off using SHGetFolderPath[^] with a nFolder value of CSIDL_WINDOWS . Then build your path from that. Have look at PathAppend[^] for instance.
|
|
|
|
|
Hi all,
i m working on MFC SDI type application
i want to develope a Image designer type utility,like image designer for ID cards.
from where i can start?
how can make it this in MFC SDI type application.
if possible please provide me any help of examples.
please tell me how can i do this.
i m waiting for ur valuable suggestion.
thank in advance.
|
|
|
|
|
Le@rner wrote: ,like image designer for ID cards.
What is this ? a paint like program ?
Me think you don't know what you want, how you want to do it.
Have a look at the MSDN scribble tutorial.
And good luck.
Watched code never compiles.
|
|
|
|
|
How do I use CPen with a width > 1; I using MM_ANISOTROPIC and my Viewport set to 1000,100 ? When I attempt do draw a random line, the width changes I believe because of the 10:1 scale that I set. How can I keep my viewport at 1000,100 and adjust the width on my line so that the width stays the same whether I draw a line horizontal, vertical or something in between?
|
|
|
|
|
I think there's little you might do. In other words, could you abandon the MM_ANISOTROPIC mode?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thank you, Pallini. i cannot abandon MM_ANISOGTROPIC, i must draw tow datas curves in the figure, they use the same time X axis, but they have different Y units and measurment ranges.
i hope i describe the questiong clearly,any more advices?
|
|
|
|