|
I need to update the cut, copy, and paste items on the edit menu before the edit menu is shown. However, I'm learning that this doesn't work in a dialog based application. I know there has to be a way to do this. Can someone help me out?
|
|
|
|
|
Well, since nobody replied to me, I figured that I would post for the sake of everyone else.
I found that to update menu items in a dialog, you need to intercept the WM_INITMENU msg. Then do your enabling and disabling.
For controls like buttons and such, you can intercept the WM_KICKIDLE msg. Then inside there you can call UpdateDialogControls(). This doesn't call the UPDATE_COMMAND_UI for the menu controls though. That's why you have to intercept WM_INITMENU.
Hope this helps.
--Trey
|
|
|
|
|
Hi,
I'm using a wang image edit ctrl in coordination with a database. I want to display simple text annotations programmatically. I used the stamp Text annotations but there is no way to set their height and width parameters.
If i use the text annotations, i'm not able to set text programmatically (there is no SetAnnotationText() fct).
all this in VC++.
How can i either set height and width of the stamp text annotations or set text programmatically with the text annotations ?
I also want to perform Drag and Drop operations but it seems that those fcts are only available in VB.
Thanks
|
|
|
|
|
Hello, I have got a MDI interface with Child windows that own Property sheets:
CChildFrmA::CChildFrmA()
{
m_PS = new CPropSheetA("",this,0,5); // overloaded to set the # of pages dinamically
}
BOOL CChildFrmA::PreCreateWindow(CREATESTRUCT& cs)
{
cs.cx = 514;
cs.cy = 436;
cs.style = WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_SYSMENU | WS_MINIMIZEBOX | WS_OVERLAPPED;
cs.dwExStyle |= WS_EX_CONTROLPARENT;
m_PS->SetWizardMode();
m_PS->Create(this,WS_CHILD | WS_VISIBLE);
m_PS->SetActivePage(0);
return CMDIChildWnd::PreCreateWindow(cs);
}
Now I get the wanted result but ther is still a problem: in this application the mouse can't be used, and I can't set the focus to the firs control of the first property page without it, I've tried to use Setfocus when the Child Window is being activated, and when it gets the focus, but there's no result, then I've tried to use a thread to do it, and yes, the focus it's placed to the control, but it gets as it was disabled (it don't works).
Please, if someone know how to solve this or how to give me some indications of where I can find information about it, it would be fantastic.
Thank you in advance
PD: I'm very novice, if you see something that's extremely wrong I would like to know it, thanks and as always excuse my english...
|
|
|
|
|
Hi
I have a application running which got tree control in it(say Windows explorer). I get the handle of the tree control through another program (my program) and then try to get the tree control items string. But I always get null, but even though I can do other operation like delete a particular item from it. (both the program are in different process).
Cant I get the string for a third party application running in a different process? I know I can get string from the edit control, but I could not get from a tree control.
Regards
Ravi
|
|
|
|
|
I assume you have a char buffer and you're putting its address in a TVITEM struct, and passing that struct in a TVM_GETITEM message? That won't work because the process with the tree can't access the memory in your process. You're lucky the other process isn't GPFing, actually.
|
|
|
|
|
Yes, I did the same. But I could get the edit box text, how?
Also Is there a way to get the tree control item and its strings?
regards
Ravi
|
|
|
|
|
Becuase you get an edit box's text with GetWidowText(), which is designed to work between different processes.
|
|
|
|
|
Thanks Mike for your answers!
But I dont understand they gave the capability to GetWindowText but not to treecontrol! If they gave they should have given to all or just none!
Oh boy, I want to get the strings from the control!!! any help is appricated!
regards
Ravi
|
|
|
|
|
Hi !
How to read the data from a particular location of the disk. (i.e., like reading physically from 10 th clustor of 2nd sector). Even hint would be helpful.
Thanks...
John
|
|
|
|
|
Windows makes this tough to do. If you are up to writing a device driver, I think the bios INT 13h Extended Read (42h) will do it. This is buried in the DDK docs under 'Design and implementation guide' | Interrupt 13h Extension APIs' | 'Reference' in the MSDN.
I doubt you can do this kind of thing through DeviceIoControl. If its possible, it would be NT only I think.
Just passing on the hints (confusion?) I've managed to scrounge so far...
DOS was so cool...
|
|
|
|
|
Hi !
I want to get handle of a control in a web page. I used WindowFromPoint function but I am getting the handle to the container of that control. I want to know how the events get generated inside a web page and how the controls in the page (like command buttons, combo boxes, etc.,) are identified. If I want to manipulate those controls from out side the browser, is it possible? (like normal window and all it's controls could be mainipulated from out side the application).
Thanks in advance...
John
|
|
|
|
|
In Internet Explorer you cannot get it. Since the whole container is a single window, you will only get the handle of the container.
But you can get in netscape navigator, since they implement as a normal windows program and then create controls on runtime! SO it will work in netscape, but not in IE.
Regards
Ravi
|
|
|
|
|
Hi,
I have some questions concerning application distribution:
I have a list of dependencies (I used the dependency tool of VC++6.0):
Executables
MyApp1.exe
MyApp2.exe
DLLs
1. My Application DLLS
MyDLL1.dll
MyDLL2.dll
2. MFC DLLs
MFC42.DLL
3. Other DLLs
advapi32.dll
comctl32.dll
comdlg32.dll
gdi32.dll
imagehlp.dll
kernel32.dll
msvcirt.dll
msvcrt.dll
ntdll.dll
rpcrt4.dll
shell32.dll
shlwapi.dll
SlsApi.dll
user32.dll
I want to install as many private copies of these DLLs as I can. (I am horrified of upgrading people’s systems without their knowledge. (I want to avoid copying DLLs to the system32 or system dirs)
That means e.g. I put the MFC42.dll in the .exe module path. (my own local MFC dll copy)
Which of the other DLLs should I include in my install program?
I can’t imagine having my own private copy of e.g. ntdll.dll, ….
Could someone help me out here or at least point me at the information needed to get a correct list of redistributable DLLs (and their preferred target directory), so I do not have to ask this silly question in the future. Anyway, a solution for this particular distribution would be highly appreciated.
Oh yes, static linking of MFC is out of the question for technical reasons (program structure -> explicit linking mechanisms, …).
Best Regards,
Gert.
|
|
|
|
|
Hello!
I've created a CListCtrl with ownerdraw and everything works just dandy, but there is one thing.
What message does Windows send when the user uses the down and up arrows to scroll in the list? It's not the normal WM_VSCROLL when using the scrollbar, it's something else.
I need the message that comes after the listctrl has been redrawn.
Please help me!
/Mathias
|
|
|
|
|
Hello Mathias,
what you can do is trap the message (when the user pushes the up or down arrow = button) and then use this functions to scroll: BOOL Scroll( CSize size );
Check the msdn for more specifics on the functions. Since it's an ownerdrawn CListCtrl, you'll have to redraw everything yourself.
|
|
|
|
|
First of all, thanx for the hint.
I was probably not descriping my question enough.
The thing is, when the list has more items than can be shown and the user selects the item at the bottom of the list window(that are shown, more items below) the listcontrol automatically scroll down(I want it this way,EnsureVisible(...)) one row. This is where the problem start. After it has repainted itself, I need to calculate what items are shown and therefore wants a message from Windows telling me that it has been done, like the message SB_ENDSCROLL associated with CWnd::OnVScroll.
Thanks!
/Mathias
|
|
|
|
|
Maybe you have to take a different approach:
you said:
>>I need to calculate what items are shown
Then you could use this function:
int GetTopIndex( ) const; (=The index of the topmost visible item.)
Since the listcontrol is owner drawn, you should get a WM_DRAWITEM message. You should make a handler for this and then you can use the GetTopIndex function to get the first visible item.
|
|
|
|
|
Hai
Iam interested in writing my own installation program to setup the files.What are concepts and procedures you have to follow .Any help would be appericiated
|
|
|
|
|
Depends on wether you are going to write a general install program or a specific install program just for your application. I'll guess it's the first one you are talking about.
1. It has to be easy to use.
2. Things it needs to do:
2.1. Copy files to a target directory
2.2. Compress files to reduce install size, uncompress them again while installing.
2.3. Ability to make subdirectories and copy files in there
2.4. Make it easy to copy files to certain specific windows directories like system32 or fonts.
2.5. Place (if wanted) icons on desktop.
2.6. Make an entry in start menu
2.7. Possibility to add a certain document type to the system
2.8. Registry control
2.9. Cool looking customizable install screens (different types of setup, license agreement , ... )
2.9. Properly uninstall (=undo all previous steps)
That's about all i can think off. You might want to take a look at this freeware installer that i frequently use, Inno Setup, http://www.jrsoftware.org/
|
|
|
|
|
Is there a special way to make self-extracting .exe's, if I have an .exe file but want to be able to specify a specific config file and zip file.
/XTSea
|
|
|
|
|
You might want to check these links here on codeproject
-> http://www.codeproject.com/useritems/sfxframework.asp
-> http://www.codeproject.com/file/self_extractor.asp
They should help you get started
|
|
|
|
|
I would not suggest you to write your installation program. And according to the new logo requirements of windows you have to install through Windows Installer(MSI). There are variety of reasons to enfore this, since MS beleives installation is one of the main culprit in many "file missing" or dll hell problem.
So you *have* to go through MSI to install your program and I suggest to look at ISWI(InstallShield for WIndows Installer). or Visual Studio Installer.
Regards
Ravi
|
|
|
|
|
I found another great installer that's free. I've found it to be easier to use than pay installer and it has all the features. It's call GP-Install and you can get it at: http://www.qsc.co.uk/ They say that about 5000 applications use it. I would highly recommend checking there before spending any money on a pay installer. It's very professional!
|
|
|
|
|
I have the following situation:
DataDialog::Start()
{
...
m_pDataSet = new CDataSet(m_pDB);
try
{
m_pDataSet->Open()
}
...
}
DataDialog::OnReceiveData()
{
...
if (m_pDataSet->IsOpen())
{
m_pDataSet->AddNew();
...
m_pDataSet->Update();
}
...
}
DataDialog::Stop()
{
...
if (m_pDataSet->IsOpen())
{
try
{
m_pDataSet->Close();
}
...
}
delete m_pDataSet;
...
}
where m_pDataSet is a pointer to an object derived from CDaoRecordSet and m_pDB is a pointer to a CDaoDatabase. My problem is that I get an unhandled exception when I close the data set (the data is stored fine). I tried opening and closing the data set in the OnReceiveData function and that does not crash, but it cannot keep up with the incoming data.
Any suggestions?
Thanks.
|
|
|
|