|
If you are using MFC, make sure you are not dealing with taskbar icon in CMyDocument::OnNewDocument() or CMyDocument::OnCloseDocument() or CMyDocument::DeleteConetents(). Its better to handle taskbar add/remove operations in CWinApp derived class.
Just some wild guesses
Hth,
Ramu
|
|
|
|
|
Ramu Pulipati wrote:
If you are using MFC, make sure you are not dealing with taskbar icon in CMyDocument::OnNewDocument() or CMyDocument::OnCloseDocument() or CMyDocument::DeleteConetents(). Its better to handle taskbar add/remove operations in CWinApp derived class.
I do not actually handle any of taskbar events explicitly, nor I use tray icons. This is just regular taskbar button that does not work...
Thanks,
Yuri
|
|
|
|
|
Any idea, what is the best way to automatically implement opening last opened document in SDI ?
1. It's name is stored in registry under key ....\Recent File List\File1, but isn't there best way to get it from MFC ? ( i couldn't find any object's method for that)
2. where to place code for opening document ? CDocument::OnNewDocument() ? C..App::InitInstance() or somewhere esle ? How to open file in CDocument ?
Thanks
rrrado
|
|
|
|
|
Use InitInstance(), since this is the function which should be used for application startup.
Replace 'ParseCommandLine(cmdInfo);' in CMyXXXApp::InitInstance with
if(m_pRecentFileList->GetSize())
{
cmdInfo.m_nShellCommand = CCommandLineInfo::FileOpen;
cmdInfo.m_strFileName = (*m_pRecentFileList)[0];
}
Do a include of afxadv.h at the top.
Hth,
Ramu
|
|
|
|
|
This seems to be good idea,thank you, i'll try this
rrrado
|
|
|
|
|
it is better to keep the filepath in registry and open the file when u load the doument..try the streaming (CArchieve)
Renjith-The CPian.
|
|
|
|
|
I have a tree control that I create as following:
m_TreeView.Create (WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS | TVS_EDITLABELS |
TVS_SHOWSELALWAYS | WS_HSCROLL | WS_VSCROLL | WS_BORDER , CRect (0, 0, nX1, nY1), this, 1001);
m_treeview is offcourse derived from CTreeCtrl.
However, when I try to edit a tree label, EditLabel returns a null handle which indicates that something is not right..
At first I thought it might be that my control is not editable, but it is obviously declared as editable.
Any idea what the problem maybe?
|
|
|
|
|
Could someone help me.. I am trying to figure out how I can do a find all open applications and add the names of each open window to a combo box.
Thanks,
Rob
|
|
|
|
|
what u mean ..alll the open procesess or the applications open in the desktop??be Specific...
R_Renjith The CPian
|
|
|
|
|
I would like to populate a combo box with the Names of all open applications, for example ("Yahoo! Messenger", "System Scan Status", "Virus Scan Console" etc....) I would like to see a list of every application (the window name) in the combo box not the .exe name..
Rob
|
|
|
|
|
I assume you doesnt mean enumerating process..???
To list all desktop windows, use the following code.
HWND hWndNext = NULL;
TCHAR szCaption[MAX_CAPTION_SIZE];
while((hWndNext = FindWindowEx(NULL, hWndNext, NULL, NULL)) != NULL)
{
memset(szCaption, 0, sizeof(szCaption));
GetWindowText(hWndNext, (LPTSTR) szCaption, (sizeof(szCaption) / sizeof(TCHAR)));
//use szCaption here...
}
Check MSDN for detailed FindWindowEx API.
Hth,
Ramu
|
|
|
|
|
|
//call the function in the starting of ur app
EnumWindows(EnumWindowsProc,0)
//this is a cal back this will enumerate all the desktop windows add this as a global func..
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lparam)
{
CString wsTitle,csFile;
char szBuffer[255];
GetWindowText(hwnd,szBuffer,255);
///here u get the name of the application title in the window in szBuffer..(all open windows in desktop)..fill it in the combo
}
return true;
}
R_Renjith The CPian
|
|
|
|
|
Use the EnumWindows API.
I don't recommend using the FindWindow function, because I've heard that it can get stuck in infinite loops.
EnumWindow won't.
Check MSDN for help on using EnumWindow.
|
|
|
|
|
Can somebody please help me in understanding all the functionality of how this function works. (i.e fill in the parameters and what they mean)
Thanks!
|
|
|
|
|
There's a description on msdn
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I found an excellent explanation of this in the Platform SDK, under the heading Internet Development SDK. Unfortunately it is much too long to post here. I'd recommend a search at the MSDN website.
I Drowned Schroedinger's Stupid Cat!
|
|
|
|
|
Does anybody know a way of accessing the internet option through MFC? What i am trying to do is to access the internet options and block all pictures from being shown through MS explorer. Any help would be appreciated. Thanks!
what we do in life, echos in eternity...............
|
|
|
|
|
Most of the Internet Explorer settings can be found in the registry under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer
some of the settings are self explanatory... i don't know which one will turn off images, maby the Image Chaching key...
|
|
|
|
|
I have written an MFC CListCtrl-based properties control similar to one in Visual Basic and .NET. One of the property types available is a list of items that can either act as a list-only combobox, or an editable combobox.
For design reasons, I cannot simply place a CComboBox in the control to perform the in-place selection. So, I use my own CWnd container to hold the CListBox-derived list items and a CButton-derived action button. The CWnd container is created as:
bResult = m_wndDropDown.CreateEx (WS_EX_TOPMOST | WS_EX_TOOLWINDOW,
AfxRegisterWndClass (CS_SAVEBITS),
NULL,
WS_POPUP,
CRect (0,0,0,0),
pWnd,
0);
Where pWnd is the property list window, and where the actual window size and placement will be determined when it is displayed.
The reason for using a topmost toolwindow popup is to allow the dropdown list to extend beyond the bounding rect of the parent property list, as the dropdown for a standard combobox would. This all works fine and well with the one exception that, when the dropdown list has keyboard input focus (a requisite), it "steals" focus away from the rest of the application, and the apps title bar becomes rendered as inactive.
I have been unable to figure out how to duplicate what the real combobox does: allow the dropdown to extend outside of all window bounds and NOT make the application think it is inactive when the dropdown list has focus. Any ideas or solutions would be greatly appreciated.
Rob Whapham
Managing Software Engineer
AMX, Corp.
http://www.amx.com/
|
|
|
|
|
Hello,
First I want to thank everyone for all the help they have been giving me. I have never used C++ before and I am teraching myself off of the internet because I do not have any reference manuals. Anyway I have been able to complete my byte swapping program for the most part except I am having problems when I do a byte swap on a negative number. I am trying to swap a number that should be nagative after the swap. The number was stored using an SGI and I trying to convert the entire file on a PC and store the data as an ASCII file. I found some info on the internet and also from a few trials that says my numbers are incorrect when a negative number has it's bytes swapped. Has anyone had this problem and how should I deal with it. I assumed that it should swap correctly because the negative number is shown in the 8th binary bit and when it is a '1' it will creata negative. This does not happen though. I actually get a number with a very large exponent. Thanks for any help.
-Josh
|
|
|
|
|
You have to do the byte swapping on a signed number, if it's unsigned it can't get under 0.
hope it helps
|
|
|
|
|
Hi,
i use a ClistCtrl and i display string item
i want to have different color for letters of my string not a color for the whole string but a color for each letter
Is it possible ?
Thanks for your help
Pb
|
|
|
|
|
Yes: you can use Custom Draw to do this. There are a few articles available that show how to use Custom Draw.
Peace!
-=- James.
"Some People Know How To Drive, Others Just Know How To Operate A Car."
[Get Check Favorites 1.4 Now!]
|
|
|
|
|
Hi everybody,
I have a typical problem here. I am developing a database oriented application in vc++ using MFC and i need to generate a lot of reports for the application. How do i display them properly in a proper format. Please note i don't connect directly to the database but via a server application. I get the result of the query from the server and now i want to display the results in a grid format in the client. Is there any way of displaying the resultset in a Microsoft DataGrid directly through code without connecting to the database.
Thanks in advance.
Regards
Sailesh
|
|
|
|