|
Property sheets in wizard mode will be just what you want.
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
yes. create your dialog app, then change the CDialog to a CPropertySheet and add as many pages as you need. you'll also probably want to make this a "wizard" type of property sheet.
unfortunately, it's not a small topic, so i can't lay it all out for you. it's not really difficult, but some parts are tricky the first time you see them.
-c
<font size=-2>
main(){float _,l,O,I,o,x;char i;for(x=-1;x<1;x+=.05,putchar(10))
for(o=-2;o<.9;o+=.05,putchar(i?'?':':'),_=l=O=I=--(i=1))for
(;((O=_*_)+(I=l*l)<4)&++i;l=_*l*2+x,_=O-I+o);}
</font>
|
|
|
|
|
//I want to dynamically create a new combo box just to the right of an existing combo box. The problem is I do not seem to be able to set the size of the dynamically created combo box. Any suggestions???
CComboBox* pExistingCombo = (CComboBox*)GetDlgItem(IDC_COMBO1);
//The new control should have the same stlye as the existing control
DWORD dwStyle = ::GetWindowLong(pExistingCombo->m_hWnd, GWL_STYLE);
//Get the edit area and drop area of the old control so they can be the same
//size in the new control
CRect rEditArea, rDropDownArea;
pExistingCombo->GetWindowRect(rEditArea);
ScreenToClient(rEditArea);
pExistingCombo->ShowDropDown();
//get the size of the drop area
pExistingCombo->GetDroppedControlRect(rDropDownArea);
pExistingCombo->ShowDropDown(FALSE);
ScreenToClient(rDropDownArea);
//Move the new control over to the right a little
rEditArea.right += 150;
rEditArea.left += 150;
//Build the new combo control
m_pComboNew = new CComboBox;
m_pComboNew->Create(dwStyle, rEditArea, this, 1222);
m_pComboNew->AddString("one");
m_pComboNew->AddString("two");
m_pComboNew->AddString("three");
//Question??? - How do I set the drop down size of new combo to be same as existing combo?
m_pComboNew->ShowDropDown();
Thanks
|
|
|
|
|
Before creation, add this line:
rEditArea.bottom += rDropDownArea.Height(); The non-dropped height of the combo box is always determined by the size of its assigned font; sizing it vertically determines the dropdown height.
--------
When will I realize that this skin I'm in
Hey, it isn't mine
And when will the kill be too much meat for me to hide on... -- Blind Melon, Skinned
|
|
|
|
|
Thank you
That was right on the money.
|
|
|
|
|
hi,
I have trapped Mouse events using hooks for a application,I want to send these events to similiar application,so that they behave similary.Is there a way to send Mouse events to window.
Thankyou for spending time.
vineet
|
|
|
|
|
SendMessage()<br />
SendMessageCallback()<br />
SendMessageTimeout()
Jeremy L. Falcon
"Tickle me Elmo -- please!"
<nobr>
Homepage : Sonork = 100.16311 Maybe my mangling might misguide malicious miscreants momentarily?
|
|
|
|
|
Thankyou for you prompt reply,
I tried with sendMessage ,but did not work out
SendMessage (handle1,WM_MENUSELECT,MF_MOUSESELECT,0);
Where handle1 is the handle of the destination window
WM_MENUSELECT is wparam parameter and mouseelect the LPARAM PARAMeter
vineet
|
|
|
|
|
Can anyone help with this one? I am in one process. I use getforegroundwindow ato get the handle to the active Window. However, If it is a view, it does not give me the control that has the focus. This is what I want. I have tried to get GetFocus, etc but nothing seems to work.
Any ideas?
Thanks.
|
|
|
|
|
I have an app that I have a file name as a cmdline data. I use __argv[1] to access this. I will store this to use later. If the file exists, when I try to open it it is fine.
However, I am getting a strange thing when the file does not exist. In my program I don't use it or allow the user to build a file using this name with new parameters. However, my program automatically exits and the OS tells me that the file can not be found. I have looked at my code backwards and forwards. THis has to be the OS or MFC doing this. I have a feeling it is the CCommandLineInfo and ...ProcessShellCommand... In MSDN, it seems to say that the file will be taken as a file to be opened by the App. Is there a way around this? I do not use the OPen etc functions at all.
This has been bugging me for half a day now. Thanks for any help.
|
|
|
|
|
ummmm how about not doing the command line processing but just pulling the filename for use later in your app?
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
Do you happen to use an MFC class, like CStdioFile, to open the file? I believe CStdioFile (and others) can throw an exception if the file doesn't exist. That could cause your program to exit if you don't catch the exception.
Just a thought...
No generalization is 100% true.
Not even this one.
|
|
|
|
|
Put break points and try and locate the error area.
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
I have been trying to change icon of executable by using APIs like UpdateResource. But this doesnt work for me. I always corrupt the resource . Infact the old ones remain there and new gets in but in corrupt form. I am using WinXP Pro. Can somebody guide me about how to do it.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Why are you using an API to change the resource? Use the Resource editor. The icon with the lowest resource ID is your program's icon - what shows in Windows Explorer, for instance. Make sure to have a 16x16 image, and a 32x32 image. Include a 48x48 image if want your icon to show up nice and pretty on XP systems showing files as "tiles".
No generalization is 100% true.
Not even this one.
|
|
|
|
|
No I need to change icon at runtime. I have one exe which has to chaneg some information in another exe which includes changing main icon. So it has to be done by API. I tried other libraries but nothing works. Can u help me.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Of course, my initial reaction to this problem would be to re-think your design. But I can't think of a way to do it at runtime...
No generalization is 100% true.
Not even this one.
|
|
|
|
|
Well thanks for your time. I have found a solution.
The icons are placed in Exe with numbers 1,2.....So first number represents 32x32 pixel icon and 2 represents 16x16 pixel icon. The problem in my approach was that I was tryin to change Icon Group and Icons. But when I changed only Icons and not icon group it worked because icon group is just a refrence to it. If you want I can mail you the code I used.The second problem was in reading ICON file. I was not reading correct information which was causing corrupt icons in exe.It works fine using UpdateResource API.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
hi
you can change/add the icon of ur application easily
You can import new icons from anywhere and then add them as your resourse(that will automatically added when u import)and delete/change name of IDR_MAINFRAME and rename the new icon resourse as IDR_MAINFRAME ...an easy and tricky way...hahahaha
ok try it now....!
Renjith
sofware behind everything...
so enjoy with the codes...
Renjith Pandalam
|
|
|
|
|
No I wanted to change Icon of an exe at runtime and not through IDE. But now I have found a solution. Read my comment below.
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=169709#xx169709xx
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
You're going to have to use the UpdateResource() API.
Jeremy L. Falcon
"Tickle me Elmo -- please!"
<nobr>
Homepage : Sonork = 100.16311 Maybe my mangling might misguide malicious miscreants momentarily?
|
|
|
|
|
I have 2 edit boxes, A & B. B cannot have a value in it unless A does. B is disabled until A gets a value. When the user erases the value in A, I want to disable and erase the value in B. This all works fine in the debugger with the following code:
if (m_VidValue.IsEmpty())
{
m_Prefix = "";
GetDlgItem(IDC_VID_PREFIX_EDIT)->EnableWindow(FALSE);
UpdateData(FALSE);
}
When I run the code outside the debugger, the field gets disabled, but it does not clear. I can make it clear by forcing a RedrawWindow(). Is there a better way to do this without redrawing and getting the annoying flicker?
Thanks in advance,
Bob
|
|
|
|
|
You could try using SetWindowText("") to clear an edit box, for instance:
m_Prefix = "";
CWnd *pControl = GetDlgItem(IDC_VID_PREFIX_EDIT);
if(pControl)
{
pControl->SetWindowText("");
pControl->EnableWindow(FALSE);
}
No generalization is 100% true.
Not even this one.
|
|
|
|
|
SetWindowText does not work either, unless I do a RedrawWindow().
|
|
|
|
|
Hmm, that seems odd. Are you doing the SetWindowText before you disable the window?
You might be able to get away with a RedrawWindow only on the edit box, and not the whole dialog, which may help the flicker problem.
No generalization is 100% true.
Not even this one.
|
|
|
|