|
I need to hook the mouse move so I can set/release the capture there ? That sounds like a fine idea. Actually I've always wanted to learn about hooks, but never had an excuse to.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
I need to hook the mouse move so I can set/release the capture there ?
No - with a global mouse hook your procedure will receive all mouse messages. The need for SetCapture disappears, everyone is happy. The only drawback is that global hook must live in a DLL.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
OK, will I be able to turn it off and on ? I only need all messages in one specific dialog.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
OK, will I be able to turn it off and on ?
Yes, UnhookWindowsHookEx has a nice name and does the magic
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for the info. This will save my bacon nicely, as well as giving me a good excuse to finally learn how to put together a dll, and a Windows hook.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Arrggghhh....
On one of my dialogs, I've got a combo box with its type set to Drop List, and Owner Draw set to No. There's nothing unusual about the combo box, it contains four items (for now), but, for some reason, when you make the combo box drop, you can only see one item in the list. There are the usual scroll bars on the right, and all the items are there, but what I'm really after is having the box display all four items without the scroll bars (when dropped). I've tried disabling Vertical scroll, enabling Disable no scroll, and just about everything I can think off, but none of them give the desired effect.
Any ideas folks? Its such a basic thing and really doing my head in!
|
|
|
|
|
when you are in your dialog resource window (the window where you were when you first put the combobox on the dialog) click on the arrow of the combobox as if you were going to drop it down and the bottom 'handle' should turn from white to blue. Take that and drag it down and the 'mask' around the combobox should have a bunch of empty space under the box. The empty space is how far down your combobox will drop down during runtime.
Hope this helps.
-Zack
|
|
|
|
|
Zack. You should be paid more! Thanks very much.
|
|
|
|
|
Is there a good method for faking mouse movements and clicks? I want to be able to move the mouse to a specific coordinate and make it 'click' that point (not inside of my application).
|
|
|
|
|
|
|
In your configuration screen by add/remove programs you can see a list of all installed software. Now I want to make an array that does the same, show me all the installed software by name. Then together with your computer name send that information to a text file. Later on the system administrator can check the text file and send it to a database.
Can someone help me with this problem.
Thanks
Hessel
|
|
|
|
|
this is the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
enumerate its sub-keys
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
Hi Y'all
I am trying to insert a CString into a database table.
this is what I have but it literally puts the %s into the table remove the ' and I get an error.
CString CSWholesentence = "This is the whole sentence";
SqlString = "INSERT INTO Sentences (SENTENCE) "
"VALUES ('%s')", CSWholesentence;
database.ExecuteSQL(SqlString);
Any help greatly appreciated.
Cheers
Tryhard
|
|
|
|
|
use this instead
SqlString = "INSERT INTO Sentences (SENTENCE) VALUES('";
Sqlstring += CSWholeSentence;
SqlString += "')";
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
Thanks Guys.
Sorted.
Tryhard
|
|
|
|
|
The % replacement only works in sprintf(), CString::Format(), and their variations. It is not a feature of C++.
CString sql;
sql.Format ( _T("INSERT INTO Sentences (SENTENCE) VALUES ('%s')"), (LPCTSTR) CSWholesentence ); Note that you need to cast a CString to LPCTSTR (as I did above) when it's being used as the string for a %s substitution.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Note that you need to cast a CString to LPCTSTR (as I did above) when it's being used as the string for a %s substitution.
Why would this be? I have used format without the LPCTSTR cast quite successfully in a number of projects.
|
|
|
|
|
You don't have to cast to LPCTSTR. CString contains only the actual pointer to the null-terminated, C-style string. If you pass CString by value, two things happen
- a space on the stack is reserved. It has a size of 4 bytes on 32-bit Windows, b/c sizeof(CString) == sizeof(TCHAR *)
- CString copy c'tor is called (it's cheap, b/c CString uses refcounting and copy-on-write)
From the Format/*printf (and all other functions expecting char *) point of view, the CString on the stack looks exactly the same as plain old char* pointer - that's why this works.
The only thing you can worry about is that in VC 8 they'll change internal representation of CString, but I'd say it's *very* unlikely - too much code is written using the assumptions above.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Because a CString is not a LPCTSTR. It may work now, but it's still wrong to leave out the cast. I'll keep doing it.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Is there a way to set the color of a list controls column headder?
Thanks,
Rob
|
|
|
|
|
It's easy to do with custom draw. Check out NM_CUSTOMDRAW in MSDN (and be sure to read the header control variety, NM_CUSTOMDRAW works differently for different controls).
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Thanks Mike.. I'll take a look.
Rob
|
|
|
|
|
I know it is late but can someone help me with this, I know sh*t about c++ but I have to have this stupid course and have to get his assignment done can someone
|
|
|
|
|
A couple of things.
1/ No-one can help you if you don't post the question.
2/ Hopefully no-one will help you if you just post your assignment and expect a free ride. I'm sure everyone will be keen to help if you post your attempt at the problem and explain where you are stuck. If you 'know s*it' about C++, then it probably means you need to study more. Unless you're *never* going to look at C++ again, there is no point us helping you pass something you know nothing about. You're only going to find the cost of entry in terms of learning what you're supposed to know will increase the further you go without knowing your stuff.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|