|
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
|
|
|
|
|
Heyyyyy
Dont be THink like soooo..Never be think like the DAtabase control In VB..
If u want to show the recordset in the client.just use the ListControl in report View...and that is a nice interface...i think someone sumbitted here sme clasess in which u can directly printout from there..
orif u want professional stypeReport..use Seagate Crystal Report 8.0 that s a nice tool ...
R_Renjith The CPian
|
|
|
|
|
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
|
|
|
|
|
Hi All...
Pls help me..I am doing MCA and I want to do the Projects in VC++..Time for doing the Project is only 3 months.Can any one Suggest me a very good topic for my Project that can be either System side or Application based..
Thanks in Advance!!!!
|
|
|
|
|
You can do some client/Server Application. like the Remote Admin / voice Chat . i think that s suit for ur need ..Always remember abt the time limit to submit ur project When u design..
make nice even if it is a small one..
Remember :it is a MesageBoard always talk abt the doubts about the developments and related stuffs..always search in the available topics before submiting this type of request here..
R_Renjith The True CP ian
|
|
|
|
|
I am creating a color table dialog and would like to dynamically create some picture boxes of type RECTANGLE. Using the dialog properties dialog box, you can select from Frame, Rectangle, Bitmap, Metafile, and Icon. Using CPictureHolder allows creation of Bitmap, Metafile, and Icon only! I have tried the following in my OnInitDialog()thinking that an empty picture holder would be a rectangle.
No such luck!
// Create static rectangle
CPictureHolder PH;
PH.CreateEmpty();
CRect rcRender(20,20,100,100);
CRect rcWBounds;
GetClientRect(rcWBounds);
PH.Render(GetDC(), rcRender, rcWBounds);
I would simply draw rectangles except I want to add each picture box to a CToolTipCtrl so the color name is displayed.
Any help would be appreciated.
Thanks
|
|
|
|
|
On my way in to work I realized I have a variable scope problem and need to make the CPictureHolder object a member variable.
I am still interested in any input.
Paul <) (Dunce Cap)
|
|
|
|
|
I use Visual C++ 6.0.
I need to put a CRichEditCtrl and a centimeter ruler bar in a CWnd. The goal is that CWnd can appear anywhere in a dialog box to let user introduce formatted text using the ruler. It should work like a control.
My problem is that when my CWnd receives EN_HSCROLL notifications from CRichEditCtrl and get the values obtained from GetScrollInfo(), the values seem to me meaningless and I can't scroll my ruler accordingly.
Suppose for instance I have the following CWnd metrics:
a) client area width = 728 pixels (from 0 to 728)
b) rich edit client area width = 726 (728 minus the two borders?)
c) rich edit rect (SetRect) left = 21
d) rich edit rect (SetRect) right = 728
When the user type one more character after the most right position, CRichEditCtrl send the first EN_HSCROLL notification. When I get the values from GetScrollInfo() they are the following:
nMin=0 // ok
nMax=708 // why? (perhaps 728 - 21 = 707 plus one?)
nPage=706 // why?
nPos=3 // why? this for me is the most strange value
nTrackPos=3 // why? idem
I get also the caret position through GetCaretPos(). The value of x coordinate is 501. So the jump was from 728 (perhaps the last valid caret pos) to 501. This is a big jump! Why nPos only hace 3?
Suppose that after the jump, the user type more characters and a second jump occurs. Now the values are:
nMin=0 // ok
nMax=714 // why the maximum is not fixed?
nPage=706 // the same value...
nPos=9 // why? continue to be a strange value...
nTrackPos=9 // idem
I don't remember the caret position in this turn but the problem remains. How can I get the real jump of the scroll bar to scroll my ruler accordingly with the text in CRichEditCtrl? With the information of nPos it seems to be impossible.
I tried to understand the source code for WordPad but this is very, very confused because is not object-oriented and the ruler class, for instance, depends on many variables spread in other classes. Although this, the code of scrolling is simple. The WordPad application in OnUpdateCmdUI() uses GetScrollPos() and pass it to the ruler.
In my code I tried the same thing but the things don't work, also because I don't have the OnUpdateCmdUI() function. So, my ruler scrolls less than the real jump. This is the problem I have to solve.
Miguel Fonseca
miguel.fonseca@xerus.pt
|
|
|
|
|
Hi All,
I am currently working on a XML interface to my application. I have implemented this as a COM interface, usable from within any language such as VBS, C/C++, etc. The problem is that some customers ask me to throw exceptions from within that COM interface, to be catched at the upper level from where the COM was instantiated.
Does anyone know if this is possible at all, and if so, give me some pointers / hints in how to implement such a thing?
Thanks a lot in advance!
Perry Bruins (Netherlands)
|
|
|
|
|
All exceptions MUST be handled within the component, the only thing you can do is to pass back a HRESULT to indicate what happened. Of course, if you're passing back XML, you can pass back any other info you like, but you'll need to check the HRESULT for success, you simply cannot be throwing excpetions across processes or machines.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|