|
Can you show snippet code how do you use?
|
|
|
|
|
Hi
Does anyone knows how can I get the list of applications that appears when you try to open a file with a unregistered extension?
Thanks in advance
Sebastian
|
|
|
|
|
Sorry, I reread your question and realised I pointed you to the wrong location. For the "open with" list, open regedit and navigate to HKEY_USERS. You will see a few unique id strings which makes it hard to give you a specific location. Use the search feature and search for "openwithlist", it should bring up a list of file extensions and details for each program to use.
-- modified at 12:03 Friday 29th September, 2006
|
|
|
|
|
The problem, is that I dont have an specific extension to look for.
Maybe I could check all the file extensions, and get all the exe files
filter the duplicated ones, and that will give me all the apps list.
I hoped Microsoft already have some kind of funtion to do that.
Thanks a lot mate , I think I have a lot of work to do
|
|
|
|
|
no, all the open with's relate to each file type. So really you must know the file extension in order to know how to open the file. There is no such tool capable of doing what you want.
If you are trying to build a list of every instance of an "open with", you will need to parse each users account since one extension may not always be the same. Ie, I use UltrEdit for .txt files, but my wife uses Notepad (YuKK!!).
|
|
|
|
|
I needed a list of the main computer applications to authorize or deny the access of the application to a real time encripted disk.
|
|
|
|
|
I wouldn't rely on all the applications requiring access to be listed in the registry. For your type of application I would be more inclined to halt the process and prompt the user before allowing access, your own app can then store it's own list. Something similar to how a firewall works.
|
|
|
|
|
I found the solution to my problem.
To get a list of all the installed apps like the one you see when you select "Open With" after trying to execute a file with an unregistered extension.
You need to list the contents of the following registry key
Hope it helps someone in the future
HKEY_LOCAL_MACHINE
SOFTWARE
Microsoft
Windows
CurrentVersion
App Paths
|
|
|
|
|
if(i==SE_ERR_NOASSOC)
WinExec("rundll32.exe shell32.dll, OpenAs_RunDLL " +str, SW_SHOWNORMAL);
code for this
|
|
|
|
|
Hey,
I've a Application with a CFromView dervied class with a couple of CEdit controls. I store the Pointer (CWnd*) of the Control (retrieved with GetDlgItem(...)) in an Array on a second TopLevel Dialog. This dialog has a listbox where you can choose the edit controls. If the user select an item on the listbox, i want to set the focus to the control in my CFormview.
CWnd *pEditControl = arrayEditControls[2];
But when I call pEditControl->SetFocus() I get an exception...Why?
|
|
|
|
|
AnTri wrote: I store the Pointer (CWnd*) of the Control (retrieved with GetDlgItem(...)) in an Array...
GetDlgItem() returns a temporary pointer that should not be stored. Store the window handle instead.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Ok, but when nothing happens with my CFormView (Controls) why is my (stored) pointer invalid. I thought the CWnd* is valid as long as the window exits.
Is the a better way to restore my CWnd* as the following:
<br />
CWnd test;<br />
test.Attach(m_hWnd);
...
test.Detach()<br />
|
|
|
|
|
AnTri wrote: Is the a better way to restore my CWnd* as the following:
Yes, but if you are only talking about a few edit controls, why not just store the CEdit object itself?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Do you mean a pointer to CEdit - Object? (the CEdit Object itself is located in my CFormView class). I thought CEdit is dervied from CWnd and thats why I originally stored the CWnd* pointer...
What do you think about my previous question?
Ok, but when nothing happens with my CFormView (Controls) why is my (stored) pointer invalid. I thought the CWnd* is valid as long as the window exits.
|
|
|
|
|
The problem you are having is that GetDlgItem actually returns a CTempWnd* pointer.
MFC keeps a map of all the windows that are created. It maps CWnd objects to HWND handles making it very fast for MFC to find a CWnd given an HWND. When you have a window that is not created via CWnd::Create (your dialog controls in this instance), those windows are not include in the map. If GetDlgItem finds the window you want in the map it will return that CWnd* pointer, if not it will create a CTempWnd* pointer that you can use as a CWnd, but it is not added to the map. When that CTempWnd* pointer goes out of scope the CWnd object (as opposed to the HWND handle it wraps and the window it points to) is destroyed. If you save that pointer for later use it will just point to garbage.
That is why the docs for GetDlgItem state:
The returned pointer may be temporary and should not be stored for later use.
|
|
|
|
|
PJ Arends wrote: When you have a window that is not created via CWnd::Create (your dialog controls in this instance), those windows are not include in the map.
Just an FYI, that is not entirely true... I am fairly certain that if you use CWnd::SubclassWindow(...) or CWnd::Attach(...) to associate a CWnd -based object with an HWND and then call CWnd::GetDlgItem(...) for that particular HWND 's control ID, you will get a pointer to that particular CWnd object, and not a temporary CTempWnd pointer.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Does anyone have a basic reference for working with a DLL in a VC++ program? For example, suppose I have Sample.DLL which contains function Setup(int, int). I presume I have to do something to link the DLL to my program? Include? Do I just use Setup(int, int) in my program? Do I have to declare it in my program? Qualify it? (What if another DLL also contains Sample(int, int)?)
I'm looking for an article like, "Getting Started With A DLL." Any suggestions? Thanks.
|
|
|
|
|
Look here[^], you'll probably find what you are looking for.
|
|
|
|
|
Thanks. Many of those articles are perfect for someone beginning to work with DLL's.
|
|
|
|
|
|
With Visio 2003 Pro there is an option to design (under) File -> New -> Windows XP User Interface option.
Is it possible to import this 'dialog' into a Visual Studio 2005 MFC C++ application. This would allow someone to design the GUI away from the target project; i.e. GUI design in Viso and implementation in Visual Studio.
Sorry if this is the wrong forum for this message.
Cheers,
Andy.
|
|
|
|
|
Does Visio export a format that VS can understand?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Can u suggest me Whitebox testing tools for vc++ application
For online audio/video communications
Freeware if any..
or any Links..
Thanks & Regrads
-- modified at 6:44 Friday 29th September, 2006
|
|
|
|
|
there are lots n lots of tools available now for white box and black box testing .....i m sending u one link may be it will help u
Shilpi
http://www.aptest.com/resources.html
|
|
|
|
|
Nice, but no freebies
|
|
|
|