|
DavidCrow wrote:
It sounds solid, but the only way to know for sure is to try it on several machines
yeah will do that soon
Thanx again.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
In Win32 you would normaly do hardware enumeration to determine if a modem is attached (search codeproject articles). Another method, is to send an AT command out the known ports and check the result (string or code) that is return, if any.
That is all!
INTP
|
|
|
|
|
Thanx.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
I got stuck on a project where it is needed to tell the path name of the program(if any) that is associated with a particular file type, i.e. I should be able to get "c:\\windows\\system32\\notepad.exe" from ".txt". I checked in HKEY_CLASS_ROOT but not every entry there has a "shell\\program" key so I think there must be other ways to retrieve the associated program...
Thanks for your help.
|
|
|
|
|
As I remember the solution is using the function AssocQueryString. Unfortunately I have no source code here for an example.
Jens
|
|
|
|
|
Try this:
char szAssocProgram[MAX_PATH];
DWORD dwSize = MAX_PATH;
HRESULT hr = AssocQueryString(0, ASSOCSTR_EXECUTABLE , ".txt", NULL, szAssocProgram, &dwSize);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I see this in the on-line docs and it says it is available for 2000 and 98 but my version of shlwapi.h in MSVC v6.0 SP6 does not have it.
Which version of shlwapi.h does have it ?
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
Sounds like you need the (updated) Platform SDK.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks for the replies, I really appreciated. geeze, CP is such a good place to hang around...
|
|
|
|
|
The return key on my laptop doesn't work.How do I map the right shift key as the return key. In other words, when I press the right shift, it appears a return in the program.
This is urgent, thanks a lot.
frank
|
|
|
|
|
please explain more !
what do you expect to have, what happens ?
TOXCCT >>> GEII power
|
|
|
|
|
I would think you'd need to create a keyboard hook using SetWindowsHook[Ex]() . When VK_RSHIFT is detected, replace it with VK_RETURN . As I've never tried this, it's only a guess.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have been trying to send an event from a DLL (Dynamically loaded) to a GUI application to display text.
I use shared memory for the transfer of data, also in this shared data area in the handle for this event.
In the DLL I
m_pMsg->hGlobalWriteEvent = CreateEvent(NULL, // no security attributes
FALSE, // manual-reset event
FALSE, // initial state is signaled
"CSLDisplayData" // object name
);
Note m_pMsg is a pointer to the shared memory area.
Then I send the event:-
// Signal GUI to process this request
::SetEvent(m_pMsg->hGlobalWriteEvent);
Now in the GUI I have a thread waiting on this event.
if (::WaitForSingleObject(ThreadData->m_pMsg->hGlobalWriteEvent, INFINITE) == WAIT_OBJECT_0)
{
etc
But this event in the GUI is never fired.
Note I can create and send an event to the thread from the GUI but not from the DLL.
What can I do?
|
|
|
|
|
You do not have to use shared memory in this case.
Just create an event in the GUI and in the DLL and use the same name for both CreateEvent calls. That should do the trick.
Jens
|
|
|
|
|
I have tried that and the only way the events will work if the GUI creates and sets the event.
I cant get working the DLL to create and set an event that the GUI will receive.
Nothing happens?
I thought it was the name that was importance, but decided to use the same handle and that does not work either!!!
|
|
|
|
|
You can't keep an event handle in shared memory. Handles are process-specific numbers and can only be shared between processes with inheritance or DuplicateHandle() .
Each process should call CreateEvent() with the same name. Your parameters also look backwards, it should be auto-reset and initially not signaled.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
You cannot stop me with paramecium alone!
|
|
|
|
|
Ok thanks. Now working when CreateEvent call at both ends.
|
|
|
|
|
I have created a list control with 7 columns and need the user to be able to adjust the width of the columns. This all works fine unless the user adjusts a column width so that a scroll bar is needed. When this is done part of the window refuses to redraw automatically leaving grey patches in place of the data. Running RedrawWindow() (from a button) corrects the problem however I cannot find a message that is always sent when the user completes adjusting a column to run RedrawWindow() automatically. I have tried HDN_ENDTRACK and LVN_COLUMNCLICK plus a couple of less likely candidates all without effect.
Does anybody have any ideas??
Dave Collins
|
|
|
|
|
|
Which version of comctl32? Updating it (by installing latest IE) might fix it...
I remember such problems to. Either there was a flaky comctl32 version out, or it happens only in some "strange" scenarios. Can you reproduce the problem in a simple dialog based application with only the list box on it?
Flirt harder, I'm a Coder
mlog || Agile Programming | doxygen
|
|
|
|
|
How do you find a programs Process ID?
|
|
|
|
|
How about GetCurrentProcessId() ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
That depends on the kind of data you already have.
Is it the current process? Or do you have the name of the executable? Or a window handle?
Jens
|
|
|
|
|
Yeah the name is armyops.exe
|
|
|
|
|