|
i have it bookmarked 
|
|
|
|
|
|
It's looks good, syntax errors aside (missing a closing bracket).
Steve
|
|
|
|
|
Hello,
In the MSDN, GetWindow function page(http://msdn.microsoft.com/en-us/library/windows/desktop/ms633515(v=vs.85).aspx[^]),
Remark section, it's said:
"The EnumChildWindows function is more reliable than calling GetWindow in a loop. An application that calls GetWindow to perform this task risks being caught in an infinite loop or referencing a handle to a window that has been destroyed."
Does anybody know in which case will the risks(caught in an infinite loop or referencing a handle to a window that has been destroyed) happen?
Thanks & BR
|
|
|
|
|
the answer to part of your question is on the page for EnumChildWindows:
A child window that is moved or repositioned in the Z order during the enumeration process will be properly enumerated. The function does not enumerate a child window that is destroyed before being enumerated or that is created during the enumeration process.
|
|
|
|
|
Thanks! I think I got it:
If calling GetWindow in a loop, there might be some problem.
Especially when they might be some window-hierarchy change during the loop.
But still confused why there might be run-into a endless loop?
|
|
|
|
|
xrg_soft@163.com wrote: Does anybody know in which case will the risks(caught in an infinite loop or referencing a handle to a window that has been destroyed) happen?
Any specific reason to use GetWindow instead of EnumChildWindows?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
GetWindow still exists and not marked as obsoleted by MS.
|
|
|
|
|
xrg_soft@163.com wrote: GetWindow still exists and not marked as obsoleted by MS.
try FindWindow then!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I'm trying to discover a better way to determine if IIS is installed with Windows Vista.
I've gone over the registry, the Windows\System32\InetSrv Folder, and all the registry entries and files seem to be intact when you uninstall IIS Server using Windows Features.
So I'm looking at Windows Feature, it know what features are installed, and I'm trying to figure out the method it uses, or the location of the information.
Just wanted to know if anyone out there has any information on this.
|
|
|
|
|
Jim,
jkirkerx wrote: I'm trying to discover a better way to determine if IIS is installed with
Windows Vista.
In one of my old installers it looks like I was checking for the existence of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp however.. I wrote the installer back in 2006 so I do not know if that still works. You should investigate this.
jkirkerx wrote: So I'm looking at Windows Feature, it know what features are installed, and I'm
trying to figure out the method it uses, or the location of the information.
Well I read the documentation for the MsiEnumComponents function[^] and came up with this:
#include <Msi.h>
using namespace std;
#pragma comment(lib, "msi.lib")
VOID SampleEnumerateInstallsFromMSI()
{
DWORD dwRet = 0;
DWORD dwIndex = 0;
TCHAR szProduct[MAX_GUID_CHARS + 1];
while(ERROR_NO_MORE_ITEMS != dwRet)
{
dwRet = MsiEnumComponents(dwIndex, szProduct);
if(ERROR_NO_MORE_ITEMS != dwRet)
{
TCHAR szProductName[MAX_PATH];
DWORD dwCount = MAX_PATH;
DWORD dwSuccess = MsiGetProductInfo(szProduct,INSTALLPROPERTY_PRODUCTNAME,szProductName,&dwCount);
if(ERROR_SUCCESS == dwSuccess)
{
TRACE1("%s was installed from a MSI.\n",szProductName);
}
else if(ERROR_UNKNOWN_PRODUCT == dwSuccess)
{
}
}
++dwIndex;
}
}
Unfortunately when I execute these MSI functions... it seems that it can only enumerate installations that used an MSI package. Here on my workstation it was missing litterally hundreds of software packages. So I decided that I would dig a little deeper and see if I could manage to read the registry and directly extract all of the installed software. Here is the result:
#include <string>
#include <vector>
VOID SampleEnumerateInstallsFromRegistry()
{
CRegKey reg;
BOOL bWow64;
HKEY hkeyLM = HKEY_LOCAL_MACHINE;
TCHAR szBasekey[] = _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData");
IsWow64Process(GetCurrentProcess(),&bWow64);
LONG lResult = reg.Open(hkeyLM,szBasekey,TRUE == bWow64 ? KEY_WOW64_64KEY | KEY_READ:KEY_READ);
if(ERROR_SUCCESS == lResult)
{
TCHAR key[MAX_PATH];
DWORD dwError =0;
int iIndex = 0;
DWORD dwLength = MAX_PATH;
while(ERROR_SUCCESS == (dwError = reg.EnumKey(iIndex,key,&dwLength,0)))
{
CRegKey products_subkey;
TCHAR szRegistryPath[MAX_PATH* 2];
_tcscpy_s(szRegistryPath,MAX_PATH * 2,szBasekey);
_tcscat_s(szRegistryPath,MAX_PATH * 2,_T("\\"));
_tcscat_s(szRegistryPath,MAX_PATH * 2,key);
_tcscat_s(szRegistryPath,MAX_PATH * 2, _T("\\Products"));
lResult = products_subkey.Open(hkeyLM,szRegistryPath,TRUE == bWow64 ? KEY_WOW64_64KEY | KEY_READ:KEY_READ);
if(ERROR_SUCCESS == lResult)
{
dwLength = MAX_PATH;
int iIndexB = 0;
while(ERROR_SUCCESS == (dwError = products_subkey.EnumKey(iIndexB,key,&dwLength,0)))
{
CRegKey install_key;
TCHAR szFinalRegistryPath[MAX_PATH* 2];
_tcscpy_s(szFinalRegistryPath,MAX_PATH * 2,szRegistryPath);
_tcscat_s(szFinalRegistryPath,MAX_PATH * 2,_T("\\"));
_tcscat_s(szFinalRegistryPath,MAX_PATH * 2,key);
_tcscat_s(szFinalRegistryPath,MAX_PATH * 2,_T("\\InstallProperties"));
lResult = install_key.Open(hkeyLM,szFinalRegistryPath,TRUE == bWow64 ? KEY_WOW64_64KEY | KEY_READ:KEY_READ);
if(ERROR_SUCCESS == lResult)
{
TCHAR szDisplayName[MAX_PATH];
dwLength = MAX_PATH;
install_key.QueryStringValue(_T("DisplayName"),szDisplayName,&dwLength);
TRACE1("%s was installed from a non-MSI installer.\n",szDisplayName);
}
dwLength = MAX_PATH;
++iIndexB;
install_key.Close();
}
}
dwLength = MAX_PATH;
++iIndex;
products_subkey.Close();
}
}
reg.Close();
}
Anyway it looks like it is enumerating just about everything I have installed on my workstation. Hopefully you will find it useful and if not maybe someone else will.
Best Wishes,
-David Delaune
|
|
|
|
|
|
That's useful
Out of the box, didn't think of that.
The inetstp is generated on first install, but when you uninstall IIS, the key is still there. That's why I was looking for something deeper.
Let me cruise the keys tomorrow, and do some forensics. That might be the key I was looking for.
Thanks Randor
|
|
|
|
|
Hello, I'm working with CDockablePanes, and I am unable to get maximize/minimize buttons to appear on them. Any help would be greatly appreciated.
|
|
|
|
|
Any Ideas? Adding the options to the window styles has no effect. Does anyone know if it's possible? Ideally I'd like them to look like VS2010 panes (with an extra button for a drop down menu). Please help!
|
|
|
|
|
void lxt971reset()
{
int temp2,temp1;
pioreset1=pioreset1 | 0x0010;
*pioaddr_ptr=9<<24;*piowrdata_ptr=pioreset1;wait(10);*piowr=1;*piowr=0;
wait(1000);
pioreset1=pioreset1 & (~0x0010);
*pioaddr_ptr=9<<24;*piowrdata_ptr=pioreset1;wait(10);*piowr=1;*piowr=0;
}
|
|
|
|
|
Are you going to pay for it?
Every new day is another chance to change your life.
|
|
|
|
|
It is just matter of knowing C bitwise operations and reading the device datasheet (we haven't the latter so how can we help you?).
Veni, vidi, vici.
|
|
|
|
|
|
You damn little egg-headed Belgian detective you.
Veni, vidi, vici.
|
|
|
|
|
You should now spend your time answering the question that was asked at the beginning, rather than complimenting me.
|
|
|
|
|
At the moment I'm stuck at temp1 and temp2 interpretation.
Veni, vidi, vici.
|
|
|
|
|
Veni, vidi, ristagnavi
|
|
|
|
|
Veni, vidi, supersedi.
Veni, vidi, vici.
|
|
|
|
|
i think this belongs in the Hall Of Shame
|
|
|
|
|