|
Thanks for the replies Where can I find DECODE.CPP / .H
I guess my best bet now would be to check all the HRESULTS returned from the functions and make sure they are defined in winerror.h before I do a SetLastError() with them, and change them to something close that is defined otherwise;)
|
|
|
|
|
The Decode sample is from 1996, but it should pop up if you search the MSDN for "DECODE.CPP".
I think there's a good chance a lot of the codes will map to win32, but it might be a grey area. There is a macro to map a win32 error to an HRESULT.
|
|
|
|
|
How does Onkeydown work???
I cant get my dialog to show a messagebox when i press the "S" key
I tryed lots of things, cant get it to work
I need some help or tip's
THANK you!!
|
|
|
|
|
You might want to look at OnGetDlgCode, which is a handler for the WM_GETDLGCODE message. If you override it for your dialog and return DLGC_WANTALLKEYS you might see a difference - check the docs for other constants.
Windows sends a window this message to see what it wants in terms of tab, arrows, etc. Note, for instance, that a dlg control might not ask for the tab char, since that would interfere with the hanling of the tab key by the parent dialog.
Mind, I would think 'S' would get through. Hmmm...
|
|
|
|
|
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..
|
|
|
|