|
EnumProcesses shows each process on the system but what do you need exactly?
|
|
|
|
|
DWORD dwPID[16860];
DWORD dwRet;
DWORD dwNumProcesses;
if (TRUE == EnumProcesses(dwPID,sizeof(dwPID),&dwRet))
{
dwNumProcesses = dwRet / (sizeof(DWORD);
for(int i =0;i < dwNumProcesses;++i)
{
printf(_T("Process ID = %d"),dwPID[i];
}
}
Best Wishes,
-Randor (David Delaune)
|
|
|
|
|
This function can check if a process is running by checking the executable name. You may want to add additional checking such as window class enumeration or enumeration of known loaded modules.
BOOL IsExecutableRunning(TCHAR *lpszExe)
{
HANDLE hSnapShot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
PROCESSENTRY32 processInfo;
processInfo.dwSize=sizeof(PROCESSENTRY32);
while(Process32Next(hSnapShot,&processInfo)!=FALSE)
{
if(processInfo.th32ProcessID > 12 && _tclen(processInfo.szExeFile) > 0)
{
if(_tcscmp(processInfo.szExeFile,lpszExe) == 0)
{
CloseHandle(hSnapShot);
return TRUE;
}
}
}
CloseHandle(hSnapShot);
return FALSE;
}
Best Wishes,
-Randor (David Delaune)
|
|
|
|
|
I am trying to get and set the following information from File/Open save dialog of Microsoft Office 2000/2003/2007
1.Retrieve the currently displayed/selected folder path and also the file name that is selected if any.
2. Retrieve the selected file path, when the user clicks the open or save button.
3.Set a pre-defined string path within the file-name combo box.
I have been able to do the above task in case of File Open/Save common controls dialog(used by WordPad ,Notepad,
Acrobat Reader etc.) by using the dialog functions depicted in MSDN. But it is not working with Microsoft Office Dialog and I have found no MSDN documentation that depicts the internal messages of Microsoft Office Dialogs.
Please help me if you can.
Thanks and regards,
|
|
|
|
|
Microsoft Office doesn't use the common dialog for file open/save AFAIK.
The Office dialogs may well be undocumented. From our point of view, the
MS Office suite of applications are proprietary 3rd-party applications, not part of the
operating system, so there's no reason the dialogs and their functionality should be
documented.
You may get a reply here from someone with the info you need.
In the meantime, here's a couple links you may or may not have been to already:
Office Developer Center[^]
MSDN Newsgroups: Office Solutions Development[^]
That's all the info I have
Good luck!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Sir,
Thank you for your effort to help me out.
I will check those links mentioned by you.
Thanks for this and the welcome message at the lounge.
Regards,
|
|
|
|
|
What's the difference between an "MFC extension DLL" and a "regular DLL with MFC dynamically linked" ?
What are the uses for each type?
I asked this question on codeguru and was met with an extraordinarily arrogant non-answer. If that's what you plan on posting, please keep it to yourself.
Thanks,
Sam.
|
|
|
|
|
an MFC Ext DLL is one that exports C++ classes using MFC as a base. a regular DLL exports C-style functions.
or, as MS puts it...
|
|
|
|
|
so then the "regular dll that uses MFC" can't contain classes? for instance, if i wanted to put a dialog and associated functions in a dll, i would use the extension dll whereas if i were only creating functions that say, operated on a CString, i could do that in a "regular dll that uses MFC" ?
|
|
|
|
|
USAFHokie80 wrote: so then the "regular dll that uses MFC" can't contain classes?
it can contain them, sure. you can even export them: (for example).
but if you want to export C++ classes, you'll really should use an MFC extension DLL. most importantly, this ensures that the app and the DLL are using the same heap for memory allocation - don't want to pass a CString which has allocated memory into a DLL which is looking at a different heap...
or, as MS puts it: "If you need to pass an MFC or MFC-derived object pointer to or from an MFC DLL, the DLL should be an extension DLL."
|
|
|
|
|
Ah. That makes more sense. I don't use DLLs really, so that's probably the problem here. Just trying to figure out the difference so that I can start using them correctly.
|
|
|
|
|
Here's another link (very close to Chris' first link)...
Kinds of DLLs[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Chris Losinger wrote: but if you want to export C++ classes, you'll really should use an MFC extension DLL.
If the DLL uses MFC otherwise a simple DLL will suffice.
|
|
|
|
|
Hi,
I want to add drop shadow to a child window...
please help me.
thank you.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
I will assume you're using MFC:
BOOL CShadowDlg::OnInitDialog()
{
CDialog::OnInitDialog();
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
::SetClassLong(
GetSafeHwnd(),
GCL_STYLE,
::GetClassLong(GetSafeHwnd(), GCL_STYLE) | CS_DROPSHADOW
);
return TRUE;
}
Note that CS_DROPSHADOW requires a Windows version >= XP.
Note that after this code is run ALL dialogs will have shadows!
Steve
|
|
|
|
|
Is it possible to set drop shadow for controls ?
|
|
|
|
|
I don't think so. You could always implement this functionality yourself however.
Steve
|
|
|
|
|
I used this in my dialog, After that try to hide the dialog, Dialog is hiding but the shadow is not hiding. I am using ShowWindow(SW_HIDE).
|
|
|
|
|
Hi,
I'm implementing an simulator and the user interacts with an image reflected in a mirror. How can I do this reflection, how can I flip or change this 3d world?
I'm using C++ language with Opengl and OpenHaptics (Phantom Omni library).
Regards,
|
|
|
|
|
You would be better off reading the docs for OpenGL since your question is more related to interacting with the OpenGL graphic drivers than C or C++.
Waldermort
|
|
|
|
|
Hi,
I am trying to debug a dll project on VC++ 6.0. Dll file is loading dynamically in the executable (Win32 Console Application) by LoadLibrary API and calling functions by using function pointers. How can I debug this DLL file?
Thank you.
Orkun GEDiK
Senior SAP R/3 Basis and Development Consultant
ASTRON
|
|
|
|
|
You can specify a executable to be stared when you want to debug your dll. I don't remember exactly where it was for VC6 but it was somewhere in the project properties.
|
|
|
|
|
Hi Cédric,
I tried that method before, but didn't work. This is because, as I emphasised in the message, "DLL is loading by LoadLibrary API" in executable. Is there any other suggestion?
Thank you.
Orkun GEDiK
Senior SAP R/3 Basis and Development Consultant
ASTRON
|
|
|
|
|
In MSDEV take Build->Start Debug->Attach To Process. You can see the running process, from which u can select the application which loaded ur dll. open the cpp of ur dll and u can insert breakpoint and can debug.
Another way: On Process tab of Task manager right the exe application, which load the dll, and select debug. MsDEV will open, then u can insert break point on ur dll's cpp file and can debug.
AJay
|
|
|
|
|
At the entry point of your DLL include a api call to DebugBreak()
|
|
|
|