|
Is it possible to enumerate toolbars attached to a window? I have made a
program similar to SPY++ that comes with Visual Studio. It first enumerates
all processes, all threads, all thread windows, then all thread children. In all that mess
toolbar windows do no show up as children of anything. If you look at SPY++
and look at a program like Calcs children there are NO toolbars listed, only
controls like buttons and edit boxes.
I think I can FindWindows that are of a CtoolBar class but I don't think
that covers all cases and I don't know if I can relate it back to the
correct process let alone the correct window.
Thanks in advance,
Jason
|
|
|
|
|
I've noticed that sometimes dialog controls can show up in the list of top level windows for an application (usually custom creation code).
Also, apps often have more that one top level window, and contain controls that are created in other modules (COMCTL32.DLL, e.g.). I wonder if a call to GetTopWindow(NULL) and subsequent GetNextWindow(...) would find the toolbars.
Remember some windows have no parent, and even no owner, so you can't rely on all of an apps windows existing in an ancestral chain.
|
|
|
|
|
The following are defined global:
char *CmdTable[] = {"quit", "help"};
char *args[10];
I have a function called Search as follows:
int Search()
{
int iResult = -1;
int iEnd = 1;
int iCount = 0;
while (iCount <= iEnd)
{
if (args[0] == CmdTable[iCount]) return iCount;
iCount++;
}
return iResult;
}
and in main I call the function like this:
int iNum = Search();
Now, when going through the Search function and both args[0] and CmdTable[iCount] are equal to eachother it skips right over it as if they are not ... anybody know why that happens? I'm completely lost here because it should work!!
Thanks in advance, James
|
|
|
|
|
args[0] is a pointer to a char-array and so is CmdTable[iCount].
You are comparing the pointers to two different strings, instead of comparing the strings...
try with: if (strcmp(args[0], CmdTable[iCount]) == 0) return iCount;
- Anders
|
|
|
|
|
Sweet, that worked! Thank you very much for the help
- James
|
|
|
|
|
Sweet, that worked! Thank you very much for the help
- James
|
|
|
|
|
in LAN
VC
can u help me ?
|
|
|
|
|
I am a beginner using Visual C++ and MFC. I have made a dialog-based application and want the program to quit when i click on a quit button. How do I write a quit function?
Thanks
James Bird - birdjames@bigfoot.com
|
|
|
|
|
if you look at the generated code from appwizard you will see that the DoModal() function returns to the app with either an IDOK or an IDCANCEL value and then exits ... just let one of your buttons exit the modal dialog code with a return value (anything you want really) and it will close the dialog app
elsewise you could post a WM_CLOSE message
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
You can also call OnOK or OnCancel . The difference is in the value returned from your dialogs DoModal call. You might even try EndModalLoop if you want to get fancy, but that would be unusual.
|
|
|
|
|
Does anyone have expirience in implementing radiobutton control?
What's with exclusive value?
|
|
|
|
|
How can I automatically show a tooltip, say after each one minute
Thank you.
|
|
|
|
|
Anybody know good calss for zomming in view ?
|
|
|
|
|
Anybody know good calsss for zomming in view ?
|
|
|
|
|
Try this,
http://codeguru.earthweb.com/doc_view/zoom_scale.shtml
|
|
|
|
|
How I can add my text to the title text on the Main Frame ?
For example:
- My application name is "My_Program"
- I have project in this application - "Project_1" //like vc project
- I want than would be next: "My_program - Project_1"
- A project associate with some date (Not only with document) i.e. even all doc/view is closed
the project may be open. (Until a command -"close project").
thx.
|
|
|
|
|
To set your window's text, use.... SetWindowText("blah blah"); Do this in your CMainFrame, when-ever you want it to change, to whatever you like.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
One can also use the OnShowWindow function to track with, each doc comes in and out of view. Then you can use the SetWindowText to change from xxx - Project 1 to xxx - Project n...
Ed Dixon
|
|
|
|
|
Override the virtual function CMailFrame::OnUpdateFrameTitle()
--Mike--
http://home.inreach.com/mdunn/
This must be Thursday. I never could get the hang of Thursdays...
|
|
|
|
|
Hi,
I want to launch Direct Cable connection programmatically. Is there any API available for that? Can I use RAS API? RAS does not enumerate Serial Ports. Any help will be highly appreciated.
Thanks in advance.
SAntosh
|
|
|
|
|
CPaintDC dc(this);
HBITMAP hbitmap =
::LoadBitmap(::AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDB_TEST));
HDC hMemDC = ::CreateCompatibleDC(NULL);
SelectObject(hMemDC,hbitmap);
::StretchBlt(dc.m_hDC, 33, 22, 10, 3, hMemDC, 0, 0, 6, 6,SRCCOPY);
::DeleteDC(hMemDC);
::DeleteObject(hbitmap);
This paints a bitmap image on the dialog, but what about icons??? Can i change this code
so it paints a icon instead of a bitmap??? if so how??
Thank you..
|
|
|
|
|
If you look in your OnPaint for any dialog based app you may have written, you'll find this:
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
So it would appear you can draw an icon into a DC and then stretch it into another, if you so desire.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Dear all,
I'm a junior developer writing mixed C/C++ based applications in Windows (using the VC++ command line tools, but not the DevStudio GUI). One of the question that I have the most trouble understanding is how does the build process really works. What is a precompiled header file? What's the difference between an .obj, a .dll, and a .lib file? How is an export table defined? How do a link all the .lib and .dll file together to make an executable? In many occasions it takes much more time finding out how to build and link properly than the actual coding part. I'm sure there are a lot more questions of this kind that are alluding junior developers everyday, since no good books are available and websites on the Internet (like CodeProject) rarely mentions anything on this subject. The MSDN website has a big chunk of reference manuals online about Compiling and Linking, but it offers almost little help for beginners who tries to learn this subject. Can anyone point me to some useful printed or Internet resources available? I'm hoping that someone in the CodeProject community can write an article on this subject too Thanks.
|
|
|
|
|
For a bit of a learning experience, try using the DevStudio GUI for a project and have a peek into the .DSP file (most of the commands for compile/link are there) or alternatively have the GUI export a makefile for you and inspect that one instead. It won't answer all your questions, but it should answer some of them.
Chris
|
|
|
|
|
I have developed a keyboard for the screen, but I need to send the keystrokes
to the application like MS Word. Right now the keyboard is in a floating window
capturing the mouse input but I want to send keystrokes to the other application,
ie. have another application capture the keystrokes even though it does not have
focus.
Is there a way of having the keyboard on top, getting mouse events but not taking
focus?
How do I send keyboard events to another application/window?
Please email me...dostie@nettaxi.com
THANKS!
|
|
|
|